Closed Bug 596969 Opened 12 years ago Closed 12 years ago
Viewport is resized when switching tabs
Steps to reproduce: 1. Open a page with non-default viewport width, e.g. http://touch.facebook.com 2. Switch to a different tab, then back to the first tab Expected results: Page layout remains the same Actual results: Viewport width changes This is a regression from bug 576192.
This seems to (maybe?) happen as a result of nsFrameLoader::ShowRemoteFrame calling GetSubDocumentSize and then TabParent::Move - the dimensions passed to Move do not match the explicit viewport metadata.
This might be helped by the new API proposed in bug 589337 to replace Show/Hide for switching tabs.
Depends on: 589337
We'd like to change the platform to *not* change the CSS viewport size on window/widget resize, if an override has been set using nsIDOMWindowUtils.setCSSViewport.
Assignee: mbrubeck → jones.chris.g
To be clear, the fennec frontend wants to use this feature to implement the <meta viewport> tag available to web content, in such a way that the frontend doesn't have to always listen for resizes (e.g. on device orientation change) and reset them back to the <meta viewport>. That's a bit tricky and can be expensive if we don't prevent the reflow in time.
How should we call ResizeReflowOverride from the frontend? Should nsDOMWindowUtils::SetCSSViewport call it for us (maybe optionally)?
Thanks Matt! I didn't change the nsDOMWindowUtils callsite, and my test was wrong.
This is working great, but it seems to make bug 597230 happen more often. Working on a patch in that bug.
Comment on attachment 477787 [details] [diff] [review] Allow a document's CSS viewport to be permanently overridden by chrome script, v2 sr=dbaron
Attachment #477787 - Flags: superreview?(dbaron) → superreview+
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
verified FIXED on builds: Mozilla/5.0 (Maemo; Linux armv71; rv:2.0b6pre) Gecko/20100927 Namoroka/4.0b7pre Fennec/2.0b1pre and Mozilla/5.0 (Android; Linux armv71; rv:2.0b6pre) Gecko/20100927 Namoroka/4.0b7pre Fennec/2.0b1pre
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.