When possible, set viewport size before page finishes loading

VERIFIED FIXED

Status

VERIFIED FIXED
9 years ago
9 years ago

People

(Reporter: mbrubeck, Assigned: mbrubeck)

Tracking

Details

Attachments

(1 attachment)

(Assignee)

Description

9 years ago
Created attachment 446547 [details] [diff] [review]
patch

Most pages in Fennec start loading at one size, and then are resized based on the viewport settings after they finish loading.  This is visible to the user.

This patch uses a new event DOMMetaAdded event to update the viewport settings as early as possible.  This eliminates most of the cases where the page resizes after loading.  (It still happens on sites with mobile doctypes rather than meta tags, like http://m.facebook.com/ .)

This depends on the platform patch in bug 567183.  All viewport test cases still pass with these patches applied.
Attachment #446547 - Flags: review?(mark.finkle)
Comment on attachment 446547 [details] [diff] [review]
patch

>diff -r cb2ce50de901 chrome/content/browser.js

>+
>+    this._browserViewportState.metaData = null;
>+    this.updateViewportSize();

Why do you call this.updateViewportSize after you reset the metaData? In updateViewportSize you'll hit the empty object for metaData, right?
(Assignee)

Comment 2

9 years ago
(In reply to comment #1)
> Why do you call this.updateViewportSize after you reset the metaData? In
> updateViewportSize you'll hit the empty object for metaData, right?

This resets the default viewport settings, so if the new page does not set use <meta name="viewport"> it will start rendering at the default settings, instead of the previous page's settings.
Attachment #446547 - Flags: review?(mark.finkle) → review+
(Assignee)

Comment 3

9 years ago
http://hg.mozilla.org/mobile-browser/rev/b55a406e4297
Status: ASSIGNED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
verified FIXED on build:

Mozilla/5.0 (X11; U; Linux armv71; Nokia N900; en-US; rv:1.9.3a6pre) Gecko/2010614 Namoroka/3.7a6pre Fennec/2.0a1pre
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.