In order to benefit from tiled backing store resizeToContents property is set to true (http://codeposts.blogspot.com/2010/06/qtwebkit-goes-mobile.html). This will make page viewport size (WebCore::FrameView::frameRect() ) the same as contents size. When JavaScript calls document.window.innerWidth(Height) Webkit returns size of WebCore::FrameView::frameRect() and as result wrong size is returned. Besides that page elements which sizes set relative to viewport (window) size are getting scaled (usually stretched out). Should we store __actual__ viewport size and when resizeToContents property is set return this size to JS rather than WebCore::FrameView::frameRect()? I also noticed that in ChromeClientQt::invalidateContentsAndWindow() we are trying to find intersection between updated tiles area and viewport. Updated tiles are passed to the function as windowRect parameter and this rectangle is in document coordinates. Then we have the following line: rect = rect.intersected(QRect(QPoint(0, 0), m_webPage->viewportSize())); Here rectangle that we are passing to intersected() is NOT in document coordinates which looks wrong to me. If viewport is not set to content size it may cause page will not be updated properly.
All resize to contents issues are handled by https://bugs.webkit.org/show_bug.cgi?id=43852 *** This bug has been marked as a duplicate of bug 43852 ***