Summary: | REGRESSION (r106899): broke multiple tests on GTK | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Philippe Normand <pnormand> | ||||
Component: | WebKitGTK | Assignee: | zalan <zalan> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | kenneth, wangxianzhu, webkit.review.bot, zalan | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Philippe Normand
2012-02-07 01:10:43 PST
We might need to move updateViewportArguments() call from setInPageCache() to some other function. When setInPageCache(false) is called, both the document and the view are still detached from the mainframe. Update should probably be dispatched, when the page has finished being restored and not while it is in transition. It would ensure, that calls like gtk has (webView->priv->corePage->mainFrame()->document()->viewportArguments();) will refer to the same document instance. (In reply to comment #1) > We might need to move updateViewportArguments() call from setInPageCache() to some other function. When setInPageCache(false) is called, both the document and the view are still detached from the mainframe. Update should probably be dispatched, when the page has finished being restored and not while it is in transition. It would ensure, that calls like gtk has (webView->priv->corePage->mainFrame()->document()->viewportArguments();) will refer to the same document instance. It still would need to be done before we are starting to layout. #4 0x00002b92ff856376 in WebCore::Document::updateViewportArguments (this=0x24b9ab0) at ../../Source/WebCore/dom/Document.cpp:2803 If this is the new document, it might be possible to pass it to dispatchViewportPropertiesDidChange but that of course requires that it has up to date viewport info. > It still would need to be done before we are starting to layout.
Agree. Layout is forced on the view, soon after the cached frame is all set with the restore. See at FrameLoader::commitProvisionalLoad().
The following change could work, where updateViewportArguments() is moved to Document::documentDidResumeFromPageCache() callback.
Index: Source/WebCore/dom/Document.cpp
===================================================================
--- Source/WebCore/dom/Document.cpp (revision 106913)
+++ Source/WebCore/dom/Document.cpp (working copy)
@@ -4078,8 +4078,6 @@
setRenderer(m_savedRenderer);
m_savedRenderer = 0;
- updateViewportArguments();
-
if (childNeedsStyleRecalc())
scheduleStyleRecalc();
}
@@ -4120,6 +4118,8 @@
ASSERT(m_frame);
m_frame->loader()->client()->dispatchDidBecomeFrameset(isFrameSet());
+
+ updateViewportArguments();
}
void Document::registerForPageCacheSuspensionCallbacks(Element* e)
(In reply to comment #3) > > It still would need to be done before we are starting to layout. > Agree. Layout is forced on the view, soon after the cached frame is all set with the restore. See at FrameLoader::commitProvisionalLoad(). > The following change could work, where updateViewportArguments() is moved to Document::documentDidResumeFromPageCache() callback. > Can we give this patch a try? (In reply to comment #4) > (In reply to comment #3) > > > It still would need to be done before we are starting to layout. > > Agree. Layout is forced on the view, soon after the cached frame is all set with the restore. See at FrameLoader::commitProvisionalLoad(). > > The following change could work, where updateViewportArguments() is moved to Document::documentDidResumeFromPageCache() callback. > > > > Can we give this patch a try? yes, please and if works i'll make it a proper patch. (In reply to comment #5) > (In reply to comment #4) > > (In reply to comment #3) > > > > It still would need to be done before we are starting to layout. > > > Agree. Layout is forced on the view, soon after the cached frame is all set with the restore. See at FrameLoader::commitProvisionalLoad(). > > > The following change could work, where updateViewportArguments() is moved to Document::documentDidResumeFromPageCache() callback. > > > > > > > Can we give this patch a try? > > yes, please and if works i'll make it a proper patch. I confirm it works. Please send a proper patch :) Thanks a bunch! Created attachment 126026 [details]
Patch
(In reply to comment #7) > Created an attachment (id=126026) [details] > Patch Kenneth, can you please review this patch? Comment on attachment 126026 [details]
Patch
I would love a test for this :-) To make sure that the viewport arguments are emitted when resuming from the page cache. Zalan can you make such a test? I will r=me this for now as it breaks GTK+
Comment on attachment 126026 [details] Patch Clearing flags on attachment: 126026 Committed r107135: <http://trac.webkit.org/changeset/107135> All reviewed patches have been landed. Closing bug. |