Bug 70459 - Page Scale Factor broken when navigating history on pages with child frames
Summary: Page Scale Factor broken when navigating history on pages with child frames
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Frames (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Fady Samuel
URL:
Keywords:
Depends on:
Blocks: 68075 70559
  Show dependency treegraph
 
Reported: 2011-10-19 17:11 PDT by Fady Samuel
Modified: 2011-10-26 01:52 PDT (History)
7 users (show)

See Also:


Attachments
Patch (9.82 KB, patch)
2011-10-20 17:25 PDT, Fady Samuel
no flags Details | Formatted Diff | Diff
Patch (2.06 KB, patch)
2011-10-25 11:55 PDT, Fady Samuel
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fady Samuel 2011-10-19 17:11:11 PDT
This broke with the change to Frame::frameScaleFactor here:

https://bugs.webkit.org/show_bug.cgi?id=68081

The fix involves some changes to HistoryController.cpp, and HistoryItem.h/cpp.

I will upload a patch tomorrow.
Comment 1 Fady Samuel 2011-10-20 17:25:48 PDT
Created attachment 111879 [details]
Patch
Comment 2 Fady Samuel 2011-10-20 17:26:28 PDT
With frameScaleFactor now always returning 1.0 for subframes and pageScaleFactor for the mainFrame, and there being only a single pageScaleFactor, history for scaling is broken. 

Scaling history is saved on a per frame basis but restored, overriding the per-page pageScaleFactor multiple times. As a result, sometimes pages that should be scaled end up getting a scale factor of 1.0. 

The easy solution is only restore pageScaleFactor for the main frame, but I'm not satisfied with this solution. We need to change the names of methods in HistoryItem to correspond to the reality that these are frameScaleFactors and not pageScaleFactors. But given that all frames except the main frame have a scale factor of 1.0, does it even make sense to store this information?

Is there a global level History object where I should be storing pageScaleFactor?
Comment 3 WebKit Review Bot 2011-10-20 17:27:41 PDT
Please wait for approval from fishd@chromium.org before submitting because this patch contains changes to the Chromium public API.
Comment 4 WebKit Review Bot 2011-10-20 17:43:11 PDT
Comment on attachment 111879 [details]
Patch

Attachment 111879 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/10180704
Comment 5 Daniel Bates 2011-10-20 20:05:38 PDT
Comment on attachment 111879 [details]
Patch

Attachment 111879 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/10182675
Comment 6 Gustavo Noronha (kov) 2011-10-20 20:28:09 PDT
Comment on attachment 111879 [details]
Patch

Attachment 111879 [details] did not pass gtk-ews (gtk):
Output: http://queues.webkit.org/results/10183738
Comment 7 Darin Fisher (:fishd, Google) 2011-10-20 21:50:56 PDT
I think it is better to continue referring to this as page scale factor since that's what it is.  That it is stored on HistoryItem doesn't change the fact that it still acts like a page scale factor.  I think I'd just add a comment to HistoryItem indicating that the page scale factor field is ignored for subframes.
Comment 8 Fady Samuel 2011-10-21 08:17:26 PDT
(In reply to comment #7)
> I think it is better to continue referring to this as page scale factor since that's what it is.  That it is stored on HistoryItem doesn't change the fact that it still acts like a page scale factor.  I think I'd just add a comment to HistoryItem indicating that the page scale factor field is ignored for subframes.

(In reply to comment #7)
> I think it is better to continue referring to this as page scale factor since that's what it is.  That it is stored on HistoryItem doesn't change the fact that it still acts like a page scale factor.  I think I'd just add a comment to HistoryItem indicating that the page scale factor field is ignored for subframes.

That's a fair short term solution. Ideally, I'd like to store the pageScaleFactor once per page. Simon Fraser told me to take a look at CachedPage to see if pageScaleFactor might belong there. I haven't looked at it yet, but I intend to investigate where would be a better place to store cached pages' pageScaleFactors...

Maybe that clean up effort should be logged as a separate bug...
Comment 9 Fady Samuel 2011-10-25 11:55:45 PDT
Created attachment 112369 [details]
Patch
Comment 10 Darin Fisher (:fishd, Google) 2011-10-26 01:33:14 PDT
(In reply to comment #8)
> That's a fair short term solution. Ideally, I'd like to store the pageScaleFactor once per page. Simon Fraser told me to take a look at CachedPage to see if pageScaleFactor might belong there. I haven't looked at it yet, but I intend to investigate where would be a better place to store cached pages' pageScaleFactors...
> 
> Maybe that clean up effort should be logged as a separate bug...

I'm confused by the CachedPage suggestion.  (Chrome does not use CachedPage.)  That is part of the back/forward caching feature, but even for ports that do enable the back/forward cache, there is not always a cached page.  This is very different from session history (HistoryItem), which contains information required to re-create the page by loading the URL of the page, restoring form fields and adjusting scroll offsets.
Comment 11 Darin Fisher (:fishd, Google) 2011-10-26 01:34:47 PDT
Comment on attachment 112369 [details]
Patch

Is there anyway to create a layout test for this bug?
Comment 12 WebKit Review Bot 2011-10-26 01:51:57 PDT
Comment on attachment 112369 [details]
Patch

Clearing flags on attachment: 112369

Committed r98453: <http://trac.webkit.org/changeset/98453>
Comment 13 WebKit Review Bot 2011-10-26 01:52:03 PDT
All reviewed patches have been landed.  Closing bug.