<!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>[214322] 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/214322">214322</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2017-03-23 15:40:50 -0700 (Thu, 23 Mar 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>SVG animations are not paused when inserted into a hidden page
https://bugs.webkit.org/show_bug.cgi?id=170026
&lt;rdar://problem/31228704&gt;

Reviewed by Andreas Kling.

Source/WebCore:

SVG animations were not paused when inserted into a hidden page. We would pause
animations in a page when the page becomes hidden. However, new animations
inserted in the page after this point would start, despite the page being
hidden.

Tests:
- svg/animations/animations-paused-when-inserted-in-hidden-document.html
- svg/animations/animations-paused-when-inserted-in-hidden-document2.html

* dom/Document.cpp:
(WebCore::Document::accessSVGExtensions):
* svg/SVGDocumentExtensions.cpp:
(WebCore::SVGDocumentExtensions::SVGDocumentExtensions):
(WebCore::SVGDocumentExtensions::addTimeContainer):
(WebCore::reportMessage):
* svg/SVGDocumentExtensions.h:
* testing/Internals.cpp:
(WebCore::Internals::areSVGAnimationsPaused):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

Add layout test coverage.

* svg/animations/animations-paused-when-inserted-in-hidden-document-expected.txt: Added.
* svg/animations/animations-paused-when-inserted-in-hidden-document.html: Added.
* svg/animations/animations-paused-when-inserted-in-hidden-document2-expected.txt: Added.
* svg/animations/animations-paused-when-inserted-in-hidden-document2.html: Added.</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="#trunkSourceWebCoredomDocumentcpp">trunk/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGDocumentExtensionscpp">trunk/Source/WebCore/svg/SVGDocumentExtensions.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGDocumentExtensionsh">trunk/Source/WebCore/svg/SVGDocumentExtensions.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalscpp">trunk/Source/WebCore/testing/Internals.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalsh">trunk/Source/WebCore/testing/Internals.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalsidl">trunk/Source/WebCore/testing/Internals.idl</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestssvganimationsanimationspausedwheninsertedinhiddendocumentexpectedtxt">trunk/LayoutTests/svg/animations/animations-paused-when-inserted-in-hidden-document-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvganimationsanimationspausedwheninsertedinhiddendocumenthtml">trunk/LayoutTests/svg/animations/animations-paused-when-inserted-in-hidden-document.html</a></li>
<li><a href="#trunkLayoutTestssvganimationsanimationspausedwheninsertedinhiddendocument2expectedtxt">trunk/LayoutTests/svg/animations/animations-paused-when-inserted-in-hidden-document2-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvganimationsanimationspausedwheninsertedinhiddendocument2html">trunk/LayoutTests/svg/animations/animations-paused-when-inserted-in-hidden-document2.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (214321 => 214322)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2017-03-23 22:39:57 UTC (rev 214321)
+++ trunk/LayoutTests/ChangeLog        2017-03-23 22:40:50 UTC (rev 214322)
</span><span class="lines">@@ -1 +1,16 @@
</span><ins>+2017-03-23  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        SVG animations are not paused when inserted into a hidden page
+        https://bugs.webkit.org/show_bug.cgi?id=170026
+        &lt;rdar://problem/31228704&gt;
+
+        Reviewed by Andreas Kling.
+
+        Add layout test coverage.
+
+        * svg/animations/animations-paused-when-inserted-in-hidden-document-expected.txt: Added.
+        * svg/animations/animations-paused-when-inserted-in-hidden-document.html: Added.
+        * svg/animations/animations-paused-when-inserted-in-hidden-document2-expected.txt: Added.
+        * svg/animations/animations-paused-when-inserted-in-hidden-document2.html: Added.
+
</ins><span class="cx"> == Rolled over to ChangeLog-2017-03-23 ==
</span></span></pre></div>
<a id="trunkLayoutTestssvganimationsanimationspausedwheninsertedinhiddendocumentexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/animations/animations-paused-when-inserted-in-hidden-document-expected.txt (0 => 214322)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/animations/animations-paused-when-inserted-in-hidden-document-expected.txt                                (rev 0)
+++ trunk/LayoutTests/svg/animations/animations-paused-when-inserted-in-hidden-document-expected.txt        2017-03-23 22:40:50 UTC (rev 214322)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+Tests that SVG animations are properly paused in iframes that are inserted into hidden pages.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Setting page visibility to hidden
+Inserting frame in document
+PASS frame.contentWindow.internals.areSVGAnimationsPaused is true
+PASS frame.contentDocument.getElementsByTagName('svg')[0].animationsPaused() is true
+PASS grandChildFrame.contentWindow.internals.areSVGAnimationsPaused is true
+PASS grandChildFrame.contentDocument.getElementsByTagName('svg')[0].animationsPaused() is true
+Setting page visibility to visible
+PASS frame.contentWindow.internals.areSVGAnimationsPaused is false
+PASS frame.contentDocument.getElementsByTagName('svg')[0].animationsPaused() is false
+PASS grandChildFrame.contentWindow.internals.areSVGAnimationsPaused is false
+PASS grandChildFrame.contentDocument.getElementsByTagName('svg')[0].animationsPaused() is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestssvganimationsanimationspausedwheninsertedinhiddendocumenthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/animations/animations-paused-when-inserted-in-hidden-document.html (0 => 214322)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/animations/animations-paused-when-inserted-in-hidden-document.html                                (rev 0)
+++ trunk/LayoutTests/svg/animations/animations-paused-when-inserted-in-hidden-document.html        2017-03-23 22:40:50 UTC (rev 214322)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+description(&quot;Tests that SVG animations are properly paused in iframes that are inserted into hidden pages.&quot;);
+jsTestIsAsync = true;
+
+document.addEventListener(&quot;visibilitychange&quot;, function() {
+    if (document.hidden) {
+        frame = document.createElement(&quot;iframe&quot;);
+        frame.onload = function() {
+            setTimeout(function() {
+                shouldBeTrue(&quot;frame.contentWindow.internals.areSVGAnimationsPaused&quot;);
+                shouldBeTrue(&quot;frame.contentDocument.getElementsByTagName('svg')[0].animationsPaused()&quot;);
+                grandChildFrame = frame.contentDocument.getElementById('grandChildFrame');
+                shouldBeTrue(&quot;grandChildFrame.contentWindow.internals.areSVGAnimationsPaused&quot;);
+                shouldBeTrue(&quot;grandChildFrame.contentDocument.getElementsByTagName('svg')[0].animationsPaused()&quot;);
+
+                debug(&quot;Setting page visibility to visible&quot;); 
+                if (window.testRunner)
+                    testRunner.setPageVisibility(&quot;visible&quot;);
+            }, 0);
+        }
+        frame.src = &quot;resources/frame-with-svg-animation.html&quot;;
+        debug(&quot;Inserting frame in document&quot;);
+        document.body.appendChild(frame);
+    } else {
+        shouldBeFalse(&quot;frame.contentWindow.internals.areSVGAnimationsPaused&quot;);
+        shouldBeFalse(&quot;frame.contentDocument.getElementsByTagName('svg')[0].animationsPaused()&quot;);
+        grandChildFrame = frame.contentDocument.getElementById('grandChildFrame');
+        shouldBeFalse(&quot;grandChildFrame.contentWindow.internals.areSVGAnimationsPaused&quot;);
+        shouldBeFalse(&quot;grandChildFrame.contentDocument.getElementsByTagName('svg')[0].animationsPaused()&quot;);
+        finishJSTest();
+    }
+});
+
+window.onload = function() {
+    debug(&quot;Setting page visibility to hidden&quot;);
+    if (window.testRunner)
+        testRunner.setPageVisibility(&quot;hidden&quot;);
+}
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestssvganimationsanimationspausedwheninsertedinhiddendocument2expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/animations/animations-paused-when-inserted-in-hidden-document2-expected.txt (0 => 214322)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/animations/animations-paused-when-inserted-in-hidden-document2-expected.txt                                (rev 0)
+++ trunk/LayoutTests/svg/animations/animations-paused-when-inserted-in-hidden-document2-expected.txt        2017-03-23 22:40:50 UTC (rev 214322)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+Tests that SVG animations are properly paused in iframes that are inserted into hidden pages.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Setting page visibility to hidden
+Inserting SVG animation in the document
+PASS internals.areSVGAnimationsPaused is true
+PASS svgElement.animationsPaused() is true
+Setting page visibility to visible
+PASS internals.areSVGAnimationsPaused is false
+PASS svgElement.animationsPaused() is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestssvganimationsanimationspausedwheninsertedinhiddendocument2html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/animations/animations-paused-when-inserted-in-hidden-document2.html (0 => 214322)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/animations/animations-paused-when-inserted-in-hidden-document2.html                                (rev 0)
+++ trunk/LayoutTests/svg/animations/animations-paused-when-inserted-in-hidden-document2.html        2017-03-23 22:40:50 UTC (rev 214322)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+description(&quot;Tests that SVG animations are properly paused in iframes that are inserted into hidden pages.&quot;);
+jsTestIsAsync = true;
+
+var animationAsText = '&lt;svg width=&quot;300px&quot; height=&quot;100px&quot;&gt;&lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;300&quot; height=&quot;100&quot; stroke=&quot;black&quot; stroke-width=&quot;1&quot; /&gt;&lt;circle cx=&quot;0&quot; cy=&quot;50&quot; r=&quot;15&quot; fill=&quot;blue&quot; stroke=&quot;black&quot; stroke-width=&quot;1&quot;&gt;&lt;animate attributeName=&quot;cx&quot; from=&quot;0&quot; to=&quot;100&quot; dur=&quot;5s&quot; repeatCount=&quot;indefinite&quot; /&gt;&lt;/circle&gt;&lt;/svg&gt;';
+
+document.addEventListener(&quot;visibilitychange&quot;, function() {
+    if (document.hidden) {
+        debug(&quot;Inserting SVG animation in the document&quot;);
+        testDiv.innerHTML = animationAsText;
+        svgElement = document.getElementsByTagName(&quot;svg&quot;)[0];
+        
+        setTimeout(function() {
+            shouldBeTrue(&quot;internals.areSVGAnimationsPaused&quot;);
+            shouldBeTrue(&quot;svgElement.animationsPaused()&quot;);
+
+            debug(&quot;Setting page visibility to visible&quot;); 
+            if (window.testRunner)
+                testRunner.setPageVisibility(&quot;visible&quot;);
+            }, 0);
+    } else {
+        shouldBeFalse(&quot;internals.areSVGAnimationsPaused&quot;);
+        shouldBeFalse(&quot;svgElement.animationsPaused()&quot;);
+        finishJSTest();
+    }
+});
+
+window.onload = function() {
+    debug(&quot;Setting page visibility to hidden&quot;);
+    if (window.testRunner)
+        testRunner.setPageVisibility(&quot;hidden&quot;);
+}
+&lt;/script&gt;
+&lt;div id=&quot;testDiv&quot;&gt;&lt;/div&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (214321 => 214322)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-03-23 22:39:57 UTC (rev 214321)
+++ trunk/Source/WebCore/ChangeLog        2017-03-23 22:40:50 UTC (rev 214322)
</span><span class="lines">@@ -1 +1,30 @@
</span><ins>+2017-03-23  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        SVG animations are not paused when inserted into a hidden page
+        https://bugs.webkit.org/show_bug.cgi?id=170026
+        &lt;rdar://problem/31228704&gt;
+
+        Reviewed by Andreas Kling.
+
+        SVG animations were not paused when inserted into a hidden page. We would pause
+        animations in a page when the page becomes hidden. However, new animations
+        inserted in the page after this point would start, despite the page being
+        hidden.
+
+        Tests:
+        - svg/animations/animations-paused-when-inserted-in-hidden-document.html
+        - svg/animations/animations-paused-when-inserted-in-hidden-document2.html
+
+        * dom/Document.cpp:
+        (WebCore::Document::accessSVGExtensions):
+        * svg/SVGDocumentExtensions.cpp:
+        (WebCore::SVGDocumentExtensions::SVGDocumentExtensions):
+        (WebCore::SVGDocumentExtensions::addTimeContainer):
+        (WebCore::reportMessage):
+        * svg/SVGDocumentExtensions.h:
+        * testing/Internals.cpp:
+        (WebCore::Internals::areSVGAnimationsPaused):
+        * testing/Internals.h:
+        * testing/Internals.idl:
+
</ins><span class="cx"> == Rolled over to ChangeLog-2017-03-23 ==
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (214321 => 214322)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2017-03-23 22:39:57 UTC (rev 214321)
+++ trunk/Source/WebCore/dom/Document.cpp        2017-03-23 22:40:50 UTC (rev 214322)
</span><span class="lines">@@ -4873,7 +4873,7 @@
</span><span class="cx"> SVGDocumentExtensions&amp; Document::accessSVGExtensions()
</span><span class="cx"> {
</span><span class="cx">     if (!m_svgExtensions)
</span><del>-        m_svgExtensions = std::make_unique&lt;SVGDocumentExtensions&gt;(this);
</del><ins>+        m_svgExtensions = std::make_unique&lt;SVGDocumentExtensions&gt;(*this);
</ins><span class="cx">     return *m_svgExtensions;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGDocumentExtensionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGDocumentExtensions.cpp (214321 => 214322)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGDocumentExtensions.cpp        2017-03-23 22:39:57 UTC (rev 214321)
+++ trunk/Source/WebCore/svg/SVGDocumentExtensions.cpp        2017-03-23 22:40:50 UTC (rev 214322)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #include &quot;EventListener.h&quot;
</span><span class="cx"> #include &quot;Frame.h&quot;
</span><span class="cx"> #include &quot;FrameLoader.h&quot;
</span><ins>+#include &quot;Page.h&quot;
</ins><span class="cx"> #include &quot;SMILTimeContainer.h&quot;
</span><span class="cx"> #include &quot;SVGElement.h&quot;
</span><span class="cx"> #include &quot;SVGResourcesCache.h&quot;
</span><span class="lines">@@ -39,9 +40,10 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-SVGDocumentExtensions::SVGDocumentExtensions(Document* document)
</del><ins>+SVGDocumentExtensions::SVGDocumentExtensions(Document&amp; document)
</ins><span class="cx">     : m_document(document)
</span><span class="cx">     , m_resourcesCache(std::make_unique&lt;SVGResourcesCache&gt;())
</span><ins>+    , m_areAnimationsPaused(!document.page() || !document.page()-&gt;isVisible())
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -52,6 +54,8 @@
</span><span class="cx"> void SVGDocumentExtensions::addTimeContainer(SVGSVGElement* element)
</span><span class="cx"> {
</span><span class="cx">     m_timeContainers.add(element);
</span><ins>+    if (m_areAnimationsPaused)
+        element-&gt;pauseAnimations();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void SVGDocumentExtensions::removeTimeContainer(SVGSVGElement* element)
</span><span class="lines">@@ -124,10 +128,10 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void reportMessage(Document* document, MessageLevel level, const String&amp; message)
</del><ins>+static void reportMessage(Document&amp; document, MessageLevel level, const String&amp; message)
</ins><span class="cx"> {
</span><del>-    if (document-&gt;frame())
-        document-&gt;addConsoleMessage(MessageSource::Rendering, level, message);
</del><ins>+    if (document.frame())
+        document.addConsoleMessage(MessageSource::Rendering, level, message);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void SVGDocumentExtensions::reportWarning(const String&amp; message)
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGDocumentExtensionsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGDocumentExtensions.h (214321 => 214322)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGDocumentExtensions.h        2017-03-23 22:39:57 UTC (rev 214321)
+++ trunk/Source/WebCore/svg/SVGDocumentExtensions.h        2017-03-23 22:40:50 UTC (rev 214322)
</span><span class="lines">@@ -40,7 +40,7 @@
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(SVGDocumentExtensions); WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><span class="cx">     typedef HashSet&lt;Element*&gt; PendingElements;
</span><del>-    explicit SVGDocumentExtensions(Document*);
</del><ins>+    explicit SVGDocumentExtensions(Document&amp;);
</ins><span class="cx">     ~SVGDocumentExtensions();
</span><span class="cx">     
</span><span class="cx">     void addTimeContainer(SVGSVGElement*);
</span><span class="lines">@@ -77,7 +77,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    Document* m_document; // weak reference
</del><ins>+    Document&amp; m_document;
</ins><span class="cx">     HashSet&lt;SVGSVGElement*&gt; m_timeContainers; // For SVG 1.2 support this will need to be made more general.
</span><span class="cx"> #if ENABLE(SVG_FONTS)
</span><span class="cx">     HashSet&lt;SVGFontFaceElement*&gt; m_svgFontFaceElements;
</span><span class="lines">@@ -89,7 +89,7 @@
</span><span class="cx">     std::unique_ptr&lt;SVGResourcesCache&gt; m_resourcesCache;
</span><span class="cx"> 
</span><span class="cx">     Vector&lt;SVGElement*&gt; m_rebuildElements;
</span><del>-    bool m_areAnimationsPaused { false }; // For testing.
</del><ins>+    bool m_areAnimationsPaused;
</ins><span class="cx"> 
</span><span class="cx"> public:
</span><span class="cx">     // This HashMap contains a list of pending resources. Pending resources, are such
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (214321 => 214322)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp        2017-03-23 22:39:57 UTC (rev 214321)
+++ trunk/Source/WebCore/testing/Internals.cpp        2017-03-23 22:40:50 UTC (rev 214322)
</span><span class="lines">@@ -517,14 +517,14 @@
</span><span class="cx">     return WorkerThread::workerThreadCount();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool Internals::areSVGAnimationsPaused() const
</del><ins>+ExceptionOr&lt;bool&gt; Internals::areSVGAnimationsPaused() const
</ins><span class="cx"> {
</span><span class="cx">     auto* document = contextDocument();
</span><span class="cx">     if (!document)
</span><del>-        return false;
</del><ins>+        return Exception { INVALID_ACCESS_ERR, ASCIILiteral(&quot;No context document&quot;) };
</ins><span class="cx"> 
</span><span class="cx">     if (!document-&gt;svgExtensions())
</span><del>-        return false;
</del><ins>+        return Exception { NOT_FOUND_ERR, ASCIILiteral(&quot;No SVG animations&quot;) };
</ins><span class="cx"> 
</span><span class="cx">     return document-&gt;accessSVGExtensions().areAnimationsPaused();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.h (214321 => 214322)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.h        2017-03-23 22:39:57 UTC (rev 214321)
+++ trunk/Source/WebCore/testing/Internals.h        2017-03-23 22:40:50 UTC (rev 214322)
</span><span class="lines">@@ -266,7 +266,7 @@
</span><span class="cx"> 
</span><span class="cx">     InternalSettings* settings() const;
</span><span class="cx">     unsigned workerThreadCount() const;
</span><del>-    bool areSVGAnimationsPaused() const;
</del><ins>+    ExceptionOr&lt;bool&gt; areSVGAnimationsPaused() const;
</ins><span class="cx">     ExceptionOr&lt;double&gt; svgAnimationsInterval(SVGSVGElement&amp;) const;
</span><span class="cx"> 
</span><span class="cx">     ExceptionOr&lt;void&gt; setDeviceProximity(const String&amp; eventType, double value, double min, double max);
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.idl (214321 => 214322)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.idl        2017-03-23 22:39:57 UTC (rev 214321)
+++ trunk/Source/WebCore/testing/Internals.idl        2017-03-23 22:40:50 UTC (rev 214322)
</span><span class="lines">@@ -249,7 +249,7 @@
</span><span class="cx">     readonly attribute InternalSettings settings;
</span><span class="cx">     readonly attribute unsigned long workerThreadCount;
</span><span class="cx"> 
</span><del>-    readonly attribute boolean areSVGAnimationsPaused;
</del><ins>+    [MayThrowException] readonly attribute boolean areSVGAnimationsPaused;
</ins><span class="cx">     [MayThrowException] double svgAnimationsInterval(SVGSVGElement element);
</span><span class="cx"> 
</span><span class="cx">     // Flags for layerTreeAsText.
</span></span></pre>
</div>
</div>

</body>
</html>