Bug 82500 - Remove redundant updateViewportArguments() call when page is restored from page cache.
Summary: Remove redundant updateViewportArguments() call when page is restored from pa...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Minor
Assignee: zalan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-28 12:06 PDT by zalan
Modified: 2012-03-29 05:53 PDT (History)
2 users (show)

See Also:


Attachments
Patch (4.26 KB, patch)
2012-03-28 12:32 PDT, zalan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description zalan 2012-03-28 12:06:46 PDT
When the page is restored from the page cache, Document::updateViewportArguments() is called twice. Once when the document is set (restored) on the mainframe, and once the Page Cache signals restore complete.
Viewport arguments don't change between the 2 calls, so it's enough to update them only once.
Fix: remove updateViewportArguments() from Document::documentDidResumeFromPageCache()
Comment 1 zalan 2012-03-28 12:32:51 PDT
Created attachment 134372 [details]
Patch
Comment 2 Kenneth Rohde Christiansen 2012-03-29 04:58:22 PDT
Comment on attachment 134372 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=134372&action=review

> ManualTests/viewport-width-test-after-history-navigation.html:17
> +            originalViewportWidth = window.innerWidth;

Why not check that it is actually 700 ?

> ManualTests/viewport-width-test-after-history-navigation.html:22
> +            document.getElementById('anchor').dispatchEvent(evt);

I would add a newline after this

> Source/WebCore/dom/Document.cpp:4225
>      m_frame->loader()->client()->dispatchDidBecomeFrameset(isFrameSet());
> -
> -    updateViewportArguments();
>  }

I am not convinced... This might fit well with the width etc, but what happens if I navigate back and I am in another orientation? this would break for width = device-width. Also I am not sure we will get all the right limits to our interaction engine, such as maximum-scale etc.
Comment 3 WebKit Review Bot 2012-03-29 05:53:22 PDT
Comment on attachment 134372 [details]
Patch

Clearing flags on attachment: 134372

Committed r112526: <http://trac.webkit.org/changeset/112526>
Comment 4 WebKit Review Bot 2012-03-29 05:53:28 PDT
All reviewed patches have been landed.  Closing bug.