Bug 70459

Summary: Page Scale Factor broken when navigating history on pages with child frames
Product: WebKit Reporter: Fady Samuel <fsamuel>
Component: FramesAssignee: Fady Samuel <fsamuel>
Status: RESOLVED FIXED    
Severity: Normal CC: dglazkov, fishd, gustavo, japhet, rjkroege, webkit.review.bot, xan.lopez
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 68075, 70559    
Attachments:
Description Flags
Patch
none
Patch none

Fady Samuel
Reported 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.
Attachments
Patch (9.82 KB, patch)
2011-10-20 17:25 PDT, Fady Samuel
no flags
Patch (2.06 KB, patch)
2011-10-25 11:55 PDT, Fady Samuel
no flags
Fady Samuel
Comment 1 2011-10-20 17:25:48 PDT
Fady Samuel
Comment 2 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?
WebKit Review Bot
Comment 3 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.
WebKit Review Bot
Comment 4 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
Daniel Bates
Comment 5 2011-10-20 20:05:38 PDT
Gustavo Noronha (kov)
Comment 6 2011-10-20 20:28:09 PDT
Darin Fisher (:fishd, Google)
Comment 7 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.
Fady Samuel
Comment 8 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...
Fady Samuel
Comment 9 2011-10-25 11:55:45 PDT
Darin Fisher (:fishd, Google)
Comment 10 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.
Darin Fisher (:fishd, Google)
Comment 11 2011-10-26 01:34:47 PDT
Comment on attachment 112369 [details] Patch Is there anyway to create a layout test for this bug?
WebKit Review Bot
Comment 12 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>
WebKit Review Bot
Comment 13 2011-10-26 01:52:03 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.