<!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>[214369] trunk</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/214369">214369</a></dd>
<dt>Author</dt> <dd>ryanhaddad@apple.com</dd>
<dt>Date</dt> <dd>2017-03-24 13:39:22 -0700 (Fri, 24 Mar 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Unreviewed, rolling out <a href="http://trac.webkit.org/projects/webkit/changeset/214360">r214360</a>.

This change caused 20+ LayoutTest failures.

Reverted changeset:

&quot;Handle recursive calls to
ProcessingInstruction::checkStyleSheet&quot;
https://bugs.webkit.org/show_bug.cgi?id=169982
http://trac.webkit.org/changeset/214360</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomProcessingInstructioncpp">trunk/Source/WebCore/dom/ProcessingInstruction.cpp</a></li>
<li><a href="#trunkSourceWebCoredomProcessingInstructionh">trunk/Source/WebCore/dom/ProcessingInstruction.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLLinkElementcpp">trunk/Source/WebCore/html/HTMLLinkElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLLinkElementh">trunk/Source/WebCore/html/HTMLLinkElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementcpp">trunk/Source/WebCore/html/HTMLMediaElement.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderImageLoadercpp">trunk/Source/WebCore/loader/ImageLoader.cpp</a></li>
<li><a href="#trunkSourceWebCorestyleStyleScopecpp">trunk/Source/WebCore/style/StyleScope.cpp</a></li>
<li><a href="#trunkSourceWebCorestyleStyleScopeh">trunk/Source/WebCore/style/StyleScope.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastdombeforeloadimageremovedduringbeforeloadexpectedtxt">trunk/LayoutTests/fast/dom/beforeload/image-removed-during-before-load-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdombeforeloadimageremovedduringbeforeloadhtml">trunk/LayoutTests/fast/dom/beforeload/image-removed-during-before-load.html</a></li>
<li><a href="#trunkLayoutTestsfastdombeforeloadrecursivecsspibeforeloadexpectedtxt">trunk/LayoutTests/fast/dom/beforeload/recursive-css-pi-before-load-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdombeforeloadrecursivecsspibeforeloadhtml">trunk/LayoutTests/fast/dom/beforeload/recursive-css-pi-before-load.html</a></li>
<li><a href="#trunkLayoutTestsfastdombeforeloadrecursivelinkbeforeloadexpectedtxt">trunk/LayoutTests/fast/dom/beforeload/recursive-link-before-load-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdombeforeloadrecursivelinkbeforeloadhtml">trunk/LayoutTests/fast/dom/beforeload/recursive-link-before-load.html</a></li>
<li><a href="#trunkLayoutTestsfastdombeforeloadrecursivexslpibeforeloadexpectedtxt">trunk/LayoutTests/fast/dom/beforeload/recursive-xsl-pi-before-load-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdombeforeloadrecursivexslpibeforeloadhtml">trunk/LayoutTests/fast/dom/beforeload/recursive-xsl-pi-before-load.html</a></li>
<li><a href="#trunkLayoutTestsfastdombeforeloadresourcescontentxhtml">trunk/LayoutTests/fast/dom/beforeload/resources/content.xhtml</a></li>
<li><a href="#trunkLayoutTestsfastdombeforeloadresourcespasscss">trunk/LayoutTests/fast/dom/beforeload/resources/pass.css</a></li>
<li><a href="#trunkLayoutTestsfastdombeforeloadresourcestestxsl">trunk/LayoutTests/fast/dom/beforeload/resources/test.xsl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (214368 => 214369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2017-03-24 19:43:42 UTC (rev 214368)
+++ trunk/LayoutTests/ChangeLog        2017-03-24 20:39:22 UTC (rev 214369)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2017-03-24  Ryan Haddad  &lt;ryanhaddad@apple.com&gt;
+
+        Unreviewed, rolling out r214360.
+
+        This change caused 20+ LayoutTest failures.
+
+        Reverted changeset:
+
+        &quot;Handle recursive calls to
+        ProcessingInstruction::checkStyleSheet&quot;
+        https://bugs.webkit.org/show_bug.cgi?id=169982
+        http://trac.webkit.org/changeset/214360
+
</ins><span class="cx"> 2017-03-24  Youenn Fablet  &lt;youenn@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Add support for qpSum in WebRTC stats
</span></span></pre></div>
<a id="trunkLayoutTestsfastdombeforeloadimageremovedduringbeforeloadexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/fast/dom/beforeload/image-removed-during-before-load-expected.txt (214368 => 214369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/beforeload/image-removed-during-before-load-expected.txt        2017-03-24 19:43:42 UTC (rev 214368)
+++ trunk/LayoutTests/fast/dom/beforeload/image-removed-during-before-load-expected.txt        2017-03-24 20:39:22 UTC (rev 214369)
</span><span class="lines">@@ -1,5 +0,0 @@
</span><del>-This test confirms that image loading properly handles a 'beforeload' events that removes the image from the document. It passes if no debug assertions are fired.
-
-PASS: Hit the beforeload handler
-PASS
-PASS: No assertions hit.
</del></span></pre></div>
<a id="trunkLayoutTestsfastdombeforeloadimageremovedduringbeforeloadhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/fast/dom/beforeload/image-removed-during-before-load.html (214368 => 214369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/beforeload/image-removed-during-before-load.html        2017-03-24 19:43:42 UTC (rev 214368)
+++ trunk/LayoutTests/fast/dom/beforeload/image-removed-during-before-load.html        2017-03-24 20:39:22 UTC (rev 214369)
</span><span class="lines">@@ -1,42 +0,0 @@
</span><del>-&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
-&lt;head&gt;
-&lt;script src=&quot;resources/print.js&quot;&gt;&lt;/script&gt;
-&lt;script&gt;
-function test()
-{
-    if (window.testRunner) {
-        testRunner.dumpAsText();
-        testRunner.waitUntilDone();
-    }
-
-        image = document.createElement(&quot;img&quot;);
-    image.setAttribute(&quot;style&quot;, &quot;display:none&quot;);
-        image.addEventListener(&quot;load&quot;, function() {
-        print('PASS', 'green');
-    }, { once: true });
-        image.addEventListener(&quot;beforeload&quot;, function() {
-        print('PASS: Hit the beforeload handler', 'green');
-        document.body.removeChild(image);
-        image = null;
-                setTimeout(step2, 0);
-        }, { once: true });
-        
-        document.body.appendChild(image);
-
-        image.setAttribute(&quot;src&quot;, &quot;../../images/resources/test-load.jpg&quot;);
-}
-
-function step2()
-{
-    print(&quot;PASS: No assertions hit.&quot;, &quot;green&quot;);
-
-    if (window.testRunner)
-        testRunner.notifyDone();
-}
-&lt;/script&gt;
-&lt;/head&gt;
-&lt;body onload=&quot;test()&quot;&gt;
-&lt;p&gt;This test confirms that image loading properly handles a 'beforeload' events that removes the image from the document. It passes if no debug assertions are fired.&lt;/p&gt;
-&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkLayoutTestsfastdombeforeloadrecursivecsspibeforeloadexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/fast/dom/beforeload/recursive-css-pi-before-load-expected.txt (214368 => 214369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/beforeload/recursive-css-pi-before-load-expected.txt        2017-03-24 19:43:42 UTC (rev 214368)
+++ trunk/LayoutTests/fast/dom/beforeload/recursive-css-pi-before-load-expected.txt        2017-03-24 20:39:22 UTC (rev 214369)
</span><span class="lines">@@ -1,4 +0,0 @@
</span><del>-This test confirms that CSS stylesheets are properly handled if loaded during 'beforeload' events. It passes if no debug assertions are fired.
-
-PASS: No assertions hit.
-
</del></span></pre></div>
<a id="trunkLayoutTestsfastdombeforeloadrecursivecsspibeforeloadhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/fast/dom/beforeload/recursive-css-pi-before-load.html (214368 => 214369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/beforeload/recursive-css-pi-before-load.html        2017-03-24 19:43:42 UTC (rev 214368)
+++ trunk/LayoutTests/fast/dom/beforeload/recursive-css-pi-before-load.html        2017-03-24 20:39:22 UTC (rev 214369)
</span><span class="lines">@@ -1,45 +0,0 @@
</span><del>-&lt;!DOCTYPE html&gt;
-&lt;html lang=&quot;en&quot;&gt;
-&lt;head&gt;
-&lt;meta charset=&quot;utf-8&quot;/&gt;
-&lt;meta http-equiv=&quot;pragma&quot; content=&quot;no-cache&quot;/&gt;
-&lt;meta http-equiv=&quot;expires&quot; content=&quot;0&quot;/&gt;
-&lt;script src=&quot;resources/print.js&quot;&gt;&lt;/script&gt;
-&lt;script&gt;
-function test()
-{
-    if (window.testRunner) {
-        testRunner.dumpAsText();
-        testRunner.waitUntilDone();
-    }
-
-        frame = document.createElement(&quot;iframe&quot;);
-        frame.setAttribute(&quot;src&quot;, &quot;resources/content.xhtml&quot;);
-        frame.addEventListener(&quot;load&quot;, function(){
-                setTimeout(step2, 0);
-        }, { once: true });
-        
-        document.body.appendChild(frame);
-        
-        function step2(){
-                ins = 'href=&quot;pass.css&quot; type=&quot;text/css&quot;';
-                pi = frame.contentDocument.createProcessingInstruction('xml-stylesheet', ins);
-                pi.addEventListener(&quot;beforeload&quot;, function(){ pi.data = 'href=&quot;fail.css&quot; type=&quot;text/css&quot;'; }, { once: true });
-                frame.contentDocument.insertBefore(pi, frame.contentDocument.firstChild);
-                
-                frame.contentDocument.removeChild(pi);
-                pi = null;
-
-        print(&quot;PASS: No assertions hit.&quot;, &quot;green&quot;);
-
-        if (window.testRunner)
-            testRunner.notifyDone();
-        }
-}
-&lt;/script&gt;
-&lt;/head&gt;
-&lt;body onload=&quot;test()&quot;&gt;
-&lt;p&gt;This test confirms that CSS stylesheets are properly handled if loaded during 'beforeload' events. It passes if no debug assertions are fired.&lt;/p&gt;
-&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkLayoutTestsfastdombeforeloadrecursivelinkbeforeloadexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/fast/dom/beforeload/recursive-link-before-load-expected.txt (214368 => 214369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/beforeload/recursive-link-before-load-expected.txt        2017-03-24 19:43:42 UTC (rev 214368)
+++ trunk/LayoutTests/fast/dom/beforeload/recursive-link-before-load-expected.txt        2017-03-24 20:39:22 UTC (rev 214369)
</span><span class="lines">@@ -1,5 +0,0 @@
</span><del>-This test confirms that link elements properly handled changes during 'beforeload' events. It passes if no debug assertions are fired.
-
-PASS: Beforeload handled.
-PASS: No assertions hit.
-
</del></span></pre></div>
<a id="trunkLayoutTestsfastdombeforeloadrecursivelinkbeforeloadhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/fast/dom/beforeload/recursive-link-before-load.html (214368 => 214369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/beforeload/recursive-link-before-load.html        2017-03-24 19:43:42 UTC (rev 214368)
+++ trunk/LayoutTests/fast/dom/beforeload/recursive-link-before-load.html        2017-03-24 20:39:22 UTC (rev 214369)
</span><span class="lines">@@ -1,61 +0,0 @@
</span><del>-&lt;!DOCTYPE html&gt;
-&lt;html lang=&quot;en&quot;&gt;
-&lt;head&gt;
-&lt;meta charset=&quot;utf-8&quot;/&gt;
-&lt;meta http-equiv=&quot;pragma&quot; content=&quot;no-cache&quot;/&gt;
-&lt;meta http-equiv=&quot;expires&quot; content=&quot;0&quot;/&gt;
-&lt;script src=&quot;resources/print.js&quot;&gt;&lt;/script&gt;
-&lt;script&gt;
-function test()
-{
-    if (window.testRunner) {
-        testRunner.dumpAsText();
-        testRunner.waitUntilDone();
-    }
-
-        frame = document.createElement(&quot;iframe&quot;);
-        frame.setAttribute(&quot;src&quot;, &quot;resources/content.xhtml&quot;);
-        frame.addEventListener(&quot;load&quot;, function(){
-                setTimeout(step2, 0);
-        }, { once: true });
-        
-        document.body.appendChild(frame);
-
-    var link;
-    var head;
-
-        function step2() {
-        head = frame.contentDocument.getElementsByTagName('head')[0];
-
-                link = frame.contentDocument.createElement('link');
-        link.type = 'text/css';
-        link.rel = 'stylesheet';
-    
-                link.addEventListener(&quot;beforeload&quot;, function() {
-            print(&quot;PASS: Beforeload handled.&quot;, &quot;green&quot;);
-            link.href = 'fail.css';
-            setTimeout(step3, 0);
-        }, { once: true });
-
-        link.href = 'pass.css';
-
-        head.appendChild(link);
-        }
-
-    function step3() {                
-                head.removeChild(link);
-                link = null;
-
-        print(&quot;PASS: No assertions hit.&quot;, &quot;green&quot;);
-
-        if (window.testRunner)
-            testRunner.notifyDone();
-    }
-}
-&lt;/script&gt;
-&lt;/head&gt;
-&lt;body onload=&quot;test()&quot;&gt;
-&lt;p&gt;This test confirms that link elements properly handled changes during 'beforeload' events. It passes if no debug assertions are fired.&lt;/p&gt;
-&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkLayoutTestsfastdombeforeloadrecursivexslpibeforeloadexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/fast/dom/beforeload/recursive-xsl-pi-before-load-expected.txt (214368 => 214369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/beforeload/recursive-xsl-pi-before-load-expected.txt        2017-03-24 19:43:42 UTC (rev 214368)
+++ trunk/LayoutTests/fast/dom/beforeload/recursive-xsl-pi-before-load-expected.txt        2017-03-24 20:39:22 UTC (rev 214369)
</span><span class="lines">@@ -1,4 +0,0 @@
</span><del>-This test confirms that XSL stylesheets are properly handled if loaded during 'beforeload' events. It passes if no debug assertions are fired.
-
-PASS: No assertions hit.
-
</del></span></pre></div>
<a id="trunkLayoutTestsfastdombeforeloadrecursivexslpibeforeloadhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/fast/dom/beforeload/recursive-xsl-pi-before-load.html (214368 => 214369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/beforeload/recursive-xsl-pi-before-load.html        2017-03-24 19:43:42 UTC (rev 214368)
+++ trunk/LayoutTests/fast/dom/beforeload/recursive-xsl-pi-before-load.html        2017-03-24 20:39:22 UTC (rev 214369)
</span><span class="lines">@@ -1,45 +0,0 @@
</span><del>-&lt;!DOCTYPE html&gt;
-&lt;html lang=&quot;en&quot;&gt;
-&lt;head&gt;
-&lt;meta charset=&quot;utf-8&quot;/&gt;
-&lt;meta http-equiv=&quot;pragma&quot; content=&quot;no-cache&quot;/&gt;
-&lt;meta http-equiv=&quot;expires&quot; content=&quot;0&quot;/&gt;
-&lt;script src=&quot;resources/print.js&quot;&gt;&lt;/script&gt;
-&lt;script&gt;
-function test()
-{
-    if (window.testRunner) {
-        testRunner.dumpAsText();
-        testRunner.waitUntilDone();
-    }
-
-        frame = document.createElement(&quot;iframe&quot;);
-        frame.setAttribute(&quot;src&quot;, &quot;resources/content.xhtml&quot;);
-        frame.addEventListener(&quot;load&quot;, function(){
-                setTimeout(step2, 0);
-        }, { once: true });
-        
-        document.body.appendChild(frame);
-        
-        function step2(){
-                ins = 'href=&quot;test.xsl?a=1&quot; type=&quot;text/xsl&quot;';
-                pi = frame.contentDocument.createProcessingInstruction('xml-stylesheet', ins);
-                pi.addEventListener(&quot;beforeload&quot;, function(){ pi.data = 'href=&quot;test.xsl?b=1&quot; type=&quot;text/xsl&quot;'; }, { once: true });
-                frame.contentDocument.insertBefore(pi, frame.contentDocument.firstChild);
-                
-                frame.contentDocument.removeChild(pi);
-                pi = null;
-
-        print(&quot;PASS: No assertions hit.&quot;, &quot;green&quot;);
-
-        if (window.testRunner)
-            testRunner.notifyDone();
-        }
-}
-&lt;/script&gt;
-&lt;/head&gt;
-&lt;body onload=&quot;test()&quot;&gt;
-&lt;p&gt;This test confirms that XSL stylesheets are properly handled if loaded during 'beforeload' events. It passes if no debug assertions are fired.&lt;/p&gt;
-&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkLayoutTestsfastdombeforeloadresourcescontentxhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/fast/dom/beforeload/resources/content.xhtml (214368 => 214369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/beforeload/resources/content.xhtml        2017-03-24 19:43:42 UTC (rev 214368)
+++ trunk/LayoutTests/fast/dom/beforeload/resources/content.xhtml        2017-03-24 20:39:22 UTC (rev 214369)
</span><span class="lines">@@ -1,8 +0,0 @@
</span><del>-&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Frameset//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd&quot;&gt;
-&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
-&lt;head&gt;
-&lt;/head&gt;
-&lt;body&gt;
-hi
-&lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkLayoutTestsfastdombeforeloadresourcespasscss"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/fast/dom/beforeload/resources/pass.css (214368 => 214369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/beforeload/resources/pass.css        2017-03-24 19:43:42 UTC (rev 214368)
+++ trunk/LayoutTests/fast/dom/beforeload/resources/pass.css        2017-03-24 20:39:22 UTC (rev 214369)
</span><span class="lines">@@ -1,5 +0,0 @@
</span><del>-.block {
-  width: 100px;
-  height: 100px;
-  background-color: green;
-}
</del></span></pre></div>
<a id="trunkLayoutTestsfastdombeforeloadresourcestestxsl"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/fast/dom/beforeload/resources/test.xsl (214368 => 214369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/beforeload/resources/test.xsl        2017-03-24 19:43:42 UTC (rev 214368)
+++ trunk/LayoutTests/fast/dom/beforeload/resources/test.xsl        2017-03-24 20:39:22 UTC (rev 214369)
</span><span class="lines">@@ -1,14 +0,0 @@
</span><del>-&lt;?xml version=&quot;1.0&quot;?&gt;
-&lt;xsl:stylesheet version=&quot;1.0&quot;
-        xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;&gt;
-        &lt;xsl:output method=&quot;html&quot;/&gt;        
-        &lt;xsl:template match=&quot;/&quot;&gt;
-        &lt;html&gt;
-        &lt;head&gt;
-        &lt;/head&gt;
-        &lt;body&gt;
-            Test
-        &lt;/body&gt;
-        &lt;/html&gt;
-        &lt;/xsl:template&gt;
-&lt;/xsl:stylesheet&gt;
</del></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (214368 => 214369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-03-24 19:43:42 UTC (rev 214368)
+++ trunk/Source/WebCore/ChangeLog        2017-03-24 20:39:22 UTC (rev 214369)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2017-03-24  Ryan Haddad  &lt;ryanhaddad@apple.com&gt;
+
+        Unreviewed, rolling out r214360.
+
+        This change caused 20+ LayoutTest failures.
+
+        Reverted changeset:
+
+        &quot;Handle recursive calls to
+        ProcessingInstruction::checkStyleSheet&quot;
+        https://bugs.webkit.org/show_bug.cgi?id=169982
+        http://trac.webkit.org/changeset/214360
+
</ins><span class="cx"> 2017-03-24  Youenn Fablet  &lt;youenn@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Add support for qpSum in WebRTC stats
</span></span></pre></div>
<a id="trunkSourceWebCoredomProcessingInstructioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ProcessingInstruction.cpp (214368 => 214369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ProcessingInstruction.cpp        2017-03-24 19:43:42 UTC (rev 214368)
+++ trunk/Source/WebCore/dom/ProcessingInstruction.cpp        2017-03-24 20:39:22 UTC (rev 214369)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2000 Peter Kelly (pmk@post.com)
</span><del>- * Copyright (C) 2006-2017 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2006, 2008, 2009 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2013 Samsung Electronics. All rights reserved.
</span><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="lines">@@ -35,7 +35,6 @@
</span><span class="cx"> #include &quot;StyleSheetContents.h&quot;
</span><span class="cx"> #include &quot;XMLDocumentParser.h&quot;
</span><span class="cx"> #include &quot;XSLStyleSheet.h&quot;
</span><del>-#include &lt;wtf/SetForScope.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -81,10 +80,6 @@
</span><span class="cx"> 
</span><span class="cx"> void ProcessingInstruction::checkStyleSheet()
</span><span class="cx"> {
</span><del>-    // Prevent recursive loading of stylesheet.
-    if (m_isHandlingBeforeLoad)
-        return;
-
</del><span class="cx">     if (m_target == &quot;xml-stylesheet&quot; &amp;&amp; document().frame() &amp;&amp; parentNode() == &amp;document()) {
</span><span class="cx">         // see http://www.w3.org/TR/xml-stylesheet/
</span><span class="cx">         // ### support stylesheet included in a fragment of this (or another) document
</span><span class="lines">@@ -139,25 +134,13 @@
</span><span class="cx">                 document().styleScope().removePendingSheet(*this);
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            Ref&lt;Document&gt; originalDocument = document();
-
</del><span class="cx">             String url = document().completeURL(href).string();
</span><del>-
-            {
-            SetForScope&lt;bool&gt; change(m_isHandlingBeforeLoad, true);
</del><span class="cx">             if (!dispatchBeforeLoadEvent(url))
</span><span class="cx">                 return;
</span><del>-            }
</del><span class="cx"> 
</span><del>-            bool didEventListenerDisconnectThisElement = !isConnected() || &amp;document() != originalDocument.ptr();
-            if (didEventListenerDisconnectThisElement)
-                return;
-            
</del><span class="cx">             m_loading = true;
</span><span class="cx">             document().styleScope().addPendingSheet(*this);
</span><span class="cx"> 
</span><del>-            ASSERT_WITH_SECURITY_IMPLICATION(!m_cachedSheet);
-
</del><span class="cx"> #if ENABLE(XSLT)
</span><span class="cx">             if (m_isXSL) {
</span><span class="cx">                 auto options = CachedResourceLoader::defaultCachedResourceOptions();
</span><span class="lines">@@ -198,8 +181,7 @@
</span><span class="cx"> bool ProcessingInstruction::sheetLoaded()
</span><span class="cx"> {
</span><span class="cx">     if (!isLoading()) {
</span><del>-        if (document().styleScope().hasPendingSheet(*this))
-            document().styleScope().removePendingSheet(*this);
</del><ins>+        document().styleScope().removePendingSheet(*this);
</ins><span class="cx"> #if ENABLE(XSLT)
</span><span class="cx">         if (m_isXSL)
</span><span class="cx">             document().styleScope().flushPendingUpdate();
</span><span class="lines">@@ -229,7 +211,6 @@
</span><span class="cx">     // We don't need the cross-origin security check here because we are
</span><span class="cx">     // getting the sheet text in &quot;strict&quot; mode. This enforces a valid CSS MIME
</span><span class="cx">     // type.
</span><del>-    Ref&lt;Document&gt; protect(document());
</del><span class="cx">     parseStyleSheet(sheet-&gt;sheetText());
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomProcessingInstructionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ProcessingInstruction.h (214368 => 214369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ProcessingInstruction.h        2017-03-24 19:43:42 UTC (rev 214368)
+++ trunk/Source/WebCore/dom/ProcessingInstruction.h        2017-03-24 20:39:22 UTC (rev 214369)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2000 Peter Kelly (pmk@post.com)
</span><del>- * Copyright (C) 2006-2017 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2006 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2013 Samsung Electronics. All rights reserved.
</span><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="lines">@@ -74,8 +74,6 @@
</span><span class="cx"> 
</span><span class="cx">     void parseStyleSheet(const String&amp; sheet);
</span><span class="cx"> 
</span><del>-    void clearExistingCachedSheet();
-
</del><span class="cx">     String m_target;
</span><span class="cx">     String m_localHref;
</span><span class="cx">     String m_title;
</span><span class="lines">@@ -89,7 +87,6 @@
</span><span class="cx"> #if ENABLE(XSLT)
</span><span class="cx">     bool m_isXSL { false };
</span><span class="cx"> #endif
</span><del>-    bool m_isHandlingBeforeLoad { false };
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLLinkElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLLinkElement.cpp (214368 => 214369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLLinkElement.cpp        2017-03-24 19:43:42 UTC (rev 214368)
+++ trunk/Source/WebCore/html/HTMLLinkElement.cpp        2017-03-24 20:39:22 UTC (rev 214369)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx">  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
</span><span class="cx">  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><span class="cx">  *           (C) 2001 Dirk Mueller (mueller@kde.org)
</span><del>- * Copyright (C) 2003-2017 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010, 2014 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2009 Rob Buis (rwlbuis@gmail.com)
</span><span class="cx">  * Copyright (C) 2011 Google Inc. All rights reserved.
</span><span class="cx">  *
</span><span class="lines">@@ -55,7 +55,6 @@
</span><span class="cx"> #include &quot;StyleScope.h&quot;
</span><span class="cx"> #include &quot;StyleSheetContents.h&quot;
</span><span class="cx"> #include &lt;wtf/Ref.h&gt;
</span><del>-#include &lt;wtf/SetForScope.h&gt;
</del><span class="cx"> #include &lt;wtf/StdLibExtras.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -225,10 +224,6 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    // Prevent recursive loading of link.
-    if (m_isHandlingBeforeLoad)
-        return;
-
</del><span class="cx">     URL url = getNonEmptyURLAttribute(hrefAttr);
</span><span class="cx"> 
</span><span class="cx">     if (!m_linkLoader.loadLink(m_relAttribute, url, attributeWithoutSynchronization(asAttr), attributeWithoutSynchronization(crossoriginAttr), document()))
</span><span class="lines">@@ -248,11 +243,8 @@
</span><span class="cx">             m_cachedSheet = nullptr;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        {
-        SetForScope&lt;bool&gt; change(m_isHandlingBeforeLoad, true);
</del><span class="cx">         if (!shouldLoadLink())
</span><span class="cx">             return;
</span><del>-        }
</del><span class="cx"> 
</span><span class="cx">         m_loading = true;
</span><span class="cx"> 
</span><span class="lines">@@ -285,7 +277,6 @@
</span><span class="cx"> 
</span><span class="cx">         request.setAsPotentiallyCrossOrigin(crossOrigin(), document());
</span><span class="cx"> 
</span><del>-        ASSERT_WITH_SECURITY_IMPLICATION(!m_cachedSheet);
</del><span class="cx">         m_cachedSheet = document().cachedResourceLoader().requestCSSStyleSheet(WTFMove(request));
</span><span class="cx"> 
</span><span class="cx">         if (m_cachedSheet)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLLinkElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLLinkElement.h (214368 => 214369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLLinkElement.h        2017-03-24 19:43:42 UTC (rev 214368)
+++ trunk/Source/WebCore/html/HTMLLinkElement.h        2017-03-24 20:39:22 UTC (rev 214369)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
</span><span class="cx">  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><del>- * Copyright (C) 2003-2017 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2003, 2008, 2010 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2011 Google Inc. All rights reserved.
</span><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="lines">@@ -132,7 +132,6 @@
</span><span class="cx">     bool m_createdByParser;
</span><span class="cx">     bool m_firedLoad;
</span><span class="cx">     bool m_loadedResource;
</span><del>-    bool m_isHandlingBeforeLoad { false };
</del><span class="cx"> 
</span><span class="cx">     PendingSheetType m_pendingSheetType;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (214368 => 214369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.cpp        2017-03-24 19:43:42 UTC (rev 214368)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp        2017-03-24 20:39:22 UTC (rev 214369)
</span><span class="lines">@@ -1325,8 +1325,6 @@
</span><span class="cx"> 
</span><span class="cx">         enum Mode { None, Object, Attribute, Children };
</span><span class="cx">         Mode mode = None;
</span><del>-        Ref&lt;Document&gt; originalDocument = document();
-        bool didEventListenerDisconnectThisElement = false;
</del><span class="cx"> 
</span><span class="cx">         if (m_mediaProvider) {
</span><span class="cx">             // 6. If the media element has an assigned media provider object, then let mode be object.
</span><span class="lines">@@ -1410,13 +1408,6 @@
</span><span class="cx">                 return;
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            didEventListenerDisconnectThisElement = !isConnected() || &amp;document() != originalDocument.ptr();
-            if (didEventListenerDisconnectThisElement) {
-                mediaLoadingFailed(MediaPlayer::FormatError);
-                LOG(Media, &quot;HTMLMediaElement::selectMediaResource(%p) -  document changed during load.&quot;, this);
-                return;
-            }
-
</del><span class="cx">             // 3. If absolute URL was obtained successfully, set the currentSrc attribute to absolute URL.
</span><span class="cx">             m_currentSrc = absoluteURL;
</span><span class="cx"> 
</span><span class="lines">@@ -4224,12 +4215,10 @@
</span><span class="cx"> 
</span><span class="cx">     URL mediaURL;
</span><span class="cx">     HTMLSourceElement* source = nullptr;
</span><del>-    Ref&lt;Document&gt; originalDocument = document();
</del><span class="cx">     String type;
</span><span class="cx">     bool lookingForStartNode = m_nextChildNodeToConsider;
</span><span class="cx">     bool canUseSourceElement = false;
</span><del>-    bool okToLoadSourceURL = false;
-    bool didEventListenerDisconnectThisElement = false;
</del><ins>+    bool okToLoadSourceURL;
</ins><span class="cx"> 
</span><span class="cx">     NodeVector potentialSourceNodes;
</span><span class="cx">     getChildNodes(*this, potentialSourceNodes);
</span><span class="lines">@@ -4302,13 +4291,6 @@
</span><span class="cx">             goto CheckAgain;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        didEventListenerDisconnectThisElement = !isConnected() || &amp;document() != originalDocument.ptr();
-        if (didEventListenerDisconnectThisElement) {
-            LOG(Media, &quot;HTMLMediaElement::selectNextSourceChild(%p) - 'beforeload' changed document during load.&quot;, this);
-            source = nullptr;
-            goto CheckAgain;
-        }
-
</del><span class="cx">         if (!okToLoadSourceURL)
</span><span class="cx">             goto CheckAgain;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderImageLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/ImageLoader.cpp (214368 => 214369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ImageLoader.cpp        2017-03-24 19:43:42 UTC (rev 214368)
+++ trunk/Source/WebCore/loader/ImageLoader.cpp        2017-03-24 20:39:22 UTC (rev 214369)
</span><span class="lines">@@ -394,12 +394,7 @@
</span><span class="cx">     if (!element().document().hasLivingRenderTree())
</span><span class="cx">         return;
</span><span class="cx">     m_hasPendingBeforeLoadEvent = false;
</span><del>-    Ref&lt;Document&gt; originalDocument = element().document();
</del><span class="cx">     if (element().dispatchBeforeLoadEvent(m_image-&gt;url())) {
</span><del>-        bool didEventListenerDisconnectThisElement = !element().isConnected() || &amp;element().document() != originalDocument.ptr();
-        if (didEventListenerDisconnectThisElement)
-            return;
-        
</del><span class="cx">         updateRenderer();
</span><span class="cx">         return;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorestyleStyleScopecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/StyleScope.cpp (214368 => 214369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/StyleScope.cpp        2017-03-24 19:43:42 UTC (rev 214368)
+++ trunk/Source/WebCore/style/StyleScope.cpp        2017-03-24 20:39:22 UTC (rev 214369)
</span><span class="lines">@@ -3,7 +3,7 @@
</span><span class="cx">  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><span class="cx">  *           (C) 2001 Dirk Mueller (mueller@kde.org)
</span><span class="cx">  *           (C) 2006 Alexey Proskuryakov (ap@webkit.org)
</span><del>- * Copyright (C) 2004-2009, 2011-2012, 2015-2017 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2009, 2011-2012, 2015-2016 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
</span><span class="cx">  * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
</span><span class="cx">  * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
</span><span class="lines">@@ -233,11 +233,6 @@
</span><span class="cx">     return m_elementsInBodyWithPendingSheets.contains(&amp;element);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool Scope::hasPendingSheet(const ProcessingInstruction&amp; processingInstruction) const
-{
-    return m_processingInstructionsWithPendingSheets.contains(&amp;processingInstruction);
-}
-
</del><span class="cx"> void Scope::addStyleSheetCandidateNode(Node&amp; node, bool createdByParser)
</span><span class="cx"> {
</span><span class="cx">     if (!node.isConnected())
</span></span></pre></div>
<a id="trunkSourceWebCorestyleStyleScopeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/StyleScope.h (214368 => 214369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/StyleScope.h        2017-03-24 19:43:42 UTC (rev 214368)
+++ trunk/Source/WebCore/style/StyleScope.h        2017-03-24 20:39:22 UTC (rev 214369)
</span><span class="lines">@@ -3,7 +3,7 @@
</span><span class="cx">  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><span class="cx">  *           (C) 2001 Dirk Mueller (mueller@kde.org)
</span><span class="cx">  *           (C) 2006 Alexey Proskuryakov (ap@webkit.org)
</span><del>- * Copyright (C) 2004-2010, 2012-2013, 2015-2017 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2010, 2012-2013, 2015-2016 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
</span><span class="cx">  * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
</span><span class="cx">  * Copyright (C) 2011 Google Inc. All rights reserved.
</span><span class="lines">@@ -92,7 +92,6 @@
</span><span class="cx">     bool hasPendingSheetsInBody() const;
</span><span class="cx">     bool hasPendingSheet(const Element&amp;) const;
</span><span class="cx">     bool hasPendingSheetInBody(const Element&amp;) const;
</span><del>-    bool hasPendingSheet(const ProcessingInstruction&amp;) const;
</del><span class="cx"> 
</span><span class="cx">     bool usesStyleBasedEditability() { return m_usesStyleBasedEditability; }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>