| Summary: | View scale changes are temporarily lost after restoring a page from the page cache | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Tim Horton <thorton> | ||||
| Component: | WebKit2 | Assignee: | Tim Horton <thorton> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | beidson, commit-queue, japhet, mitz, sam, simon.fraser | ||||
| Priority: | P2 | ||||||
| Version: | 528+ (Nightly build) | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Attachments: |
|
||||||
|
Description
Tim Horton
2015-05-12 15:57:28 PDT
There's a second hilarity here where, once we fix HistoryController to apply the new viewScale when restoring the pageScale, since the Page's m_pageScaleFactor is already updated to the new value, setPageScaleFactor() will bail and fail to update the scale on the tile container layer. This never mattered before because the scale that HistoryController handed to setPageScaleFactor() was always the same as the scale already applied to the layer that is coming back from the PageCache (which is no longer true). I've worked around this by notifying the frames of a pageScaleFactor change if either of the scales is now different from what was stored in the history item -- I'm not sure this is the best fix. Alternatively, we could make setPageScaleFactor take a "no really, I mean it" parameter... ... or, check with the compositor's notion of the current page scale factor and avoid bailing if it doesn't match m_pageScaleFactor. Or something. Created attachment 253027 [details]
Patch
(In reply to comment #1) > I've worked around this by notifying the frames of a pageScaleFactor change > if either of the scales is now different from what was stored in the history > item -- I'm not sure this is the best fix. It turns out there was already a mechanism to do this that I just made use of for this patch (after reinventing it :D). Comment on attachment 253027 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=253027&action=review > Source/WebCore/page/Page.cpp:839 > + m_viewScaleFactor = scale; > + PageCache::singleton().markPagesForDeviceOrPageScaleChanged(*this); > + PageCache::singleton().markPagesForFullStyleRecalc(*this); Should this early-return if the scale hasn't changed? Comment on attachment 253027 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=253027&action=review > Source/WebKit2/WebProcess/WebPage/WebPage.cpp:1451 > } What does this function exactly do? Does it scale the view scale factor: new_scale_factor = current_scale_factor * scale? Or does it set the view scale factor: new_scale_factor = scale? I think it is the later and I think this function should be renamed setViewScaleFactor()? Comment on attachment 253027 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=253027&action=review >> Source/WebCore/page/Page.cpp:839 >> + PageCache::singleton().markPagesForFullStyleRecalc(*this); > > Should this early-return if the scale hasn't changed? Probably! The WebKit2 one should too, probably. >> Source/WebKit2/WebProcess/WebPage/WebPage.cpp:1451 >> } > > What does this function exactly do? Does it scale the view scale factor: new_scale_factor = current_scale_factor * scale? Or does it set the view scale factor: new_scale_factor = scale? I think it is the later and I think this function should be renamed setViewScaleFactor()? You're talking about scaleView()? The naming of scaleView matches the longstanding scalePage() message name, which does the same thing. Not sure why, but I'm not going to change it now. |