Closed Bug 567186 Opened 10 years ago Closed 9 years ago

When possible, set viewport size before page finishes loading

Categories

(Firefox for Android Graveyard :: Panning/Zooming, defect)

defect
Not set

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: mbrubeck, Assigned: mbrubeck)

References

Details

Attachments

(1 file)

Attached patch patchSplinter Review
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?
(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+
http://hg.mozilla.org/mobile-browser/rev/b55a406e4297
Status: ASSIGNED → RESOLVED
Closed: 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.