<?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>84488</bug_id>
          
          <creation_ts>2012-04-20 13:43:03 -0700</creation_ts>
          <short_desc>Extra work done by PageGroupLoadDeferrer besides Page::setDefersLoading needs to be done by Page::setDefersLoading</short_desc>
          <delta_ts>2014-08-06 22:12:12 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Page Loading</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>ASSIGNED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>84490</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Brady Eidson">beidson</reporter>
          <assigned_to name="Brady Eidson">beidson</assigned_to>
          <cc>ap</cc>
    
    <cc>darin</cc>
    
    <cc>dbates</cc>
    
    <cc>jchaffraix</cc>
    
    <cc>psolanki</cc>
    
    <cc>yong.li.webkit</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>606860</commentid>
    <comment_count>0</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2012-04-20 13:43:03 -0700</bug_when>
    <thetext>Extra work done by PageGroupLoadDeferrer besides Page::setDefersLoading needs to be done by Page::setDefersLoading

At least one platform (Mac) exposes Page::setDefersLoading in their API.

PageGroupLoadDeferrer does extra work that is important for deferring loading but that extra work is skipped when APIs defer loading directly.

To further exacerbate this problem at least some sections of the code conflate &quot;page-&gt;defersLoading()&quot; with &quot;PageGroupLoadDeferrer&apos;s extra work has been done&quot;.

One example is Document::didReceiveTask.  If page-&gt;defersLoading() is true, it throws the task on a pending queue.  But that queue is only flushed when a PageGroupLoadDeferrer is destroyed, and not when the state of page-&gt;defersLoading() otherwise changes.  This was introduced in 102278 and caused a lot of bizarre little side effects.

---

One complication in this cleanup will addressing this long-time comment in PageGroupLoadDefererr:
                // NOTE: if PageGroupLoadDeferrer is ever used for tasks other than showing a modal window or sheet,
                // the constructor will need to take a ActiveDOMObject::ReasonForSuspension.

The time for addressing that is overdue!

In radar as &lt;rdar://problem/10484294&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>606914</commentid>
    <comment_count>1</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2012-04-20 14:30:15 -0700</bug_when>
    <thetext>Fixed the comment in https://bugs.webkit.org/show_bug.cgi?id=84490 and http://trac.webkit.org/changeset/114782

Now on to the real work.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>606916</commentid>
    <comment_count>2</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2012-04-20 14:33:22 -0700</bug_when>
    <thetext>Another interesting thing about this work was that the extra PageGroupLoadDeferrer work didn&apos;t respect m_settings-&gt;loadDeferringEnabled() on a page-by-page basis.  It should have.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>606929</commentid>
    <comment_count>3</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2012-04-20 14:50:27 -0700</bug_when>
    <thetext>As I started working on a patch, it became apparent that:

&gt;To further exacerbate this problem at least some sections of the code conflate &quot;page-&gt;defersLoading()&quot; with &quot;PageGroupLoadDeferrer&apos;s extra work has been done&quot;.

Is actually the key problem behind &lt;rdar://problem/10484294&gt;.

While this bug is still very real and should remain open, a larger overhaul might not be necessary right now...  back with more soon.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>606933</commentid>
    <comment_count>4</comment_count>
    <who name="Yong Li">yong.li.webkit</who>
    <bug_when>2012-04-20 14:52:39 -0700</bug_when>
    <thetext>Do you know why Page::setDefersLoading() is used instead of PageGroupLoadDeferrer? Everyone should use PageGroupLoadDeferrer from my point of view, because the order of destructing them is critical.

Be careful with script debugger. They are doing partial defer work, too.

