Bug 42754 - When tiled backing store is used wrong innerWidth(Height) reported by JavaScript
Summary: When tiled backing store is used wrong innerWidth(Height) reported by JavaScript
Status: RESOLVED DUPLICATE of bug 43852
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-21 07:32 PDT by Misha
Modified: 2011-02-06 14:46 PST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Misha 2010-07-21 07:32:08 PDT
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.
Comment 1 Viatcheslav Ostapenko 2011-02-06 14:46:47 PST
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 ***