<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[205602] releases/WebKitGTK/webkit-2.14/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/205602">205602</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2016-09-08 00:58:55 -0700 (Thu, 08 Sep 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/205218">r205218</a> - Make PendingScript as ref-counted
https://bugs.webkit.org/show_bug.cgi?id=161350

Reviewed by Ryosuke Niwa.

Currently, while PendingScript is copyable, PendingScript is also CachedResourceClient.
So when copying this, the client registration is done in PendingScript's operator= etc.
However, this copying functionality is not effectively used.
In this patch, we change this PendingScript to ref-counted class and make it noncopyable.
This change makes things simple (dropping this copying functionality), and drops unnecessary
addClient / removeClient calls. And we also simplify PendingScript class. Since we can offer
all the members at the construction time, we do not need any setters like setCachedScript,
setElement etc. This prevents us from accidentally generating the half-baked pending script.

Furthermore, by changing PendingScript noncopyable &amp; ref-counted, we easily make it
observable. In this patch, we add PendingScriptClient to receive the notification from
PendingScript. Previously, we directly used CachedScript in PendingScript to receive the
notification. When introducing ScriptModuleGraph and making this PendingScript the container
of the both CachedScript and ScriptModuleGraph, hiding the raw CachedScript operations is
useful.

No behavior changes.