void PageScriptDebugServer::setJavaScriptPaused(Frame* frame, bool paused)
{
    ASSERT_ARG(frame, frame);

    if (!frame-&gt;script()-&gt;canExecuteScripts(NotAboutToExecuteScript))
        return;

    frame-&gt;script()-&gt;setPaused(paused);

    Document* document = frame-&gt;document();
    if (paused) {
        document-&gt;suspendScriptedAnimationControllerCallbacks();
        document-&gt;suspendActiveDOMObjects(ActiveDOMObject::JavaScriptDebuggerPaused);
    } else {
        document-&gt;resumeActiveDOMObjects();
        document-&gt;resumeScriptedAnimationControllerCallbacks();
    }

    setJavaScriptPaused(frame-&gt;view(), paused);
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>606941</commentid>
    <comment_count>5</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2012-04-20 14:59:38 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; As I started working on a patch, it became apparent that:
&gt; 
&gt; &gt;To further exacerbate this problem at least some sections of the code conflate &quot;page-&gt;defersLoading()&quot; with &quot;PageGroupLoadDeferrer&apos;s extra work has been done&quot;.
&gt; 
&gt; Is actually the key problem behind &lt;rdar://problem/10484294&gt;.

It&apos;s the first half of the problem.  The second half of the problem is that when Page::setDefersLoading(false) is called no one tells the Document to resume performing its callbacks.

I think the &quot;extra&quot; code really does need to be moved into the active part of Page::setDefersLoading()</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>606944</commentid>
    <comment_count>6</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2012-04-20 15:03:59 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; Do you know why Page::setDefersLoading() is used instead of PageGroupLoadDeferrer? Everyone should use PageGroupLoadDeferrer from my point of view, because the order of destructing them is critical.

Yes...  because it is Mac API that has existed since the beginning of the WebKit project, and Cocoa clients use it.

PageGroupLoadDeferrer was added much later as a &quot;temporary load deferring locker&quot; meant to have stack lifetime.  But by the time it was added Cocoa clients had already established a precedent of deferring/undeferring on their own terms.

The moment PageGroupLoadDeferrer did any additional work besides calling Page::setDefersLoading(), that was a bug introduced to Cocoa clients.

Such are the concerns of maintaining a widely used API...

&gt; Be careful with script debugger. They are doing partial defer work, too.
&gt; 
&gt; void PageScriptDebugServer::setJavaScriptPaused(Frame* frame, bool paused)
&gt; {
&gt;     ASSERT_ARG(frame, frame);
&gt; 
&gt;     if (!frame-&gt;script()-&gt;canExecuteScripts(NotAboutToExecuteScript))
&gt;         return;
&gt; 
&gt;     frame-&gt;script()-&gt;setPaused(paused);
&gt; 
&gt;     Document* document = frame-&gt;document();
&gt;     if (paused) {
&gt;         document-&gt;suspendScriptedAnimationControllerCallbacks();
&gt;         document-&gt;suspendActiveDOMObjects(ActiveDOMObject::JavaScriptDebuggerPaused);
&gt;     } else {
&gt;         document-&gt;resumeActiveDOMObjects();
&gt;         document-&gt;resumeScriptedAnimationControllerCallbacks();
&gt;     }
&gt; 
&gt;     setJavaScriptPaused(frame-&gt;view(), paused);
&gt; }

This is not a concern as these are all mechanisms separate from load deferring, and are not exposed as API.

The crux of the problem was introducing two different load deferring behaviors.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>606955</commentid>
    <comment_count>7</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2012-04-20 15:21:20 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; (In reply to comment #4)
&gt; &gt; Do you know why Page::setDefersLoading() is used instead of PageGroupLoadDeferrer? Everyone should use PageGroupLoadDeferrer from my point of view, because the order of destructing them is critical.
&gt; 
&gt; Yes...  because it is Mac API that has existed since the beginning of the WebKit project, and Cocoa clients use it.

And another key reason is that they defer loads on a per-Page basis instead of a per-PageGroup basis.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>606960</commentid>
    <comment_count>8</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2012-04-20 15:24:19 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; (In reply to comment #4)
&gt; &gt; Do you know why Page::setDefersLoading() is used instead of PageGroupLoadDeferrer? Everyone should use PageGroupLoadDeferrer from my point of view, because the order of destructing them is critical.

On a per-page basis, it shouldn&apos;t be difficult to preserve the order of operations that PageGroupLoadDeferrer currently enforces.

But if your assertion is that it is important that all of the document scheduled task suspension must take place before all of the actual calls to setDefersLoading...  I would have to ask for clarification as to why.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>607022</commentid>
    <comment_count>9</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2012-04-20 16:29:48 -0700</bug_when>
    <thetext>All of these different ActiveDOMObject::ReasonForSuspension cases are amusing.  If you grep the project you find that precisely *ONE* ActiveDOMObject (HTMLMediaElement) behaves differently based on only *one* of the flags.

In other words, WillShowDialog carries absolutely zero special significance and can be renamed to &quot;WillDeferLoading&quot; then used generically in all load deferring code paths.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>607028</commentid>
    <comment_count>10</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2012-04-20 16:31:54 -0700</bug_when>
    <thetext>Which means that much of https://bugs.webkit.org/show_bug.cgi?id=84490 and http://trac.webkit.org/changeset/114782 were unnecessary (though the Document parts still were)

But as a logical step forward it was still a good exploration.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>607077</commentid>
    <comment_count>11</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2012-04-20 17:08:10 -0700</bug_when>
    <thetext>Renamed WillShowDialog to WillDeferLoading in http://trac.webkit.org/changeset/114802</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>607099</commentid>
    <comment_count>12</comment_count>
      <attachid>138207</attachid>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2012-04-20 17:48:05 -0700</bug_when>
    <thetext>Created attachment 138207
Patch v1 - Fold the extra work in to the common method</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>607103</commentid>
    <comment_count>13</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2012-04-20 17:49:07 -0700</bug_when>
    <thetext>(In reply to comment #12)
&gt; Created an attachment (id=138207) [details]
&gt; Patch v1 - Fold the extra work in to the common method

Realistically I&apos;d be surprised if this changed behavior for WebCore or any other WebKit clients that haven&apos;t exposed setDefersLoading directly.

But Yong had some concerns, so here is my proposed patch for him to look at.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>607698</commentid>
    <comment_count>14</comment_count>
    <who name="Yong Li">yong.li.webkit</who>
    <bug_when>2012-04-23 08:18:30 -0700</bug_when>
    <thetext>Brady, I tried doing the similar change before. But it caused assert failures because of conflicts with other calls to page-&gt;setDefersLoading().

If the API must call setDefersLoading() by themselves, we probably should make m_defersLoading a counter. Otherwise, the following senario could happen:

Executing JS
...
To show a modal dialog
setDefersLoading(true) (by PageGroupLoadDeferrer)
...
setDefersLoading(true) (by API)
...
setDefersLoading(false) (by API)
...
(!!!tasks are assumed here!!!)
...
Executing JS when showing modal dialog. Re-entrancy
...
setDefersLoading(false) (by PageGroupLoadDeferrer)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>607746</commentid>
    <comment_count>15</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2012-04-23 09:20:48 -0700</bug_when>
    <thetext>(In reply to comment #14)
&gt; 
&gt; If the API must call setDefersLoading() by themselves,

They already do.  We must continue supporting it.

And there&apos;s already real world breakage with a long standing Apple internal project, and fixing that is my primary task right now.

&gt; Brady, I tried doing the similar change before. But it caused assert failures because of conflicts with other calls to page-&gt;setDefersLoading().

Can you provide a concrete example of where this happened, and what the backtraces were?

&gt; we probably should make m_defersLoading a counter. Otherwise, the following senario could happen:
&gt; 
&gt; Executing JS
&gt; ...
&gt; To show a modal dialog
&gt; setDefersLoading(true) (by PageGroupLoadDeferrer)
&gt; ...
&gt; setDefersLoading(true) (by API)
&gt; ...
&gt; setDefersLoading(false) (by API)
&gt; ...
&gt; (!!!tasks are assumed here!!!)
&gt; ...
&gt; Executing JS when showing modal dialog. Re-entrancy
&gt; ...
&gt; setDefersLoading(false) (by PageGroupLoadDeferrer)

I agree it should be a counter...

In addition to the theoretical bug of Mac WebKit API users of setDefersLoading() interacting poorly with PageGroupLoadDeferrers, there&apos;s already an obviously real bug in WebKit/chromium in that they use a stack of PageGroupLoadDeferrers for entering/exiting modal loops.

I do not think the stack behaves the way they think it behaves...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>607751</commentid>
    <comment_count>16</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2012-04-23 09:24:43 -0700</bug_when>
    <thetext>Just as a heads up: The current state of things is very broken and sorting it out is very high priority for us.

I fully respect that you&apos;ve done the most recent work in this area and hope to keep getting your feedback, but I have to be moving forward quickly on this and code changes will need to be happening very soon.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>607793</commentid>
    <comment_count>17</comment_count>
      <attachid>138207</attachid>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2012-04-23 10:21:54 -0700</bug_when>
    <thetext>Comment on attachment 138207
Patch v1 - Fold the extra work in to the common method

Running layout tests shows inspector failures related to load deferring.  Now that I have firms examples of the asserts Yong alluded too, I&apos;ll work on other approaches.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>608057</commentid>
    <comment_count>18</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2012-04-23 15:11:45 -0700</bug_when>
    <thetext>We may need to roll out r102278 if we aren’t able to resolve this soon.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>608114</commentid>
    <comment_count>19</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2012-04-23 15:45:16 -0700</bug_when>
    <thetext>(In reply to comment #18)
&gt; We may need to roll out r102278 if we aren’t able to resolve this soon.

I found another way to resolve the radar &lt;rdar://problem/10484294&gt; that makes figuring this out in WebKit less pressing.  But this bug should remain open to track the work that still needs to be done for future sanities sake.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1027417</commentid>
    <comment_count>20</comment_count>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2014-08-06 22:12:12 -0700</bug_when>
    <thetext>(In reply to comment #0)
&gt; One example is Document::didReceiveTask.  If page-&gt;defersLoading() is true, it throws the task on a pending queue.  But that queue is only flushed when a PageGroupLoadDeferrer is destroyed, and not when the state of page-&gt;defersLoading() otherwise changes.  This was introduced in 102278 and caused a lot of bizarre little side effects.

I broke out a fix for this issue into bug #135688 from the larger refactoring effort proposed by this bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>138207</attachid>
            <date>2012-04-20 17:48:05 -0700</date>
            <delta_ts>2012-04-23 10:21:54 -0700</delta_ts>
            <desc>Patch v1 - Fold the extra work in to the common method</desc>
            <filename>patch.txt</filename>
            <type>text/plain</type>
            <size>4935</size>
            <attacher name="Brady Eidson">beidson</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZyBiL1NvdXJjZS9XZWJDb3JlL0No
YW5nZUxvZwppbmRleCBmYWEwY2UzLi5hZTg5OGMxIDEwMDY0NAotLS0gYS9Tb3VyY2UvV2ViQ29y
ZS9DaGFuZ2VMb2cKKysrIGIvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCkBAIC0xLDUgKzEsMzIg
QEAKIDIwMTItMDQtMjAgIEJyYWR5IEVpZHNvbiAgPGJlaWRzb25AYXBwbGUuY29tPgogCisgICAg
ICAgIDxyZGFyOi8vcHJvYmxlbS8xMDQ4NDI5ND4gYW5kIGh0dHBzOi8vYnVncy53ZWJraXQub3Jn
L3Nob3dfYnVnLmNnaT9pZD04NDQ4OAorICAgICAgICBFeHRyYSB3b3JrIGRvbmUgYnkgUGFnZUdy
b3VwTG9hZERlZ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QgY291bnQgPSBtX2RlZmVycmVkRnJhbWVzLnNpemUo
KTsKQEAgLTYxLDEyICs1Myw4IEBAIFBhZ2VHcm91cExvYWREZWZlcnJlcjo6UGFnZUdyb3VwTG9h
ZERlZmVycmVyKFBhZ2UqIHBhZ2UsIGJvb2wgZGVmZXJTZWxmKQogUGFnZUdyb3VwTG9hZERlZmVy
cmVyOjp+UGFnZUdyb3VwTG9hZERlZmVycmVyKCkKIHsKICAgICBmb3IgKHNpemVfdCBpID0gMDsg
aSA8IG1fZGVmZXJyZWRGcmFtZXMuc2l6ZSgpOyArK2kpIHsKLSAgICAgICAgaWYgKFBhZ2UqIHBh
Z2UgPSBtX2RlZmVycmVkRnJhbWVzW2ldLT5wYWdlKCkpIHsKKyAgICAgICAgaWYgKFBhZ2UqIHBh
Z2UgPSBtX2RlZmVycmVkRnJhbWVzW2ldLT5wYWdlKCkpCiAgICAgICAgICAgICBwYWdlLT5zZXRE
ZWZlcnNMb2FkaW5nKGZhbHNlKTsKLQotICAgICAgICAgICAgZm9yIChGcmFtZSogZnJhbWUgPSBw
YWdlLT5tYWluRnJhbWUoKTsgZnJhbWU7IGZyYW1lID0gZnJhbWUtPnRyZWUoKS0+dHJhdmVyc2VO
ZXh0KCkpCi0gICAgICAgICAgICAgICAgZnJhbWUtPmRvY3VtZW50KCktPnJlc3VtZVNjaGVkdWxl
ZFRhc2tzKCk7Ci0gICAgICAgIH0KICAgICB9CiB9CiAK
</data>
<flag name="review"
          id="143504"
          type_id="1"
          status="-"
          setter="beidson"
    />
          </attachment>
      

    </bug>

</bugzilla>