+2011-09-20 Adenilson Cavalcanti <adenilson.silva@openbossa.org>
+
+ [Qt] resizeToContent seems to trigger infinite resize on some pages
+ https://bugs.webkit.org/show_bug.cgi?id=43852
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ InnerHeight and InnerWidth are now calculated using ScrollView::visibleContentRect
+ including the scrollbars (if any) instead of using ScrollView::frameRect as before.
+
+ This makes no behavior change while not using the tiled backing
+ store and is compliant with the W3C definition stated in the CSSOM
+ View Module.
+
+ Plus it will return the correct values for tiled backing store,
+ thus fixing the original bug report by avoiding infinite resize
+ events caused by wrong innerHeight and innerWidth values.
+
+ Test: innerWidth/Height are covered by existing tests. The
+ non-infinite resizing is covered by a new Qt autotest at
+ test_qgraphicswebview::windowResizeEvent()
+
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::innerHeight): using ScrollView::visibleContentRect.
+ (WebCore::DOMWindow::innerWidth): using ScrollView::visibleContentRect.
+
2011-09-09 Pavel Podivilov <podivilov@chromium.org>
Web Inspector: implement reverse mapping for compiler source maps.
if (!view)
return 0;
- return static_cast<int>(view->height() / m_frame->pageZoomFactor());
+ return static_cast<int>(view->visibleContentRect(/* includeScrollbars */ true).height() / m_frame->pageZoomFactor());
}
int DOMWindow::innerWidth() const
if (!view)
return 0;
- return static_cast<int>(view->width() / m_frame->pageZoomFactor());
+ return static_cast<int>(view->visibleContentRect(/* includeScrollbars */ true).width() / m_frame->pageZoomFactor());
}
int DOMWindow::screenX() const
+2011-09-20 Adenilson Cavalcanti <adenilson.silva@openbossa.org>
+
+ [Qt] resizeToContent seems to trigger infinite resize on some pages
+ https://bugs.webkit.org/show_bug.cgi?id=43852
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Test by Luiz Agostini.
+
+ * tests/qgraphicswebview/tst_qgraphicswebview.cpp:
+ (ResizeSpy::receiveResize):
+ (ResizeSpy::size):
+ (tst_QGraphicsWebView::windowResizeEvent):
+
2011-09-17 Mihai Parparita <mihaip@chromium.org>
FrameLoaderClient BackForwardList-related methods are unsued
void focusInputTypes();
void crashOnSetScaleBeforeSetUrl();
void widgetsRenderingThroughCache();
+ void windowResizeEvent();
+
#if !(defined(WTF_USE_QT_MOBILE_THEME) && WTF_USE_QT_MOBILE_THEME)
void setPalette_data();
void setPalette();
}
#endif
+class ResizeSpy : public QObject {
+ Q_OBJECT
+public slots:
+ void receiveResize(int width, int height)
+ {
+ m_size = QSize(width, height);
+ emit resized();
+ }
+
+ QSize size() const
+ {
+ return m_size;
+ }
+
+signals:
+ void resized();
+
+private:
+ QSize m_size;
+};
+
+void tst_QGraphicsWebView::windowResizeEvent()
+{
+ QGraphicsWebView webView;
+ ResizeSpy resizeSpy;
+ resizeSpy.setProperty("resizeCount", 0);
+
+ QString html = "<html><body><script>"
+ "function onResize() { window.resizeSpy.receiveResize(window.innerWidth, window.innerHeight); }"
+ "window.addEventListener('resize', onResize , false);"
+ "</script></body></html>";
+
+ webView.page()->mainFrame()->setHtml(html);
+ webView.page()->mainFrame()->addToJavaScriptWindowObject("resizeSpy",
+ &resizeSpy);
+ webView.setGeometry(QRect(0, 0, 50, 50));
+ QVERIFY(::waitForSignal(&resizeSpy, SIGNAL(resized()), 1000));
+ QCOMPARE(resizeSpy.size(), QSize(50, 50));
+
+ webView.page()->setActualVisibleContentRect(QRect(10, 10, 60, 60));
+ webView.setGeometry(QRect(0, 0, 100, 100));
+ waitForSignal(&resizeSpy, SIGNAL(resized()), 1000);
+
+ // This will be triggered without the fix on DOMWindow::innerHeight/Width
+ QCOMPARE(resizeSpy.size(), QSize(60, 60));
+}
+
QTEST_MAIN(tst_QGraphicsWebView)
#include "tst_qgraphicswebview.moc"