* WebCore.xcodeproj/project.pbxproj:
* dom/PendingScript.cpp:
(WebCore::PendingScript::create): These factory functions take all the information needed
to construct the PendingScript. So the setters of PendingScript are dropped. This is better
since we now do not expose any half-baked pending script accidentally.
(WebCore::PendingScript::PendingScript):
(WebCore::PendingScript::~PendingScript):
(WebCore::PendingScript::notifyClientFinished):
(WebCore::PendingScript::notifyFinished):
(WebCore::PendingScript::isLoaded): When introducing ScriptModuleGraph, this will query to
either CachedScript or ScriptModuleGraph. PendingScript will become the container for the
both types.
(WebCore::PendingScript::setClient):
(WebCore::PendingScript::clearClient): PendingScript is now observable by PendingScriptClient.
This avoids touching CachedScript in PendingScript directly. That is good when we introduce
ScriptModuleGraph and make PendingScript the container of the both CachedScript and ScriptModuleGraph.
(WebCore::PendingScript::releaseElementAndClear): Deleted. Previously, PendingScript is not ref-counted.
So when we would like to say &quot;this pending script is empty&quot;, we used the pending script with
`m_element = nullptr`. This releaseElementAndClear cleared this m_element and made the pending
script empty. Now, we use RefPtr&lt;PendingScript&gt; and empty one is just represented by the nullptr.
This function is no longer necessary. Dropped.
(WebCore::PendingScript::setCachedScript): Deleted. The fields are set in the constructor.
So this setter is no longer necessary. Dropped.
* dom/PendingScript.h:
* dom/PendingScriptClient.h: Copied from Source/WebCore/html/parser/HTMLScriptRunnerHost.h.
(WebCore::PendingScriptClient::~PendingScriptClient):
* dom/ScriptRunner.cpp:
(WebCore::ScriptRunner::queueScriptForExecution):
(WebCore::ScriptRunner::notifyScriptReady):
(WebCore::ScriptRunner::timerFired): We use `std::exchange` to retrieve the RefPtr&lt;PendingScript&gt;
and make the original vector element nullptr. Without this, all the PendingScript is held until
the iteration finishes. We keep the original semantics here that the pending script can be
released per iteration.
* dom/ScriptRunner.h:
* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::watchForLoad):
(WebCore::HTMLDocumentParser::stopWatchingForLoad): Use PendingScript instead of touching
CachedScript directly.
(WebCore::HTMLDocumentParser::notifyFinished):
* html/parser/HTMLDocumentParser.h:
* html/parser/HTMLScriptRunner.cpp:
(WebCore::HTMLScriptRunner::~HTMLScriptRunner):
(WebCore::HTMLScriptRunner::sourceFromPendingScript):
(WebCore::HTMLScriptRunner::isPendingScriptReady):
(WebCore::HTMLScriptRunner::executeParsingBlockingScript):
(WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent): As the previous comment describes,
we used releaseElementAndClear to make the current pending script empty. Instead of doing so, we now
explicitly clear executeParsingBlockingScript (by assigning nullptr to m_parserBlockingScript).
(WebCore::HTMLScriptRunner::watchForLoad):
(WebCore::HTMLScriptRunner::stopWatchingForLoad): Previously, we used CachedScript::addClient directly
in the m_host.watchForLoad. This means that we did not have a quick way to query whether the pending
script is watched. In the old implementation, we have the `m_watchingForLoad : bool` flag in PendingScript
to hold the watching status for the given pending script. This `pendingScript.setWatchingForLoad(true)`
just made this flag `true`. But now, we do not use CachedScript::addClient directly. Instead, we have
the PendingScriptClient and PendingScript::{setClient,clearClient}. We can know whether this pending
script is watched by checking `m_client != nullptr`. This makes `m_watchingForLoad` unnecessary.
So this patch drops `m_watchingForLoad` and `pendingScript.setWatchingForLoad(true)` call.
(WebCore::HTMLScriptRunner::hasParserBlockingScript):
(WebCore::HTMLScriptRunner::executeParsingBlockingScripts): We clear the m_parserBlockingScript here
instead of the middle of the executePendingScriptAndDispatchEvent.
(WebCore::HTMLScriptRunner::executeScriptsWaitingForLoad):
(WebCore::HTMLScriptRunner::executeScriptsWaitingForParsing):
(WebCore::requestPendingScript):
(WebCore::HTMLScriptRunner::requestParsingBlockingScript): Setting m_parsingBlockingScript is now done
in this caller side.
(WebCore::HTMLScriptRunner::requestDeferredScript):
(WebCore::HTMLScriptRunner::runScript):
(WebCore::HTMLScriptRunner::requestPendingScript): Instead of configuring the passed PendingScript&amp;,
we return the pending script and the caller sets it to m_parserBlockingScript or holds it. And we now
change this function to static location one and drop the member function. Previously, we always make
PendingScript&amp; valid by always calling `setElement(...)`. I think this is the bug since we accidentally
exposed the half-baked pending script. But this bug is not shown since `!cachedScript` path is dead code!
This requestPendingScript is called from two places, requestDeferredScript and requestParsingBlockingScript.
And these functions are called if the script has `willBeParserExecuted` flag. In the case of the script
tag having &quot;src&quot; attribute, this flag is only set if `cachedScript` is correctly instantiated. So when
these functions are called, we can ensure that `cachedScript` is correctly instantiated for the given script.
In the case of the script tag not having &quot;src&quot; attribute, these functions are won't be called. This is
because if such a script tag has `willBeParserExecuted` flag, it also has `m_readyToBeParserExecuted`
and it does not have `m_willExecuteWhenDocumentFinishedParsing` flag, and in that case the both
functions are never called. So we drop that path and insert the assertion to ensure the above conditions.
* html/parser/HTMLScriptRunner.h:
* html/parser/HTMLScriptRunnerHost.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoreChangeLog">releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoreWebCorexcodeprojprojectpbxproj">releases/WebKitGTK/webkit-2.14/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoredomPendingScriptcpp">releases/WebKitGTK/webkit-2.14/Source/WebCore/dom/PendingScript.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoredomPendingScripth">releases/WebKitGTK/webkit-2.14/Source/WebCore/dom/PendingScript.h</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoredomScriptRunnercpp">releases/WebKitGTK/webkit-2.14/Source/WebCore/dom/ScriptRunner.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoredomScriptRunnerh">releases/WebKitGTK/webkit-2.14/Source/WebCore/dom/ScriptRunner.h</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCorehtmlparserHTMLDocumentParsercpp">releases/WebKitGTK/webkit-2.14/Source/WebCore/html/parser/HTMLDocumentParser.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCorehtmlparserHTMLDocumentParserh">releases/WebKitGTK/webkit-2.14/Source/WebCore/html/parser/HTMLDocumentParser.h</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCorehtmlparserHTMLScriptRunnercpp">releases/WebKitGTK/webkit-2.14/Source/WebCore/html/parser/HTMLScriptRunner.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCorehtmlparserHTMLScriptRunnerh">releases/WebKitGTK/webkit-2.14/Source/WebCore/html/parser/HTMLScriptRunner.h</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCorehtmlparserHTMLScriptRunnerHosth">releases/WebKitGTK/webkit-2.14/Source/WebCore/html/parser/HTMLScriptRunnerHost.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoredomPendingScriptClienth">releases/WebKitGTK/webkit-2.14/Source/WebCore/dom/PendingScriptClient.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit214SourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog (205601 => 205602)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog        2016-09-08 07:57:23 UTC (rev 205601)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog        2016-09-08 07:58:55 UTC (rev 205602)
</span><span class="lines">@@ -1,3 +1,111 @@
</span><ins>+2016-08-30  Yusuke Suzuki  &lt;utatane.tea@gmail.com&gt;
+
+        Make PendingScript as ref-counted
+        https://bugs.webkit.org/show_bug.cgi?id=161350
+
+        Reviewed by Ryosuke Niwa.
+
+        Currently, while PendingScript is copyable, PendingScript is also CachedResourceClient.
+        So when copying this, the client registration is done in PendingScript's operator= etc.
+        However, this copying functionality is not effectively used.
+        In this patch, we change this PendingScript to ref-counted class and make it noncopyable.
+        This change makes things simple (dropping this copying functionality), and drops unnecessary
+        addClient / removeClient calls. And we also simplify PendingScript class. Since we can offer
+        all the members at the construction time, we do not need any setters like setCachedScript,
+        setElement etc. This prevents us from accidentally generating the half-baked pending script.
+
+        Furthermore, by changing PendingScript noncopyable &amp; ref-counted, we easily make it
+        observable. In this patch, we add PendingScriptClient to receive the notification from
+        PendingScript. Previously, we directly used CachedScript in PendingScript to receive the
+        notification. When introducing ScriptModuleGraph and making this PendingScript the container
+        of the both CachedScript and ScriptModuleGraph, hiding the raw CachedScript operations is
+        useful.
+
+        No behavior changes.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * dom/PendingScript.cpp:
+        (WebCore::PendingScript::create): These factory functions take all the information needed
+        to construct the PendingScript. So the setters of PendingScript are dropped. This is better
+        since we now do not expose any half-baked pending script accidentally.
+        (WebCore::PendingScript::PendingScript):
+        (WebCore::PendingScript::~PendingScript):
+        (WebCore::PendingScript::notifyClientFinished):
+        (WebCore::PendingScript::notifyFinished):
+        (WebCore::PendingScript::isLoaded): When introducing ScriptModuleGraph, this will query to
+        either CachedScript or ScriptModuleGraph. PendingScript will become the container for the
+        both types.
+        (WebCore::PendingScript::setClient):
+        (WebCore::PendingScript::clearClient): PendingScript is now observable by PendingScriptClient.
+        This avoids touching CachedScript in PendingScript directly. That is good when we introduce
+        ScriptModuleGraph and make PendingScript the container of the both CachedScript and ScriptModuleGraph.
+        (WebCore::PendingScript::releaseElementAndClear): Deleted. Previously, PendingScript is not ref-counted.
+        So when we would like to say &quot;this pending script is empty&quot;, we used the pending script with
+        `m_element = nullptr`. This releaseElementAndClear cleared this m_element and made the pending
+        script empty. Now, we use RefPtr&lt;PendingScript&gt; and empty one is just represented by the nullptr.
+        This function is no longer necessary. Dropped.
+        (WebCore::PendingScript::setCachedScript): Deleted. The fields are set in the constructor.
+        So this setter is no longer necessary. Dropped.
+        * dom/PendingScript.h:
+        * dom/PendingScriptClient.h: Copied from Source/WebCore/html/parser/HTMLScriptRunnerHost.h.
+        (WebCore::PendingScriptClient::~PendingScriptClient):
+        * dom/ScriptRunner.cpp:
+        (WebCore::ScriptRunner::queueScriptForExecution):
+        (WebCore::ScriptRunner::notifyScriptReady):
+        (WebCore::ScriptRunner::timerFired): We use `std::exchange` to retrieve the RefPtr&lt;PendingScript&gt;
+        and make the original vector element nullptr. Without this, all the PendingScript is held until
+        the iteration finishes. We keep the original semantics here that the pending script can be
+        released per iteration.
+        * dom/ScriptRunner.h:
+        * html/parser/HTMLDocumentParser.cpp:
+        (WebCore::HTMLDocumentParser::watchForLoad):
+        (WebCore::HTMLDocumentParser::stopWatchingForLoad): Use PendingScript instead of touching
+        CachedScript directly.
+        (WebCore::HTMLDocumentParser::notifyFinished):
+        * html/parser/HTMLDocumentParser.h:
+        * html/parser/HTMLScriptRunner.cpp:
+        (WebCore::HTMLScriptRunner::~HTMLScriptRunner):
+        (WebCore::HTMLScriptRunner::sourceFromPendingScript):
+        (WebCore::HTMLScriptRunner::isPendingScriptReady):
+        (WebCore::HTMLScriptRunner::executeParsingBlockingScript):
+        (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent): As the previous comment describes,
+        we used releaseElementAndClear to make the current pending script empty. Instead of doing so, we now
+        explicitly clear executeParsingBlockingScript (by assigning nullptr to m_parserBlockingScript).
+        (WebCore::HTMLScriptRunner::watchForLoad):
+        (WebCore::HTMLScriptRunner::stopWatchingForLoad): Previously, we used CachedScript::addClient directly
+        in the m_host.watchForLoad. This means that we did not have a quick way to query whether the pending
+        script is watched. In the old implementation, we have the `m_watchingForLoad : bool` flag in PendingScript
+        to hold the watching status for the given pending script. This `pendingScript.setWatchingForLoad(true)`
+        just made this flag `true`. But now, we do not use CachedScript::addClient directly. Instead, we have
+        the PendingScriptClient and PendingScript::{setClient,clearClient}. We can know whether this pending
+        script is watched by checking `m_client != nullptr`. This makes `m_watchingForLoad` unnecessary.
+        So this patch drops `m_watchingForLoad` and `pendingScript.setWatchingForLoad(true)` call.
+        (WebCore::HTMLScriptRunner::hasParserBlockingScript):
+        (WebCore::HTMLScriptRunner::executeParsingBlockingScripts): We clear the m_parserBlockingScript here
+        instead of the middle of the executePendingScriptAndDispatchEvent.
+        (WebCore::HTMLScriptRunner::executeScriptsWaitingForLoad):
+        (WebCore::HTMLScriptRunner::executeScriptsWaitingForParsing):
+        (WebCore::requestPendingScript):
+        (WebCore::HTMLScriptRunner::requestParsingBlockingScript): Setting m_parsingBlockingScript is now done
+        in this caller side.
+        (WebCore::HTMLScriptRunner::requestDeferredScript):
+        (WebCore::HTMLScriptRunner::runScript):
+        (WebCore::HTMLScriptRunner::requestPendingScript): Instead of configuring the passed PendingScript&amp;,
+        we return the pending script and the caller sets it to m_parserBlockingScript or holds it. And we now
+        change this function to static location one and drop the member function. Previously, we always make
+        PendingScript&amp; valid by always calling `setElement(...)`. I think this is the bug since we accidentally
+        exposed the half-baked pending script. But this bug is not shown since `!cachedScript` path is dead code!
+        This requestPendingScript is called from two places, requestDeferredScript and requestParsingBlockingScript.
+        And these functions are called if the script has `willBeParserExecuted` flag. In the case of the script
+        tag having &quot;src&quot; attribute, this flag is only set if `cachedScript` is correctly instantiated. So when
+        these functions are called, we can ensure that `cachedScript` is correctly instantiated for the given script.
+        In the case of the script tag not having &quot;src&quot; attribute, these functions are won't be called. This is
+        because if such a script tag has `willBeParserExecuted` flag, it also has `m_readyToBeParserExecuted`
+        and it does not have `m_willExecuteWhenDocumentFinishedParsing` flag, and in that case the both
+        functions are never called. So we drop that path and insert the assertion to ensure the above conditions.
+        * html/parser/HTMLScriptRunner.h:
+        * html/parser/HTMLScriptRunnerHost.h:
+
</ins><span class="cx"> 2016-08-30  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [[Delete]] should throw for cross-origin Window / Location objects
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/WebCore.xcodeproj/project.pbxproj (205601 => 205602)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-09-08 07:57:23 UTC (rev 205601)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-09-08 07:58:55 UTC (rev 205602)
</span><span class="lines">@@ -6086,6 +6086,7 @@
</span><span class="cx">                 E1FF8F6D180DB5BE00132674 /* CryptoAlgorithmRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = E1FF8F6B180DB5BE00132674 /* CryptoAlgorithmRegistry.h */; };
</span><span class="cx">                 E38838981BAD145F00D62EE3 /* JSModuleLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38838941BAD145F00D62EE3 /* JSModuleLoader.cpp */; };
</span><span class="cx">                 E38838991BAD145F00D62EE3 /* JSModuleLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = E38838951BAD145F00D62EE3 /* JSModuleLoader.h */; };
</span><ins>+                E3FA38641D71812D00AA5950 /* PendingScriptClient.h in Headers */ = {isa = PBXBuildFile; fileRef = E3FA38611D716E7600AA5950 /* PendingScriptClient.h */; };
</ins><span class="cx">                 E401C27517CE53EC00C41A35 /* ElementIteratorAssertions.h in Headers */ = {isa = PBXBuildFile; fileRef = E401C27417CE53EC00C41A35 /* ElementIteratorAssertions.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 E401E0A41C3C0B8300F34D10 /* StyleChange.h in Headers */ = {isa = PBXBuildFile; fileRef = E401E0A31C3C0B8300F34D10 /* StyleChange.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 E401E0A61C3C0CF700F34D10 /* StyleChange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E401E0A51C3C0CF700F34D10 /* StyleChange.cpp */; };
</span><span class="lines">@@ -13647,6 +13648,7 @@
</span><span class="cx">                 E1FF8F6B180DB5BE00132674 /* CryptoAlgorithmRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmRegistry.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E38838941BAD145F00D62EE3 /* JSModuleLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSModuleLoader.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E38838951BAD145F00D62EE3 /* JSModuleLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSModuleLoader.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                E3FA38611D716E7600AA5950 /* PendingScriptClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PendingScriptClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 E401C27417CE53EC00C41A35 /* ElementIteratorAssertions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ElementIteratorAssertions.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E401E0A31C3C0B8300F34D10 /* StyleChange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleChange.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E401E0A51C3C0CF700F34D10 /* StyleChange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StyleChange.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -23056,6 +23058,7 @@
</span><span class="cx">                                 83D26D3D1AFDCC50001B3873 /* ParentNode.idl */,
</span><span class="cx">                                 8A7CC96F12076F8A001D4588 /* PendingScript.cpp */,
</span><span class="cx">                                 8A7CC96A12076D73001D4588 /* PendingScript.h */,
</span><ins>+                                E3FA38611D716E7600AA5950 /* PendingScriptClient.h */,
</ins><span class="cx">                                 41BF700D0FE86F61005E8DEC /* PlatformMessagePortChannel.cpp */,
</span><span class="cx">                                 41BF700E0FE86F61005E8DEC /* PlatformMessagePortChannel.h */,
</span><span class="cx">                                 5189F0DD10B46B0E00F3C739 /* PopStateEvent.cpp */,
</span><span class="lines">@@ -27030,6 +27033,7 @@
</span><span class="cx">                                 59C28046138DC2410079B7E2 /* XMLErrors.h in Headers */,
</span><span class="cx">                                 BC772C470C4EB2C60083285F /* XMLHttpRequest.h in Headers */,
</span><span class="cx">                                 83D35AEC1C7187FA00F70D5A /* XMLHttpRequestEventTarget.h in Headers */,
</span><ins>+                                E3FA38641D71812D00AA5950 /* PendingScriptClient.h in Headers */,
</ins><span class="cx">                                 F9F0ED7A0DB50CA200D16DB9 /* XMLHttpRequestProgressEvent.h in Headers */,
</span><span class="cx">                                 A136A00D1134DBD200CC8D50 /* XMLHttpRequestProgressEventThrottle.h in Headers */,
</span><span class="cx">                                 BCDFD48E0E305290009D10AD /* XMLHttpRequestUpload.h in Headers */,
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoredomPendingScriptcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/dom/PendingScript.cpp (205601 => 205602)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/dom/PendingScript.cpp        2016-09-08 07:57:23 UTC (rev 205601)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/dom/PendingScript.cpp        2016-09-08 07:58:55 UTC (rev 205602)
</span><span class="lines">@@ -28,32 +28,38 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;CachedScript.h&quot;
</span><span class="cx"> #include &quot;Element.h&quot;
</span><ins>+#include &quot;PendingScriptClient.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-PendingScript::~PendingScript()
</del><ins>+Ref&lt;PendingScript&gt; PendingScript::create(Element&amp; element, CachedScript&amp; cachedScript)
</ins><span class="cx"> {
</span><del>-    if (m_cachedScript)
-        m_cachedScript-&gt;removeClient(this);
</del><ins>+    Ref&lt;PendingScript&gt; pendingScript = adoptRef(*new PendingScript(element, cachedScript));
+    cachedScript.addClient(&amp;pendingScript.get());
+    return pendingScript;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;Element&gt; PendingScript::releaseElementAndClear()
</del><ins>+Ref&lt;PendingScript&gt; PendingScript::create(Element&amp; element, TextPosition scriptStartPosition)
</ins><span class="cx"> {
</span><del>-    setCachedScript(nullptr);
-    m_watchingForLoad = false;
-    m_startingPosition = TextPosition::belowRangePosition();
-    return WTFMove(m_element);
</del><ins>+    return adoptRef(*new PendingScript(element, scriptStartPosition));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PendingScript::setCachedScript(CachedScript* cachedScript)
</del><ins>+PendingScript::PendingScript(Element&amp; element, TextPosition startingPosition)
+    : m_element(element)
+    , m_startingPosition(startingPosition)
</ins><span class="cx"> {
</span><del>-    if (m_cachedScript == cachedScript)
-        return;
</del><ins>+}
+
+PendingScript::PendingScript(Element&amp; element, CachedScript&amp; cachedScript)
+    : m_element(element)
+    , m_cachedScript(&amp;cachedScript)
+{
+}
+
+PendingScript::~PendingScript()
+{
</ins><span class="cx">     if (m_cachedScript)
</span><span class="cx">         m_cachedScript-&gt;removeClient(this);
</span><del>-    m_cachedScript = cachedScript;
-    if (m_cachedScript)
-        m_cachedScript-&gt;addClient(this);
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> CachedScript* PendingScript::cachedScript() const
</span><span class="lines">@@ -61,8 +67,35 @@
</span><span class="cx">     return m_cachedScript.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void PendingScript::notifyClientFinished()
+{
+    Ref&lt;PendingScript&gt; protectedThis(*this);
+    if (m_client)
+        m_client-&gt;notifyFinished(*this);
+}
+
</ins><span class="cx"> void PendingScript::notifyFinished(CachedResource*)
</span><span class="cx"> {
</span><ins>+    notifyClientFinished();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool PendingScript::isLoaded() const
+{
+    return m_cachedScript &amp;&amp; m_cachedScript-&gt;isLoaded();
</ins><span class="cx"> }
</span><ins>+
+void PendingScript::setClient(PendingScriptClient* client)
+{
+    ASSERT(!m_client);
+    m_client = client;
+    if (isLoaded())
+        notifyClientFinished();
+}
+
+void PendingScript::clearClient()
+{
+    ASSERT(m_client);
+    m_client = nullptr;
+}
+
+}
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoredomPendingScripth"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/dom/PendingScript.h (205601 => 205602)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/dom/PendingScript.h        2016-09-08 07:57:23 UTC (rev 205601)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/dom/PendingScript.h        2016-09-08 07:58:55 UTC (rev 205602)
</span><span class="lines">@@ -23,18 +23,19 @@
</span><span class="cx">  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef PendingScript_h
-#define PendingScript_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #include &quot;CachedResourceClient.h&quot;
</span><span class="cx"> #include &quot;CachedResourceHandle.h&quot;
</span><ins>+#include &lt;wtf/Ref.h&gt;
+#include &lt;wtf/RefCounted.h&gt;
</ins><span class="cx"> #include &lt;wtf/text/TextPosition.h&gt;
</span><del>-#include &lt;wtf/RefPtr.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class CachedScript;
</span><span class="cx"> class Element;
</span><ins>+class PendingScriptClient;
</ins><span class="cx"> 
</span><span class="cx"> // A container for an external script which may be loaded and executed.
</span><span class="cx"> //
</span><span class="lines">@@ -41,67 +42,41 @@
</span><span class="cx"> // A CachedResourceHandle alone does not prevent the underlying CachedResource
</span><span class="cx"> // from purging its data buffer. This class holds a dummy client open for its
</span><span class="cx"> // lifetime in order to guarantee that the data buffer will not be purged.
</span><del>-class PendingScript final : public CachedResourceClient {
</del><ins>+class PendingScript final : public RefCounted&lt;PendingScript&gt;, public CachedResourceClient {
</ins><span class="cx"> public:
</span><del>-    PendingScript()
-        : m_watchingForLoad(false)
-        , m_startingPosition(TextPosition::belowRangePosition())
-    {
-    }
</del><ins>+    static Ref&lt;PendingScript&gt; create(Element&amp;, CachedScript&amp;);
+    static Ref&lt;PendingScript&gt; create(Element&amp;, TextPosition scriptStartPosition);
</ins><span class="cx"> 
</span><del>-    PendingScript(Element* element, CachedScript* cachedScript)
-        : m_watchingForLoad(false)
-        , m_element(element)
-    {
-        setCachedScript(cachedScript);
-    }
-
-    PendingScript(const PendingScript&amp; other)
-        : CachedResourceClient(other)
-        , m_watchingForLoad(other.m_watchingForLoad)
-        , m_element(other.m_element)
-        , m_startingPosition(other.m_startingPosition)
-    {
-        setCachedScript(other.cachedScript());
-    }
-
</del><span class="cx">     virtual ~PendingScript();
</span><span class="cx"> 
</span><del>-    PendingScript&amp; operator=(const PendingScript&amp; other)
-    {
-        if (this == &amp;other)
-            return *this;
-
-        m_watchingForLoad = other.m_watchingForLoad;
-        m_element = other.m_element;
-        m_startingPosition = other.m_startingPosition;
-        setCachedScript(other.cachedScript());
-
-        return *this;
-    }
-
</del><span class="cx">     TextPosition startingPosition() const { return m_startingPosition; }
</span><span class="cx">     void setStartingPosition(const TextPosition&amp; position) { m_startingPosition = position; }
</span><span class="cx"> 
</span><del>-    bool watchingForLoad() const { return m_watchingForLoad; }
-    void setWatchingForLoad(bool b) { m_watchingForLoad = b; }
</del><ins>+    bool watchingForLoad() const { return needsLoading() &amp;&amp; m_client; }
</ins><span class="cx"> 
</span><del>-    Element* element() const { return m_element.get(); }
-    void setElement(Element* element) { m_element = element; }
-    RefPtr&lt;Element&gt; releaseElementAndClear();
</del><ins>+    Element&amp; element() { return m_element.get(); }
+    const Element&amp; element() const { return m_element.get(); }
</ins><span class="cx"> 
</span><span class="cx">     CachedScript* cachedScript() const;
</span><del>-    void setCachedScript(CachedScript*);
</del><ins>+    bool needsLoading() const { return cachedScript(); }
</ins><span class="cx"> 
</span><ins>+    bool isLoaded() const;
+
</ins><span class="cx">     void notifyFinished(CachedResource*) override;
</span><span class="cx"> 
</span><ins>+    void setClient(PendingScriptClient*);
+    void clearClient();
+
</ins><span class="cx"> private:
</span><del>-    bool m_watchingForLoad;
-    RefPtr&lt;Element&gt; m_element;
</del><ins>+    PendingScript(Element&amp;, CachedScript&amp;);
+    PendingScript(Element&amp;, TextPosition startingPosition);
+
+    void notifyClientFinished();
+
+    Ref&lt;Element&gt; m_element;
</ins><span class="cx">     TextPosition m_startingPosition; // Only used for inline script tags.
</span><del>-    CachedResourceHandle&lt;CachedScript&gt; m_cachedScript; 
</del><ins>+    CachedResourceHandle&lt;CachedScript&gt; m_cachedScript;
+    PendingScriptClient* m_client { nullptr };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span><del>-
-#endif
</del></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoredomPendingScriptClienthfromrev205601releasesWebKitGTKwebkit214SourceWebCorehtmlparserHTMLScriptRunnerHosth"></a>
<div class="copfile"><h4>Copied: releases/WebKitGTK/webkit-2.14/Source/WebCore/dom/PendingScriptClient.h (from rev 205601, releases/WebKitGTK/webkit-2.14/Source/WebCore/html/parser/HTMLScriptRunnerHost.h) (0 => 205602)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/dom/PendingScriptClient.h                                (rev 0)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/dom/PendingScriptClient.h        2016-09-08 07:58:55 UTC (rev 205602)
</span><span class="lines">@@ -0,0 +1,39 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+namespace WebCore {
+
+class PendingScript;
+
+class PendingScriptClient {
+public:
+    virtual ~PendingScriptClient() { }
+
+    virtual void notifyFinished(PendingScript&amp;) = 0;
+};
+
+}
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoredomScriptRunnercpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/dom/ScriptRunner.cpp (205601 => 205602)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/dom/ScriptRunner.cpp        2016-09-08 07:57:23 UTC (rev 205601)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/dom/ScriptRunner.cpp        2016-09-08 07:58:55 UTC (rev 205602)
</span><span class="lines">@@ -61,11 +61,11 @@
</span><span class="cx"> 
</span><span class="cx">     switch (executionType) {
</span><span class="cx">     case ASYNC_EXECUTION:
</span><del>-        m_pendingAsyncScripts.add(scriptElement, PendingScript(&amp;element, cachedScript.get()));
</del><ins>+        m_pendingAsyncScripts.add(scriptElement, PendingScript::create(element, *cachedScript));
</ins><span class="cx">         break;
</span><span class="cx"> 
</span><span class="cx">     case IN_ORDER_EXECUTION:
</span><del>-        m_scriptsToExecuteInOrder.append(PendingScript(&amp;element, cachedScript.get()));
</del><ins>+        m_scriptsToExecuteInOrder.append(PendingScript::create(element, *cachedScript));
</ins><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -86,7 +86,7 @@
</span><span class="cx">     switch (executionType) {
</span><span class="cx">     case ASYNC_EXECUTION:
</span><span class="cx">         ASSERT(m_pendingAsyncScripts.contains(scriptElement));
</span><del>-        m_scriptsToExecuteSoon.append(m_pendingAsyncScripts.take(scriptElement));
</del><ins>+        m_scriptsToExecuteSoon.append(m_pendingAsyncScripts.take(scriptElement)-&gt;ptr());
</ins><span class="cx">         break;
</span><span class="cx"> 
</span><span class="cx">     case IN_ORDER_EXECUTION:
</span><span class="lines">@@ -100,23 +100,24 @@
</span><span class="cx"> {
</span><span class="cx">     Ref&lt;Document&gt; protect(m_document);
</span><span class="cx"> 
</span><del>-    Vector&lt;PendingScript&gt; scripts;
</del><ins>+    Vector&lt;RefPtr&lt;PendingScript&gt;&gt; scripts;
</ins><span class="cx">     scripts.swap(m_scriptsToExecuteSoon);
</span><span class="cx"> 
</span><span class="cx">     size_t numInOrderScriptsToExecute = 0;
</span><del>-    for (; numInOrderScriptsToExecute &lt; m_scriptsToExecuteInOrder.size() &amp;&amp; m_scriptsToExecuteInOrder[numInOrderScriptsToExecute].cachedScript()-&gt;isLoaded(); ++numInOrderScriptsToExecute)
-        scripts.append(m_scriptsToExecuteInOrder[numInOrderScriptsToExecute]);
</del><ins>+    for (; numInOrderScriptsToExecute &lt; m_scriptsToExecuteInOrder.size() &amp;&amp; m_scriptsToExecuteInOrder[numInOrderScriptsToExecute]-&gt;isLoaded(); ++numInOrderScriptsToExecute)
+        scripts.append(m_scriptsToExecuteInOrder[numInOrderScriptsToExecute].ptr());
</ins><span class="cx">     if (numInOrderScriptsToExecute)
</span><span class="cx">         m_scriptsToExecuteInOrder.remove(0, numInOrderScriptsToExecute);
</span><span class="cx"> 
</span><del>-    for (auto&amp; script : scripts) {
-        CachedScript* cachedScript = script.cachedScript();
-        RefPtr&lt;Element&gt; element = script.releaseElementAndClear();
-        ASSERT(element);
</del><ins>+    for (auto&amp; currentScript : scripts) {
+        auto script = WTFMove(currentScript);
+        ASSERT(script);
</ins><span class="cx">         // Paper over https://bugs.webkit.org/show_bug.cgi?id=144050
</span><del>-        if (!element)
</del><ins>+        if (!script)
</ins><span class="cx">             continue;
</span><del>-        toScriptElementIfPossible(element.get())-&gt;execute(cachedScript);
</del><ins>+        auto* scriptElement = toScriptElementIfPossible(&amp;script-&gt;element());
+        ASSERT(scriptElement);
+        scriptElement-&gt;execute(script-&gt;cachedScript());
</ins><span class="cx">         m_document.decrementLoadEventDelayCount();
</span><span class="cx">     }
</span><span class="cx"> }
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoredomScriptRunnerh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/dom/ScriptRunner.h (205601 => 205602)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/dom/ScriptRunner.h        2016-09-08 07:57:23 UTC (rev 205601)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/dom/ScriptRunner.h        2016-09-08 07:58:55 UTC (rev 205602)
</span><span class="lines">@@ -56,9 +56,9 @@
</span><span class="cx">     void timerFired();
</span><span class="cx"> 
</span><span class="cx">     Document&amp; m_document;
</span><del>-    Vector&lt;PendingScript&gt; m_scriptsToExecuteInOrder;
-    Vector&lt;PendingScript&gt; m_scriptsToExecuteSoon; // http://www.whatwg.org/specs/web-apps/current-work/#set-of-scripts-that-will-execute-as-soon-as-possible
-    HashMap&lt;ScriptElement*, PendingScript&gt; m_pendingAsyncScripts;
</del><ins>+    Vector&lt;Ref&lt;PendingScript&gt;&gt; m_scriptsToExecuteInOrder;
+    Vector&lt;RefPtr&lt;PendingScript&gt;&gt; m_scriptsToExecuteSoon; // http://www.whatwg.org/specs/web-apps/current-work/#set-of-scripts-that-will-execute-as-soon-as-possible
+    HashMap&lt;ScriptElement*, Ref&lt;PendingScript&gt;&gt; m_pendingAsyncScripts;
</ins><span class="cx">     Timer m_timer;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCorehtmlparserHTMLDocumentParsercpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/html/parser/HTMLDocumentParser.cpp (205601 => 205602)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/html/parser/HTMLDocumentParser.cpp        2016-09-08 07:57:23 UTC (rev 205601)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/html/parser/HTMLDocumentParser.cpp        2016-09-08 07:58:55 UTC (rev 205602)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;HTMLDocumentParser.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;CachedScript.h&quot;
</ins><span class="cx"> #include &quot;DocumentFragment.h&quot;
</span><span class="cx"> #include &quot;Frame.h&quot;
</span><span class="cx"> #include &quot;HTMLDocument.h&quot;
</span><span class="lines">@@ -500,18 +501,18 @@
</span><span class="cx">     endIfDelayed();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLDocumentParser::watchForLoad(CachedResource* cachedScript)
</del><ins>+void HTMLDocumentParser::watchForLoad(PendingScript&amp; pendingScript)
</ins><span class="cx"> {
</span><del>-    ASSERT(!cachedScript-&gt;isLoaded());
-    // addClient would call notifyFinished if the load were complete.
</del><ins>+    ASSERT(!pendingScript.isLoaded());
+    // setClient would call notifyFinished if the load were complete.
</ins><span class="cx">     // Callers do not expect to be re-entered from this call, so they should
</span><del>-    // not an already-loaded CachedResource.
-    cachedScript-&gt;addClient(this);
</del><ins>+    // not an already-loaded PendingScript.
+    pendingScript.setClient(this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLDocumentParser::stopWatchingForLoad(CachedResource* cachedScript)
</del><ins>+void HTMLDocumentParser::stopWatchingForLoad(PendingScript&amp; pendingScript)
</ins><span class="cx"> {
</span><del>-    cachedScript-&gt;removeClient(this);
</del><ins>+    pendingScript.clearClient();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void HTMLDocumentParser::appendCurrentInputStreamToPreloadScannerAndScan()
</span><span class="lines">@@ -521,7 +522,7 @@
</span><span class="cx">     m_preloadScanner-&gt;scan(*m_preloader, *document());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLDocumentParser::notifyFinished(CachedResource* cachedResource)
</del><ins>+void HTMLDocumentParser::notifyFinished(PendingScript&amp; pendingScript)
</ins><span class="cx"> {
</span><span class="cx">     // pumpTokenizer can cause this parser to be detached from the Document,
</span><span class="cx">     // but we need to ensure it isn't deleted yet.
</span><span class="lines">@@ -534,7 +535,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    m_scriptRunner-&gt;executeScriptsWaitingForLoad(cachedResource);
</del><ins>+    m_scriptRunner-&gt;executeScriptsWaitingForLoad(pendingScript);
</ins><span class="cx">     if (!isWaitingForScripts())
</span><span class="cx">         resumeParsingAfterScriptExecution();
</span><span class="cx"> }
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCorehtmlparserHTMLDocumentParserh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/html/parser/HTMLDocumentParser.h (205601 => 205602)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/html/parser/HTMLDocumentParser.h        2016-09-08 07:57:23 UTC (rev 205601)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/html/parser/HTMLDocumentParser.h        2016-09-08 07:58:55 UTC (rev 205602)
</span><span class="lines">@@ -27,11 +27,11 @@
</span><span class="cx"> #ifndef HTMLDocumentParser_h
</span><span class="cx"> #define HTMLDocumentParser_h
</span><span class="cx"> 
</span><del>-#include &quot;CachedResourceClient.h&quot;
</del><span class="cx"> #include &quot;HTMLInputStream.h&quot;
</span><span class="cx"> #include &quot;HTMLScriptRunnerHost.h&quot;
</span><span class="cx"> #include &quot;HTMLSourceTracker.h&quot;
</span><span class="cx"> #include &quot;HTMLTokenizer.h&quot;
</span><ins>+#include &quot;PendingScriptClient.h&quot;
</ins><span class="cx"> #include &quot;ScriptableDocumentParser.h&quot;
</span><span class="cx"> #include &quot;XSSAuditor.h&quot;
</span><span class="cx"> #include &quot;XSSAuditorDelegate.h&quot;
</span><span class="lines">@@ -47,7 +47,7 @@
</span><span class="cx"> class HTMLResourcePreloader;
</span><span class="cx"> class PumpSession;
</span><span class="cx"> 
</span><del>-class HTMLDocumentParser : public ScriptableDocumentParser, private HTMLScriptRunnerHost, private CachedResourceClient {
</del><ins>+class HTMLDocumentParser : public ScriptableDocumentParser, private HTMLScriptRunnerHost, private PendingScriptClient {
</ins><span class="cx">     WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><span class="cx">     static Ref&lt;HTMLDocumentParser&gt; create(HTMLDocument&amp;);
</span><span class="lines">@@ -90,14 +90,14 @@
</span><span class="cx">     bool shouldAssociateConsoleMessagesWithTextPosition() const final;
</span><span class="cx"> 
</span><span class="cx">     // HTMLScriptRunnerHost
</span><del>-    void watchForLoad(CachedResource*) final;
-    void stopWatchingForLoad(CachedResource*) final;
</del><ins>+    void watchForLoad(PendingScript&amp;) final;
+    void stopWatchingForLoad(PendingScript&amp;) final;
</ins><span class="cx">     HTMLInputStream&amp; inputStream() final;
</span><span class="cx">     bool hasPreloadScanner() const final;
</span><span class="cx">     void appendCurrentInputStreamToPreloadScannerAndScan() final;
</span><span class="cx"> 
</span><del>-    // CachedResourceClient
-    void notifyFinished(CachedResource*) final;
</del><ins>+    // PendingScriptClient
+    void notifyFinished(PendingScript&amp;) final;
</ins><span class="cx"> 
</span><span class="cx">     Document* contextForParsingSession();
</span><span class="cx"> 
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCorehtmlparserHTMLScriptRunnercpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/html/parser/HTMLScriptRunner.cpp (205601 => 205602)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/html/parser/HTMLScriptRunner.cpp        2016-09-08 07:57:23 UTC (rev 205601)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/html/parser/HTMLScriptRunner.cpp        2016-09-08 07:58:55 UTC (rev 205602)
</span><span class="lines">@@ -58,12 +58,14 @@
</span><span class="cx"> HTMLScriptRunner::~HTMLScriptRunner()
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Should we be passed a &quot;done loading/parsing&quot; callback sooner than destruction?
</span><del>-    if (m_parserBlockingScript.cachedScript() &amp;&amp; m_parserBlockingScript.watchingForLoad())
-        stopWatchingForLoad(m_parserBlockingScript);
</del><ins>+    if (m_parserBlockingScript) {
+        if (m_parserBlockingScript-&gt;watchingForLoad())
+            stopWatchingForLoad(*m_parserBlockingScript);
+    }
</ins><span class="cx"> 
</span><span class="cx">     while (!m_scriptsToExecuteAfterParsing.isEmpty()) {
</span><del>-        PendingScript pendingScript = m_scriptsToExecuteAfterParsing.takeFirst();
-        if (pendingScript.cachedScript() &amp;&amp; pendingScript.watchingForLoad())
</del><ins>+        auto pendingScript = m_scriptsToExecuteAfterParsing.takeFirst();
+        if (pendingScript-&gt;watchingForLoad())
</ins><span class="cx">             stopWatchingForLoad(pendingScript);
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -95,7 +97,7 @@
</span><span class="cx">         return ScriptSourceCode(script.cachedScript());
</span><span class="cx">     }
</span><span class="cx">     errorOccurred = false;
</span><del>-    return ScriptSourceCode(script.element()-&gt;textContent(), documentURLForScriptExecution(m_document), script.startingPosition());
</del><ins>+    return ScriptSourceCode(script.element().textContent(), documentURLForScriptExecution(m_document), script.startingPosition());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool HTMLScriptRunner::isPendingScriptReady(const PendingScript&amp; script)
</span><span class="lines">@@ -105,7 +107,7 @@
</span><span class="cx">     m_hasScriptsWaitingForStylesheets = !m_document-&gt;haveStylesheetsLoaded();
</span><span class="cx">     if (m_hasScriptsWaitingForStylesheets)
</span><span class="cx">         return false;
</span><del>-    if (script.cachedScript() &amp;&amp; !script.cachedScript()-&gt;isLoaded())
</del><ins>+    if (script.needsLoading() &amp;&amp; !script.isLoaded())
</ins><span class="cx">         return false;
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="lines">@@ -115,27 +117,25 @@
</span><span class="cx">     ASSERT(m_document);
</span><span class="cx">     ASSERT(!isExecutingScript());
</span><span class="cx">     ASSERT(m_document-&gt;haveStylesheetsLoaded());
</span><del>-    ASSERT(isPendingScriptReady(m_parserBlockingScript));
</del><ins>+    ASSERT(isPendingScriptReady(*m_parserBlockingScript));
</ins><span class="cx"> 
</span><span class="cx">     InsertionPointRecord insertionPointRecord(m_host.inputStream());
</span><del>-    executePendingScriptAndDispatchEvent(m_parserBlockingScript);
</del><ins>+    executePendingScriptAndDispatchEvent(WTFMove(m_parserBlockingScript));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLScriptRunner::executePendingScriptAndDispatchEvent(PendingScript&amp; pendingScript)
</del><ins>+void HTMLScriptRunner::executePendingScriptAndDispatchEvent(RefPtr&lt;PendingScript&gt; pendingScript)
</ins><span class="cx"> {
</span><span class="cx">     bool errorOccurred = false;
</span><del>-    ScriptSourceCode sourceCode = sourceFromPendingScript(pendingScript, errorOccurred);
</del><ins>+    ScriptSourceCode sourceCode = sourceFromPendingScript(*pendingScript, errorOccurred);
</ins><span class="cx"> 
</span><span class="cx">     // Stop watching loads before executeScript to prevent recursion if the script reloads itself.
</span><del>-    if (pendingScript.cachedScript() &amp;&amp; pendingScript.watchingForLoad())
-        stopWatchingForLoad(pendingScript);
</del><ins>+    if (pendingScript-&gt;watchingForLoad())
+        stopWatchingForLoad(*pendingScript);
</ins><span class="cx"> 
</span><span class="cx">     if (!isExecutingScript())
</span><span class="cx">         MicrotaskQueue::mainThreadQueue().performMicrotaskCheckpoint();
</span><span class="cx"> 
</span><del>-    // Clear the pending script before possible rentrancy from executeScript()
-    RefPtr&lt;Element&gt; element = pendingScript.releaseElementAndClear();
-    if (ScriptElement* scriptElement = toScriptElementIfPossible(element.get())) {
</del><ins>+    if (auto* scriptElement = toScriptElementIfPossible(&amp;pendingScript-&gt;element())) {
</ins><span class="cx">         NestingLevelIncrementer nestingLevelIncrementer(m_scriptNestingLevel);
</span><span class="cx">         IgnoreDestructiveWriteCountIncrementer ignoreDestructiveWriteCountIncrementer(m_document);
</span><span class="cx">         if (errorOccurred)
</span><span class="lines">@@ -143,7 +143,7 @@
</span><span class="cx">         else {
</span><span class="cx">             ASSERT(isExecutingScript());
</span><span class="cx">             scriptElement-&gt;executeScript(sourceCode);
</span><del>-            element-&gt;dispatchEvent(createScriptLoadEvent());
</del><ins>+            pendingScript-&gt;element().dispatchEvent(createScriptLoadEvent());
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     ASSERT(!isExecutingScript());
</span><span class="lines">@@ -152,15 +152,13 @@
</span><span class="cx"> void HTMLScriptRunner::watchForLoad(PendingScript&amp; pendingScript)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!pendingScript.watchingForLoad());
</span><del>-    m_host.watchForLoad(pendingScript.cachedScript());
-    pendingScript.setWatchingForLoad(true);
</del><ins>+    m_host.watchForLoad(pendingScript);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void HTMLScriptRunner::stopWatchingForLoad(PendingScript&amp; pendingScript)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(pendingScript.watchingForLoad());
</span><del>-    m_host.stopWatchingForLoad(pendingScript.cachedScript());
-    pendingScript.setWatchingForLoad(false);
</del><ins>+    m_host.stopWatchingForLoad(pendingScript);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // This function should match 10.2.5.11 &quot;An end tag whose tag name is 'script'&quot;
</span><span class="lines">@@ -187,21 +185,21 @@
</span><span class="cx"> 
</span><span class="cx"> bool HTMLScriptRunner::hasParserBlockingScript() const
</span><span class="cx"> {
</span><del>-    return !!m_parserBlockingScript.element();
</del><ins>+    return !!m_parserBlockingScript;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void HTMLScriptRunner::executeParsingBlockingScripts()
</span><span class="cx"> {
</span><del>-    while (hasParserBlockingScript() &amp;&amp; isPendingScriptReady(m_parserBlockingScript))
</del><ins>+    while (hasParserBlockingScript() &amp;&amp; isPendingScriptReady(*m_parserBlockingScript))
</ins><span class="cx">         executeParsingBlockingScript();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLScriptRunner::executeScriptsWaitingForLoad(CachedResource* cachedScript)
</del><ins>+void HTMLScriptRunner::executeScriptsWaitingForLoad(PendingScript&amp; pendingScript)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(!isExecutingScript());
</span><span class="cx">     ASSERT(hasParserBlockingScript());
</span><del>-    ASSERT_UNUSED(cachedScript, m_parserBlockingScript.cachedScript() == cachedScript);
-    ASSERT(m_parserBlockingScript.cachedScript()-&gt;isLoaded());
</del><ins>+    ASSERT_UNUSED(pendingScript, m_parserBlockingScript.get() == &amp;pendingScript);
+    ASSERT(m_parserBlockingScript-&gt;isLoaded());
</ins><span class="cx">     executeParsingBlockingScripts();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -221,13 +219,12 @@
</span><span class="cx">     while (!m_scriptsToExecuteAfterParsing.isEmpty()) {
</span><span class="cx">         ASSERT(!isExecutingScript());
</span><span class="cx">         ASSERT(!hasParserBlockingScript());
</span><del>-        ASSERT(m_scriptsToExecuteAfterParsing.first().cachedScript());
-        if (!m_scriptsToExecuteAfterParsing.first().cachedScript()-&gt;isLoaded()) {
</del><ins>+        ASSERT(m_scriptsToExecuteAfterParsing.first()-&gt;needsLoading());
+        if (!m_scriptsToExecuteAfterParsing.first()-&gt;isLoaded()) {
</ins><span class="cx">             watchForLoad(m_scriptsToExecuteAfterParsing.first());
</span><span class="cx">             return false;
</span><span class="cx">         }
</span><del>-        PendingScript first = m_scriptsToExecuteAfterParsing.takeFirst();
-        executePendingScriptAndDispatchEvent(first);
</del><ins>+        executePendingScriptAndDispatchEvent(m_scriptsToExecuteAfterParsing.takeFirst());
</ins><span class="cx">         // FIXME: What is this m_document check for?
</span><span class="cx">         if (!m_document)
</span><span class="cx">             return false;
</span><span class="lines">@@ -235,44 +232,34 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static Ref&lt;PendingScript&gt; requestPendingScript(Element* script)
+{
+    auto&amp; scriptElement = *toScriptElementIfPossible(script);
+    ASSERT(scriptElement.willBeParserExecuted());
+    ASSERT(scriptElement.cachedScript());
+    return PendingScript::create(*script, *scriptElement.cachedScript());
+}
+
</ins><span class="cx"> void HTMLScriptRunner::requestParsingBlockingScript(Element* element)
</span><span class="cx"> {
</span><del>-    if (!requestPendingScript(m_parserBlockingScript, element))
-        return;
</del><ins>+    ASSERT(!m_parserBlockingScript);
+    m_parserBlockingScript = requestPendingScript(element);
+    ASSERT(m_parserBlockingScript-&gt;needsLoading());
</ins><span class="cx"> 
</span><del>-    ASSERT(m_parserBlockingScript.cachedScript());
-
</del><span class="cx">     // We only care about a load callback if cachedScript is not already
</span><span class="cx">     // in the cache. Callers will attempt to run the m_parserBlockingScript
</span><span class="cx">     // if possible before returning control to the parser.
</span><del>-    if (!m_parserBlockingScript.cachedScript()-&gt;isLoaded())
-        watchForLoad(m_parserBlockingScript);
</del><ins>+    if (!m_parserBlockingScript-&gt;isLoaded())
+        watchForLoad(*m_parserBlockingScript);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void HTMLScriptRunner::requestDeferredScript(Element* element)
</span><span class="cx"> {
</span><del>-    PendingScript pendingScript;
-    if (!requestPendingScript(pendingScript, element))
-        return;
-
-    ASSERT(pendingScript.cachedScript());
-    m_scriptsToExecuteAfterParsing.append(pendingScript);
</del><ins>+    auto pendingScript = requestPendingScript(element);
+    ASSERT(pendingScript-&gt;needsLoading());
+    m_scriptsToExecuteAfterParsing.append(WTFMove(pendingScript));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool HTMLScriptRunner::requestPendingScript(PendingScript&amp; pendingScript, Element* script) const
-{
-    ASSERT(!pendingScript.element());
-    pendingScript.setElement(script);
-    // This should correctly return 0 for empty or invalid srcValues.
-    CachedScript* cachedScript = toScriptElementIfPossible(script)-&gt;cachedScript().get();
-    if (!cachedScript) {
-        notImplemented(); // Dispatch error event.
-        return false;
-    }
-    pendingScript.setCachedScript(cachedScript);
-    return true;
-}
-
</del><span class="cx"> // This method is meant to match the HTML5 definition of &quot;running a script&quot;
</span><span class="cx"> // http://www.whatwg.org/specs/web-apps/current-work/multipage/scripting-1.html#running-a-script
</span><span class="cx"> void HTMLScriptRunner::runScript(Element* script, const TextPosition&amp; scriptStartPosition)
</span><span class="lines">@@ -308,13 +295,10 @@
</span><span class="cx">         if (scriptElement-&gt;willExecuteWhenDocumentFinishedParsing())
</span><span class="cx">             requestDeferredScript(script);
</span><span class="cx">         else if (scriptElement-&gt;readyToBeParserExecuted()) {
</span><del>-            if (m_scriptNestingLevel == 1) {
-                m_parserBlockingScript.setElement(script);
-                m_parserBlockingScript.setStartingPosition(scriptStartPosition);
-            } else {
-                ScriptSourceCode sourceCode(script-&gt;textContent(), documentURLForScriptExecution(m_document), scriptStartPosition);
-                scriptElement-&gt;executeScript(sourceCode);
-            }
</del><ins>+            if (m_scriptNestingLevel == 1)
+                m_parserBlockingScript = PendingScript::create(*script, scriptStartPosition);
+            else
+                scriptElement-&gt;executeScript(ScriptSourceCode(script-&gt;textContent(), documentURLForScriptExecution(m_document), scriptStartPosition));
</ins><span class="cx">         } else
</span><span class="cx">             requestParsingBlockingScript(script);
</span><span class="cx">     }
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCorehtmlparserHTMLScriptRunnerh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/html/parser/HTMLScriptRunner.h (205601 => 205602)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/html/parser/HTMLScriptRunner.h        2016-09-08 07:57:23 UTC (rev 205601)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/html/parser/HTMLScriptRunner.h        2016-09-08 07:58:55 UTC (rev 205602)
</span><span class="lines">@@ -51,7 +51,7 @@
</span><span class="cx">     // Processes the passed in script and any pending scripts if possible.
</span><span class="cx">     void execute(PassRefPtr&lt;Element&gt; scriptToProcess, const TextPosition&amp; scriptStartPosition);
</span><span class="cx"> 
</span><del>-    void executeScriptsWaitingForLoad(CachedResource*);
</del><ins>+    void executeScriptsWaitingForLoad(PendingScript&amp;);
</ins><span class="cx">     bool hasScriptsWaitingForStylesheets() const { return m_hasScriptsWaitingForStylesheets; }
</span><span class="cx">     void executeScriptsWaitingForStylesheets();
</span><span class="cx">     bool executeScriptsWaitingForParsing();
</span><span class="lines">@@ -63,12 +63,11 @@
</span><span class="cx">     Frame* frame() const;
</span><span class="cx"> 
</span><span class="cx">     void executeParsingBlockingScript();
</span><del>-    void executePendingScriptAndDispatchEvent(PendingScript&amp;);
</del><ins>+    void executePendingScriptAndDispatchEvent(RefPtr&lt;PendingScript&gt;);
</ins><span class="cx">     void executeParsingBlockingScripts();
</span><span class="cx"> 
</span><span class="cx">     void requestParsingBlockingScript(Element*);
</span><span class="cx">     void requestDeferredScript(Element*);
</span><del>-    bool requestPendingScript(PendingScript&amp;, Element*) const;
</del><span class="cx"> 
</span><span class="cx">     void runScript(Element*, const TextPosition&amp; scriptStartPosition);
</span><span class="cx"> 
</span><span class="lines">@@ -80,8 +79,8 @@
</span><span class="cx"> 
</span><span class="cx">     Document* m_document;
</span><span class="cx">     HTMLScriptRunnerHost&amp; m_host;
</span><del>-    PendingScript m_parserBlockingScript;
-    Deque&lt;PendingScript&gt; m_scriptsToExecuteAfterParsing; // http://www.whatwg.org/specs/web-apps/current-work/#list-of-scripts-that-will-execute-when-the-document-has-finished-parsing
</del><ins>+    RefPtr&lt;PendingScript&gt; m_parserBlockingScript;
+    Deque&lt;Ref&lt;PendingScript&gt;&gt; m_scriptsToExecuteAfterParsing; // http://www.whatwg.org/specs/web-apps/current-work/#list-of-scripts-that-will-execute-when-the-document-has-finished-parsing
</ins><span class="cx">     unsigned m_scriptNestingLevel;
</span><span class="cx"> 
</span><span class="cx">     // We only want stylesheet loads to trigger script execution if script
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCorehtmlparserHTMLScriptRunnerHosth"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/html/parser/HTMLScriptRunnerHost.h (205601 => 205602)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/html/parser/HTMLScriptRunnerHost.h        2016-09-08 07:57:23 UTC (rev 205601)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/html/parser/HTMLScriptRunnerHost.h        2016-09-08 07:58:55 UTC (rev 205602)
</span><span class="lines">@@ -30,9 +30,9 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class CachedResource;
</del><span class="cx"> class Element;
</span><span class="cx"> class HTMLInputStream;
</span><ins>+class PendingScript;
</ins><span class="cx"> class ScriptSourceCode;
</span><span class="cx"> 
</span><span class="cx"> class HTMLScriptRunnerHost {
</span><span class="lines">@@ -40,9 +40,9 @@
</span><span class="cx">     virtual ~HTMLScriptRunnerHost() { }
</span><span class="cx"> 
</span><span class="cx">     // Implementors should call cachedResource-&gt;addClient() here or soon after.
</span><del>-    virtual void watchForLoad(CachedResource*) = 0;
</del><ins>+    virtual void watchForLoad(PendingScript&amp;) = 0;
</ins><span class="cx">     // Implementors must call cachedResource-&gt;removeClient() immediately.
</span><del>-    virtual void stopWatchingForLoad(CachedResource*) = 0;
</del><ins>+    virtual void stopWatchingForLoad(PendingScript&amp;) = 0;
</ins><span class="cx"> 
</span><span class="cx">     virtual HTMLInputStream&amp; inputStream() = 0;
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>