<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>77943</bug_id>
          
          <creation_ts>2012-02-07 01:10:43 -0800</creation_ts>
          <short_desc>REGRESSION (r106899): broke multiple tests on GTK</short_desc>
          <delta_ts>2012-02-08 14:44:19 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKitGTK</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Philippe Normand">pnormand</reporter>
          <assigned_to name="alan">zalan</assigned_to>
          <cc>kenneth</cc>
    
    <cc>wangxianzhu</cc>
    
    <cc>webkit.review.bot</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>550700</commentid>
    <comment_count>0</comment_count>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2012-02-07 01:10:43 -0800</bug_when>
    <thetext>A bunch for fast/ tests now crash:


Program terminated with signal 11, Segmentation fault.
#0  0x00002b92ff4bf983 in WebCore::Document::viewportArguments (this=0x0) at ../../Source/WebCore/dom/Document.h:326
326	    ViewportArguments viewportArguments() const { return m_viewportArguments; }

Thread 1 (Thread 0x2b930cbf1a40 (LWP 21706)):
#0  0x00002b92ff4bf983 in WebCore::Document::viewportArguments (this=0x0) at ../../Source/WebCore/dom/Document.h:326
#1  0x00002b92ff4e21a5 in webkitViewportAttributesRecompute (viewportAttributes=0x1b37700) at ../../Source/WebKit/gtk/webkit/webkitviewportattributes.cpp:535
#2  0x00002b92ff4b1122 in WebKit::ChromeClient::dispatchViewportPropertiesDidChange (this=0x2693cc0, arguments=...) at ../../Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp:838
#3  0x00002b92ffcc1236 in WebCore::Chrome::dispatchViewportPropertiesDidChange (this=0x26b94e0, arguments=...) at ../../Source/WebCore/page/Chrome.cpp:484
#4  0x00002b92ff856376 in WebCore::Document::updateViewportArguments (this=0x24b9ab0) at ../../Source/WebCore/dom/Document.cpp:2803
#5  0x00002b92ff85b032 in WebCore::Document::setInPageCache (this=0x24b9ab0, flag=false) at ../../Source/WebCore/dom/Document.cpp:4081
#6  0x00002b92ffc3327f in WebCore::FrameLoader::open (this=0x26bc2c8, cachedFrame=...) at ../../Source/WebCore/loader/FrameLoader.cpp:2034
#7  0x00002b92ff9e3ae5 in WebCore::CachedFrame::open (this=0x26ae210) at ../../Source/WebCore/history/CachedFrame.cpp:208
#8  0x00002b92ff9e5585 in WebCore::CachedPage::restore (this=0x26947b0, page=0x26ba090) at ../../Source/WebCore/history/CachedPage.cpp:79
#9  0x00002b92ffc321a7 in WebCore::FrameLoader::commitProvisionalLoad (this=0x26bc2c8) at ../../Source/WebCore/loader/FrameLoader.cpp:1782
#10 0x00002b92ffc379b2 in WebCore::FrameLoader::loadProvisionalItemFromCachedPage (this=0x26bc2c8) at ../../Source/WebCore/loader/FrameLoader.cpp:3034
#11 0x00002b92ffc36d2e in WebCore::FrameLoader::continueLoadAfterNavigationPolicy (this=0x26bc2c8, formState=..., shouldContinue=true) at ../../Source/WebCore/loader/FrameLoader.cpp:2905
#12 0x00002b92ffc364bc in WebCore::FrameLoader::callContinueLoadAfterNavigationPolicy (argument=0x26bc2c8, request=..., formState=..., shouldContinue=true) at ../../Source/WebCore/loader/FrameLoader.cpp:2782
#13 0x00002b92ffc6de73 in WebCore::PolicyChecker::checkNavigationPolicy (this=0x26bc2d8, request=..., loader=0x26c5790, formState=..., function=0x2b92ffc36466 &lt;WebCore::FrameLoader::callContinueLoadAfterNavigationPolicy(void*, WebCore::ResourceRequest const&amp;, WTF::PassRefPtr&lt;WebCore::FormState&gt;, bool)&gt;, argument=0x26bc2c8) at ../../Source/WebCore/loader/PolicyChecker.cpp:69
#14 0x00002b92ffc30311 in WebCore::FrameLoader::loadWithDocumentLoader (this=0x26bc2c8, loader=0x26c5790, type=WebCore::FrameLoadTypeIndexedBackForward, prpFormState=...) at ../../Source/WebCore/loader/FrameLoader.cpp:1385
#15 0x00002b92ffc37e09 in WebCore::FrameLoader::loadDifferentDocumentItem (this=0x26bc2c8, item=0x2663fa0, loadType=WebCore::FrameLoadTypeIndexedBackForward) at ../../Source/WebCore/loader/FrameLoader.cpp:3092
#16 0x00002b92ffc384d3 in WebCore::FrameLoader::loadItem (this=0x26bc2c8, item=0x2663fa0, loadType=WebCore::FrameLoadTypeIndexedBackForward) at ../../Source/WebCore/loader/FrameLoader.cpp:3178
#17 0x00002b92ffc46b35 in WebCore::HistoryController::recursiveGoToItem (this=0x26bc528, item=0x2663fa0, fromItem=0x24d7c30, type=WebCore::FrameLoadTypeIndexedBackForward) at ../../Source/WebCore/loader/HistoryController.cpp:729
#18 0x00002b92ffc44aba in WebCore::HistoryController::goToItem (this=0x26bc528, targetItem=0x2663fa0, type=WebCore::FrameLoadTypeIndexedBackForward) at ../../Source/WebCore/loader/HistoryController.cpp:273
#19 0x00002b92ffd29cbe in WebCore::Page::goToItem (this=0x26ba090, item=0x2663fa0, type=WebCore::FrameLoadTypeIndexedBackForward) at ../../Source/WebCore/page/Page.cpp:383
#20 0x00002b92ffd29c01 in WebCore::Page::goBackOrForward (this=0x26ba090, distance=-1) at ../../Source/WebCore/page/Page.cpp:371
#21 0x00002b92ff9de6e5 in WebCore::BackForwardController::goBackOrForward (this=0x26956c0, distance=-1) at ../../Source/WebCore/history/BackForwardController.cpp:59
#22 0x00002b92ffc73710 in WebCore::ScheduledHistoryNavigation::fire (this=0x261db90, frame=0x26bc210) at ../../Source/WebCore/loader/NavigationScheduler.cpp:205
#23 0x00002b92ffc725b9 in WebCore::NavigationScheduler::timerFired (this=0x26bc700) at ../../Source/WebCore/loader/NavigationScheduler.cpp:418
#24 0x00002b92ffc74798 in WebCore::Timer&lt;WebCore::NavigationScheduler&gt;::fired (this=0x26bc708) at ../../Source/WebCore/platform/Timer.h:100
#25 0x00002b92ffe5c8e0 in WebCore::ThreadTimers::sharedTimerFiredInternal (this=0x10bc4c0) at ../../Source/WebCore/platform/ThreadTimers.cpp:115
#26 0x00002b92ffe5c817 in WebCore::ThreadTimers::sharedTimerFired () at ../../Source/WebCore/platform/ThreadTimers.cpp:93
#27 0x00002b93007cb4e6 in WebCore::timeout_cb () at ../../Source/WebCore/platform/gtk/SharedTimerGtk.cpp:49
#28 0x00002b930457cbbb in g_timeout_dispatch () from /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Dependencies/Root/lib64/libglib-2.0.so.0
#29 0x00002b930457adf3 in g_main_dispatch () from /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Dependencies/Root/lib64/libglib-2.0.so.0
#30 0x00002b930457bab9 in g_main_context_dispatch () from /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Dependencies/Root/lib64/libglib-2.0.so.0
#31 0x00002b930457bca3 in g_main_context_iterate () from /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Dependencies/Root/lib64/libglib-2.0.so.0
#32 0x00002b930457c0d9 in g_main_loop_run () from /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Dependencies/Root/lib64/libglib-2.0.so.0
#33 0x00002b930321ce99 in gtk_main () from /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Dependencies/Root/lib64/libgtk-3.so.0
#34 0x0000000000435326 in runTest (testPathOrURL=...) at ../../Tools/DumpRenderTree/gtk/DumpRenderTree.cpp:700
#35 0x00000000004349c0 in runTestingServerLoop () at ../../Tools/DumpRenderTree/gtk/DumpRenderTree.cpp:491
#36 0x00000000004378ec in main (argc=2, argv=0x7fffbfde5608) at ../../Tools/DumpRenderTree/gtk/DumpRenderTree.cpp:1374</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>550813</commentid>
    <comment_count>1</comment_count>
    <who name="alan">zalan</who>
    <bug_when>2012-02-07 04:00:34 -0800</bug_when>
    <thetext>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-&gt;priv-&gt;corePage-&gt;mainFrame()-&gt;document()-&gt;viewportArguments();) will refer to the same document instance.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>550818</commentid>
    <comment_count>2</comment_count>
    <who name="Kenneth Rohde Christiansen">kenneth</who>
    <bug_when>2012-02-07 04:07:30 -0800</bug_when>
    <thetext>(In reply to comment #1)
&gt; 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-&gt;priv-&gt;corePage-&gt;mainFrame()-&gt;document()-&gt;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>550930</commentid>
    <comment_count>3</comment_count>
    <who name="alan">zalan</who>
    <bug_when>2012-02-07 06:23:13 -0800</bug_when>
    <thetext>&gt; 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-&gt;loader()-&gt;client()-&gt;dispatchDidBecomeFrameset(isFrameSet());
+
+    updateViewportArguments();
 }
 
 void Document::registerForPageCacheSuspensionCallbacks(Element* e)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>550952</commentid>
    <comment_count>4</comment_count>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2012-02-07 07:03:18 -0800</bug_when>
    <thetext>(In reply to comment #3)
&gt; &gt; It still would need to be done before we are starting to layout.
&gt; Agree. Layout is forced on the view, soon after the cached frame is all set with the restore. See at FrameLoader::commitProvisionalLoad().
&gt; The following change could work, where updateViewportArguments() is moved to Document::documentDidResumeFromPageCache() callback.
&gt; 

Can we give this patch a try?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>550956</commentid>
    <comment_count>5</comment_count>
    <who name="alan">zalan</who>
    <bug_when>2012-02-07 07:07:33 -0800</bug_when>
    <thetext>(In reply to comment #4)
&gt; (In reply to comment #3)
&gt; &gt; &gt; It still would need to be done before we are starting to layout.
&gt; &gt; Agree. Layout is forced on the view, soon after the cached frame is all set with the restore. See at FrameLoader::commitProvisionalLoad().
&gt; &gt; The following change could work, where updateViewportArguments() is moved to Document::documentDidResumeFromPageCache() callback.
&gt; &gt; 
&gt; 
&gt; Can we give this patch a try?

yes, please and if works i&apos;ll make it a proper patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>550973</commentid>
    <comment_count>6</comment_count>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2012-02-07 07:39:18 -0800</bug_when>
    <thetext>(In reply to comment #5)
&gt; (In reply to comment #4)
&gt; &gt; (In reply to comment #3)
&gt; &gt; &gt; &gt; It still would need to be done before we are starting to layout.
&gt; &gt; &gt; Agree. Layout is forced on the view, soon after the cached frame is all set with the restore. See at FrameLoader::commitProvisionalLoad().
&gt; &gt; &gt; The following change could work, where updateViewportArguments() is moved to Document::documentDidResumeFromPageCache() callback.
&gt; &gt; &gt; 
&gt; &gt; 
&gt; &gt; Can we give this patch a try?
&gt; 
&gt; yes, please and if works i&apos;ll make it a proper patch.

I confirm it works. Please send a proper patch :)
Thanks a bunch!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>551886</commentid>
    <comment_count>7</comment_count>
      <attachid>126026</attachid>
    <who name="alan">zalan</who>
    <bug_when>2012-02-08 01:38:29 -0800</bug_when>
    <thetext>Created attachment 126026
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>552274</commentid>
    <comment_count>8</comment_count>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2012-02-08 10:36:15 -0800</bug_when>
    <thetext>(In reply to comment #7)
&gt; Created an attachment (id=126026) [details]
&gt; Patch

Kenneth, can you please review this patch?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>552432</commentid>
    <comment_count>9</comment_count>
      <attachid>126026</attachid>
    <who name="Kenneth Rohde Christiansen">kenneth</who>
    <bug_when>2012-02-08 13:22:54 -0800</bug_when>
    <thetext>Comment on attachment 126026
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+</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>552507</commentid>
    <comment_count>10</comment_count>
      <attachid>126026</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2012-02-08 14:44:14 -0800</bug_when>
    <thetext>Comment on attachment 126026
Patch

Clearing flags on attachment: 126026

Committed r107135: &lt;http://trac.webkit.org/changeset/107135&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>552508</commentid>
    <comment_count>11</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2012-02-08 14:44:19 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>126026</attachid>
            <date>2012-02-08 01:38:29 -0800</date>
            <delta_ts>2012-02-08 14:44:14 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-77943-20120208103827.patch</filename>
            <type>text/plain</type>
            <size>1773</size>
            <attacher name="alan">zalan</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDEwNzA1MikKKysrIFNvdXJjZS9XZWJDb3JlL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDIzIEBACisyMDEyLTAyLTA4ICBaYWxhbiBC
dWp0YXMgIDx6YnVqdGFzQGdtYWlsLmNvbT4KKworICAgICAgICBEaXNwYXRjaCB1cGRhdGVWaWV3
cG9ydEFyZ3VtZW50cygpLCB3aGVuIERvY3VtZW50IGlzIGZpbmlzaGVkCisgICAgICAgIHJlc3Rv
cmluZyBmcm9tIHBhZ2UgY2FjaGUuCisKKyAgICAgICAgaHR0cHM6Ly9idWdzLndlYmtpdC5vcmcv
c2hvd19idWcuY2dpP2lkPTc3OTQzCisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BT
ISkuCisKKyAgICAgICAgTW92ZSB1cGRhdGVWaWV3cG9ydEFyZ3VtZW50cygpIGNhbGwgZnJvbSBz
ZXR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c2V0UmVuZGVyZXIobV9zYXZlZFJlbmRlcmVyKTsKICAgICAgICAgbV9zYXZl
ZFJlbmRlcmVyID0gMDsKIAotICAgICAgICB1cGRhdGVWaWV3cG9ydEFyZ3VtZW50cygpOwotCiAg
ICAgICAgIGlmIChjaGlsZE5lZWRzU3R5bGVSZWNhbGMoKSkKICAgICAgICAgICAgIHNjaGVkdWxl
U3R5bGVSZWNhbGMoKTsKICAgICB9CkBAIC00MTIwLDYgKzQxMTgsOCBAQCB2b2lkIERvY3VtZW50
Ojpkb2N1bWVudERpZFJlc3VtZUZyb21QYWdlCiAKICAgICBBU1NFUlQobV9mcmFtZSk7CiAgICAg
bV9mcmFtZS0+bG9hZGVyKCktPmNsaWVudCgpLT5kaXNwYXRjaERpZEJlY29tZUZyYW1lc2V0KGlz
RnJhbWVTZXQoKSk7CisKKyAgICB1cGRhdGVWaWV3cG9ydEFyZ3VtZW50cygpOwogfQogCiB2b2lk
IERvY3VtZW50OjpyZWdpc3RlckZvclBhZ2VDYWNoZVN1c3BlbnNpb25DYWxsYmFja3MoRWxlbWVu
dCogZSkK
</data>

          </attachment>
      

    </bug>

</bugzilla>