Changeset 70297 in webkit
- Timestamp:
- Oct 22, 2010 2:57:59 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r70296 r70297 1 2010-10-22 Benjamin Poulain <benjamin.poulain@nokia.com> 2 3 Reviewed by Simon Hausmann. 4 5 [Qt] All widgets are rendered incorrectly when rendered through a cache 6 https://bugs.webkit.org/show_bug.cgi?id=47767 7 8 When a widget is not available to the RenderTheme, default 9 value are used for the state. 10 11 * platform/qt/RenderThemeQt.cpp: 12 (WebCore::initStyleOption): 13 (WebCore::RenderThemeQt::paintButton): 14 (WebCore::RenderThemeQt::paintTextField): 15 (WebCore::RenderThemeQt::paintMenuList): 16 (WebCore::RenderThemeQt::paintMenuListButton): 17 (WebCore::RenderThemeQt::paintProgressBar): 18 (WebCore::RenderThemeQt::paintSliderTrack): 19 1 20 2010-10-22 Zoltan Herczeg <zherczeg@webkit.org> 2 21 -
trunk/WebCore/platform/qt/RenderThemeQt.cpp
r69411 r70297 81 81 using namespace HTMLNames; 82 82 83 inline static void initStyleOption(QWidget *widget, QStyleOption& option) 84 { 85 if (widget) 86 option.initFrom(widget); 87 else { 88 /* 89 If a widget is not directly available for rendering, we fallback to default 90 value for an active widget. 91 */ 92 option.state = QStyle::State_Active | QStyle::State_Enabled; 93 } 94 } 95 83 96 84 97 StylePainter::StylePainter(RenderThemeQt* theme, const PaintInfo& paintInfo) … … 539 552 540 553 QStyleOptionButton option; 541 if (p.widget) 542 option.initFrom(p.widget); 543 554 initStyleOption(p.widget, option); 544 555 option.rect = r; 545 556 option.state |= QStyle::State_Small; … … 572 583 573 584 QStyleOptionFrameV2 panel; 574 if (p.widget) 575 panel.initFrom(p.widget); 576 585 initStyleOption(p.widget, panel); 577 586 panel.rect = r; 578 587 panel.lineWidth = findFrameLineWidth(qStyle()); … … 641 650 642 651 QtStyleOptionWebComboBox opt(o); 643 if (p.widget) 644 opt.initFrom(p.widget); 652 initStyleOption(p.widget, opt); 645 653 initializeCommonQStyleOptions(opt, o); 646 654 … … 685 693 686 694 QtStyleOptionWebComboBox option(o); 687 if (p.widget) 688 option.initFrom(p.widget); 695 initStyleOption(p.widget, option); 689 696 initializeCommonQStyleOptions(option, o); 690 697 option.rect = r; … … 736 743 737 744 QStyleOptionProgressBarV2 option; 738 if (p.widget) 739 option.initFrom(p.widget); 745 initStyleOption(p.widget, option); 740 746 initializeCommonQStyleOptions(option, o); 741 747 … … 778 784 779 785 QStyleOptionSlider option; 780 if (p.widget) 781 option.initFrom(p.widget); 786 initStyleOption(p.widget, option); 782 787 option.subControls = QStyle::SC_SliderGroove | QStyle::SC_SliderHandle; 783 788 ControlPart appearance = initializeCommonQStyleOptions(option, o); -
trunk/WebKit/qt/ChangeLog
r70259 r70297 1 2010-10-22 Benjamin Poulain <benjamin.poulain@nokia.com> 2 3 Reviewed by Simon Hausmann. 4 5 [Qt] All widgets are rendered incorrectly when rendered through a cache 6 https://bugs.webkit.org/show_bug.cgi?id=47767 7 8 Add a new test for rendering with tiling. 9 10 * tests/qgraphicswebview/tst_qgraphicswebview.cpp: 11 (tst_QGraphicsWebView::widgetsRenderingThroughCache): 12 1 13 2010-10-21 Robert Hogan <robert@webkit.org> 2 14 -
trunk/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
r61984 r70297 36 36 void focusInputTypes(); 37 37 void crashOnSetScaleBeforeSetUrl(); 38 void widgetsRenderingThroughCache(); 38 39 }; 39 40 … … 141 142 } 142 143 144 void tst_QGraphicsWebView::widgetsRenderingThroughCache() 145 { 146 // Widgets should be rendered the same way with and without 147 // intermediate cache (tiling for example). 148 // See bug https://bugs.webkit.org/show_bug.cgi?id=47767 where 149 // widget are rendered as disabled when caching is using. 150 151 QGraphicsWebView* webView = new QGraphicsWebView; 152 webView->setHtml(QLatin1String("<body style=\"background-color: white\"><input type=range></input><input type=checkbox></input><input type=radio></input><input type=file></input></body>")); 153 154 QGraphicsView view; 155 view.show(); 156 QGraphicsScene* scene = new QGraphicsScene(&view); 157 view.setScene(scene); 158 scene->addItem(webView); 159 view.setGeometry(QRect(0, 0, 500, 500)); 160 QWidget *const widget = &view; 161 QTest::qWaitForWindowShown(widget); 162 163 // 1. Reference without tiling. 164 webView->settings()->setAttribute(QWebSettings::TiledBackingStoreEnabled, false); 165 QPixmap referencePixmap(view.size()); 166 widget->render(&referencePixmap); 167 168 // 2. With tiling. 169 webView->settings()->setAttribute(QWebSettings::TiledBackingStoreEnabled, true); 170 QPixmap viewWithTiling(view.size()); 171 widget->render(&viewWithTiling); 172 QApplication::processEvents(); 173 viewWithTiling.fill(); 174 widget->render(&viewWithTiling); 175 176 QCOMPARE(referencePixmap.toImage(), viewWithTiling.toImage()); 177 } 178 143 179 void tst_QGraphicsWebView::microFocusCoordinates() 144 180 {
Note: See TracChangeset
for help on using the changeset viewer.