Changeset 95525 in webkit
- Timestamp:
- Sep 20, 2011 3:41:11 AM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r95524 r95525 1 2011-09-20 Adenilson Cavalcanti <adenilson.silva@openbossa.org> 2 3 [Qt] resizeToContent seems to trigger infinite resize on some pages 4 https://bugs.webkit.org/show_bug.cgi?id=43852 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 InnerHeight and InnerWidth are now calculated using ScrollView::visibleContentRect 9 including the scrollbars (if any) instead of using ScrollView::frameRect as before. 10 11 This makes no behavior change while not using the tiled backing 12 store and is compliant with the W3C definition stated in the CSSOM 13 View Module. 14 15 Plus it will return the correct values for tiled backing store, 16 thus fixing the original bug report by avoiding infinite resize 17 events caused by wrong innerHeight and innerWidth values. 18 19 Test: innerWidth/Height are covered by existing tests. The 20 non-infinite resizing is covered by a new Qt autotest at 21 test_qgraphicswebview::windowResizeEvent() 22 23 * page/DOMWindow.cpp: 24 (WebCore::DOMWindow::innerHeight): using ScrollView::visibleContentRect. 25 (WebCore::DOMWindow::innerWidth): using ScrollView::visibleContentRect. 26 1 27 2011-09-09 Pavel Podivilov <podivilov@chromium.org> 2 28 -
trunk/Source/WebCore/page/DOMWindow.cpp
r95271 r95525 1094 1094 return 0; 1095 1095 1096 return static_cast<int>(view-> height() / m_frame->pageZoomFactor());1096 return static_cast<int>(view->visibleContentRect(/* includeScrollbars */ true).height() / m_frame->pageZoomFactor()); 1097 1097 } 1098 1098 … … 1106 1106 return 0; 1107 1107 1108 return static_cast<int>(view-> width() / m_frame->pageZoomFactor());1108 return static_cast<int>(view->visibleContentRect(/* includeScrollbars */ true).width() / m_frame->pageZoomFactor()); 1109 1109 } 1110 1110 -
trunk/Source/WebKit/qt/ChangeLog
r95387 r95525 1 2011-09-20 Adenilson Cavalcanti <adenilson.silva@openbossa.org> 2 3 [Qt] resizeToContent seems to trigger infinite resize on some pages 4 https://bugs.webkit.org/show_bug.cgi?id=43852 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 Test by Luiz Agostini. 9 10 * tests/qgraphicswebview/tst_qgraphicswebview.cpp: 11 (ResizeSpy::receiveResize): 12 (ResizeSpy::size): 13 (tst_QGraphicsWebView::windowResizeEvent): 14 1 15 2011-09-17 Mihai Parparita <mihaip@chromium.org> 2 16 -
trunk/Source/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
r87514 r95525 42 42 void crashOnSetScaleBeforeSetUrl(); 43 43 void widgetsRenderingThroughCache(); 44 void windowResizeEvent(); 45 44 46 #if !(defined(WTF_USE_QT_MOBILE_THEME) && WTF_USE_QT_MOBILE_THEME) 45 47 void setPalette_data(); … … 608 610 #endif 609 611 612 class ResizeSpy : public QObject { 613 Q_OBJECT 614 public slots: 615 void receiveResize(int width, int height) 616 { 617 m_size = QSize(width, height); 618 emit resized(); 619 } 620 621 QSize size() const 622 { 623 return m_size; 624 } 625 626 signals: 627 void resized(); 628 629 private: 630 QSize m_size; 631 }; 632 633 void tst_QGraphicsWebView::windowResizeEvent() 634 { 635 QGraphicsWebView webView; 636 ResizeSpy resizeSpy; 637 resizeSpy.setProperty("resizeCount", 0); 638 639 QString html = "<html><body><script>" 640 "function onResize() { window.resizeSpy.receiveResize(window.innerWidth, window.innerHeight); }" 641 "window.addEventListener('resize', onResize , false);" 642 "</script></body></html>"; 643 644 webView.page()->mainFrame()->setHtml(html); 645 webView.page()->mainFrame()->addToJavaScriptWindowObject("resizeSpy", 646 &resizeSpy); 647 webView.setGeometry(QRect(0, 0, 50, 50)); 648 QVERIFY(::waitForSignal(&resizeSpy, SIGNAL(resized()), 1000)); 649 QCOMPARE(resizeSpy.size(), QSize(50, 50)); 650 651 webView.page()->setActualVisibleContentRect(QRect(10, 10, 60, 60)); 652 webView.setGeometry(QRect(0, 0, 100, 100)); 653 waitForSignal(&resizeSpy, SIGNAL(resized()), 1000); 654 655 // This will be triggered without the fix on DOMWindow::innerHeight/Width 656 QCOMPARE(resizeSpy.size(), QSize(60, 60)); 657 } 658 610 659 QTEST_MAIN(tst_QGraphicsWebView) 611 660
Note: See TracChangeset
for help on using the changeset viewer.