<!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>[166014] branches/safari-537.75-branch</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/166014">166014</a></dd>
<dt>Author</dt> <dd>matthew_hanson@apple.com</dd>
<dt>Date</dt> <dd>2014-03-20 16:09:45 -0700 (Thu, 20 Mar 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/165821">r165821</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari53775branchLayoutTestsChangeLog">branches/safari-537.75-branch/LayoutTests/ChangeLog</a></li>
<li><a href="#branchessafari53775branchSourceWebCoreChangeLog">branches/safari-537.75-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari53775branchSourceWebCorecssCSSStyleRulecpp">branches/safari-537.75-branch/Source/WebCore/css/CSSStyleRule.cpp</a></li>
<li><a href="#branchessafari53775branchSourceWebCorecssPropertySetCSSStyleDeclarationcpp">branches/safari-537.75-branch/Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp</a></li>
<li><a href="#branchessafari53775branchSourceWebCorecssPropertySetCSSStyleDeclarationh">branches/safari-537.75-branch/Source/WebCore/css/PropertySetCSSStyleDeclaration.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#branchessafari53775branchLayoutTestsfastcssgetMatchedCSSPropertiesrulemutationexpectedtxt">branches/safari-537.75-branch/LayoutTests/fast/css/getMatchedCSSProperties-rule-mutation-expected.txt</a></li>
<li><a href="#branchessafari53775branchLayoutTestsfastcssgetMatchedCSSPropertiesrulemutationhtml">branches/safari-537.75-branch/LayoutTests/fast/css/getMatchedCSSProperties-rule-mutation.html</a></li>
<li><a href="#branchessafari53775branchLayoutTestsfastcssgetMatchedCSSRulescrashexpectedtxt">branches/safari-537.75-branch/LayoutTests/fast/css/getMatchedCSSRules-crash-expected.txt</a></li>
<li><a href="#branchessafari53775branchLayoutTestsfastcssgetMatchedCSSRulescrashhtml">branches/safari-537.75-branch/LayoutTests/fast/css/getMatchedCSSRules-crash.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari53775branchLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-537.75-branch/LayoutTests/ChangeLog (166013 => 166014)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.75-branch/LayoutTests/ChangeLog        2014-03-20 23:08:30 UTC (rev 166013)
+++ branches/safari-537.75-branch/LayoutTests/ChangeLog        2014-03-20 23:09:45 UTC (rev 166014)
</span><span class="lines">@@ -1,5 +1,21 @@
</span><span class="cx"> 2014-03-20  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r165821.
+
+    2014-03-18  Antti Koivisto  &lt;antti@apple.com&gt;
+    
+            Mutating rules returned by getMatchedCSSRules can result in crash
+            https://bugs.webkit.org/show_bug.cgi?id=130209
+    
+            Reviewed by Andreas Kling.
+    
+            * fast/css/getMatchedCSSProperties-rule-mutation-expected.txt: Added.
+            * fast/css/getMatchedCSSProperties-rule-mutation.html: Added.
+            * fast/css/getMatchedCSSRules-crash-expected.txt: Added.
+            * fast/css/getMatchedCSSRules-crash.html: Added.
+    
+2014-03-20  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
</ins><span class="cx">         Merge r165921.
</span><span class="cx"> 
</span><span class="cx">     2014-03-19  Antti Koivisto  &lt;antti@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari53775branchLayoutTestsfastcssgetMatchedCSSPropertiesrulemutationexpectedtxtfromrev165821trunkLayoutTestsfastcssgetMatchedCSSPropertiesrulemutationexpectedtxt"></a>
<div class="copfile"><h4>Copied: branches/safari-537.75-branch/LayoutTests/fast/css/getMatchedCSSProperties-rule-mutation-expected.txt (from rev 165821, trunk/LayoutTests/fast/css/getMatchedCSSProperties-rule-mutation-expected.txt) (0 => 166014)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.75-branch/LayoutTests/fast/css/getMatchedCSSProperties-rule-mutation-expected.txt                                (rev 0)
+++ branches/safari-537.75-branch/LayoutTests/fast/css/getMatchedCSSProperties-rule-mutation-expected.txt        2014-03-20 23:09:45 UTC (rev 166014)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+Test that CSSStyleRules returned by getMatchedCSSRules can't be mutated
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS rules.length is 2
+PASS rules[0].selectorText is originalText
+PASS rules[1].selectorText is originalText
+PASS rules[0].style.cssText is originalText
+PASS rules[1].style.cssText is originalText
+PASS rules[0].style.color is originalText
+PASS rules[1].style.color is originalText
+PASS rules[0].style.getPropertyValue('color') is originalText
+PASS rules[1].style.getPropertyValue('color') is originalText
+PASS rules[0].style.color is originalText
+PASS rules[1].style.color is originalText
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="branchessafari53775branchLayoutTestsfastcssgetMatchedCSSPropertiesrulemutationhtmlfromrev165821trunkLayoutTestsfastcssgetMatchedCSSPropertiesrulemutationhtml"></a>
<div class="copfile"><h4>Copied: branches/safari-537.75-branch/LayoutTests/fast/css/getMatchedCSSProperties-rule-mutation.html (from rev 165821, trunk/LayoutTests/fast/css/getMatchedCSSProperties-rule-mutation.html) (0 => 166014)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.75-branch/LayoutTests/fast/css/getMatchedCSSProperties-rule-mutation.html                                (rev 0)
+++ branches/safari-537.75-branch/LayoutTests/fast/css/getMatchedCSSProperties-rule-mutation.html        2014-03-20 23:09:45 UTC (rev 166014)
</span><span class="lines">@@ -0,0 +1,67 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;style&gt;
+#test { color: blue; }
+@media all {
+    #test { color: blue; }
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;div id=test&gt;
+&lt;/div&gt;
+&lt;script&gt;
+
+description(&quot;Test that CSSStyleRules returned by getMatchedCSSRules can't be mutated&quot;);
+
+var testDiv = document.getElementById('test');
+var rules = getMatchedCSSRules(testDiv);
+
+function tryMutateSelector(index) {
+    originalText = rules[index].selectorText;
+    rules[index].selectorText = &quot;#mutated&quot;;
+    shouldBe(&quot;rules[&quot;+index+&quot;].selectorText&quot;, &quot;originalText&quot;);
+}
+
+function tryMutateCSSText(index) {
+    originalText = rules[index].style.cssText;
+    rules[index].style.cssText = &quot;color: red&quot;;
+    shouldBe(&quot;rules[&quot;+index+&quot;].style.cssText&quot;, &quot;originalText&quot;);
+}
+
+function tryMutateProperty(index) {
+    originalText = rules[index].style.color;
+    rules[index].style.color = &quot;green&quot;;
+    shouldBe(&quot;rules[&quot;+index+&quot;].style.color&quot;, &quot;originalText&quot;);
+}
+
+function tryMutateProperty2(index) {
+    originalText = rules[index].style.getPropertyValue(&quot;color&quot;);
+    rules[index].style.setProperty(&quot;color&quot;, &quot;white&quot;);
+    shouldBe(&quot;rules[&quot;+index+&quot;].style.getPropertyValue('color')&quot;, &quot;originalText&quot;);
+}
+
+function tryRemoveProperty(index) {
+    originalText = rules[index].style.color;
+    rules[index].style.removeProperty(&quot;color&quot;);
+    shouldBe(&quot;rules[&quot;+index+&quot;].style.color&quot;, &quot;originalText&quot;);
+}
+
+shouldBe(&quot;rules.length&quot;, &quot;2&quot;);
+tryMutateSelector(0);
+tryMutateSelector(1);
+tryMutateCSSText(0);
+tryMutateCSSText(1);
+tryMutateProperty(0);
+tryMutateProperty(1);
+tryMutateProperty2(0);
+tryMutateProperty2(1);
+tryRemoveProperty(0);
+tryRemoveProperty(1);
+
+&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="branchessafari53775branchLayoutTestsfastcssgetMatchedCSSRulescrashexpectedtxtfromrev165821trunkLayoutTestsfastcssgetMatchedCSSRulescrashexpectedtxt"></a>
<div class="copfile"><h4>Copied: branches/safari-537.75-branch/LayoutTests/fast/css/getMatchedCSSRules-crash-expected.txt (from rev 165821, trunk/LayoutTests/fast/css/getMatchedCSSRules-crash-expected.txt) (0 => 166014)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.75-branch/LayoutTests/fast/css/getMatchedCSSRules-crash-expected.txt                                (rev 0)
+++ branches/safari-537.75-branch/LayoutTests/fast/css/getMatchedCSSRules-crash-expected.txt        2014-03-20 23:09:45 UTC (rev 166014)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+This test passes if it doesn't crash. 
</ins></span></pre></div>
<a id="branchessafari53775branchLayoutTestsfastcssgetMatchedCSSRulescrashhtmlfromrev165821trunkLayoutTestsfastcssgetMatchedCSSRulescrashhtml"></a>
<div class="copfile"><h4>Copied: branches/safari-537.75-branch/LayoutTests/fast/css/getMatchedCSSRules-crash.html (from rev 165821, trunk/LayoutTests/fast/css/getMatchedCSSRules-crash.html) (0 => 166014)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.75-branch/LayoutTests/fast/css/getMatchedCSSRules-crash.html                                (rev 0)
+++ branches/safari-537.75-branch/LayoutTests/fast/css/getMatchedCSSRules-crash.html        2014-03-20 23:09:45 UTC (rev 166014)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+&lt;html&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+&lt;/script&gt;
+&lt;style&gt;html,tr,img, table,media,body, li, em:nth-child(5){
+    height: 500px
+}
+&lt;/style&gt;
+&lt;script&gt;
+function load() {
+    var cssRules = window.getMatchedCSSRules(document.documentElement);
+    cssRules[0].selectorText = 'a,td';
+}
+&lt;/script&gt;
+This test passes if it doesn't crash.
+&lt;iframe onload=load()&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="branchessafari53775branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-537.75-branch/Source/WebCore/ChangeLog (166013 => 166014)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.75-branch/Source/WebCore/ChangeLog        2014-03-20 23:08:30 UTC (rev 166013)
+++ branches/safari-537.75-branch/Source/WebCore/ChangeLog        2014-03-20 23:09:45 UTC (rev 166014)
</span><span class="lines">@@ -1,5 +1,58 @@
</span><span class="cx"> 2014-03-20  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r165821.
+
+    2014-03-18  Antti Koivisto  &lt;antti@apple.com&gt;
+    
+            Mutating rules returned by getMatchedCSSRules can result in crash
+            https://bugs.webkit.org/show_bug.cgi?id=130209
+    
+            Reviewed by Andreas Kling.
+            
+            The non-standard getMatchedCSSRules API returns CSSStyleRule objects that don't
+            have parent stylesheet pointer (as we don't know which sheet the rule originated from).
+            Mutating the rule via such wrapper can lead to crashes later as we fail to invalidate
+            the underlying stylesheet.
+            
+            Fix by disallowing mutation of style rules that don't have parent sheet pointer. CSSStyleRule
+            has two mutable properties selectorText and style. The latter gives back CSSStyleDeclaration.
+            This patch disallows mutations in both cases for CSSStyleRules that don't have parent stylesheet
+            pointer.
+            
+            While it is technically possible to have CSSRules that are legitimately disconnected
+            from stylesheet (by removing rule from sheet while holding a reference to it) it never
+            makes sense to mutate such rule as there is no way to do anything with it afterwards.
+    
+            Tests: fast/css/getMatchedCSSProperties-rule-mutation.html
+                   fast/css/getMatchedCSSRules-crash.html
+    
+            * css/CSSStyleRule.cpp:
+            (WebCore::CSSStyleRule::setSelectorText):
+    
+                Bail out if parent stylesheet is null.
+    
+            * css/PropertySetCSSStyleDeclaration.cpp:
+            (WebCore::PropertySetCSSStyleDeclaration::setCssText):
+            (WebCore::PropertySetCSSStyleDeclaration::setProperty):
+            (WebCore::PropertySetCSSStyleDeclaration::removeProperty):
+            (WebCore::PropertySetCSSStyleDeclaration::setPropertyInternal):
+            
+                Allow StyleRuleCSSStyleDeclaration subclass cancel the mutation via
+                boolean return value from willMutate.
+    
+            (WebCore::StyleRuleCSSStyleDeclaration::willMutate):
+            
+                Disallow mutation if the owning CSSStyleRule is null or has null stylesheet.
+    
+            (WebCore::StyleRuleCSSStyleDeclaration::didMutate):
+            
+                We never get here with null rule or stylesheet anymore.
+    
+            * css/PropertySetCSSStyleDeclaration.h:
+            (WebCore::PropertySetCSSStyleDeclaration::willMutate):
+    
+2014-03-20  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
</ins><span class="cx">         Merge r165921.
</span><span class="cx"> 
</span><span class="cx">     2014-03-19  Antti Koivisto  &lt;antti@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari53775branchSourceWebCorecssCSSStyleRulecpp"></a>
<div class="modfile"><h4>Modified: branches/safari-537.75-branch/Source/WebCore/css/CSSStyleRule.cpp (166013 => 166014)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.75-branch/Source/WebCore/css/CSSStyleRule.cpp        2014-03-20 23:08:30 UTC (rev 166013)
+++ branches/safari-537.75-branch/Source/WebCore/css/CSSStyleRule.cpp        2014-03-20 23:09:45 UTC (rev 166014)
</span><span class="lines">@@ -93,6 +93,11 @@
</span><span class="cx"> 
</span><span class="cx"> void CSSStyleRule::setSelectorText(const String&amp; selectorText)
</span><span class="cx"> {
</span><ins>+    // FIXME: getMatchedCSSRules can return CSSStyleRules that are missing parent stylesheet pointer while
+    // referencing StyleRules that are part of stylesheet. Disallow mutations in this case.
+    if (!parentStyleSheet())
+        return;
+
</ins><span class="cx">     CSSParser p(parserContext());
</span><span class="cx">     CSSSelectorList selectorList;
</span><span class="cx">     p.parseSelector(selectorText, selectorList);
</span></span></pre></div>
<a id="branchessafari53775branchSourceWebCorecssPropertySetCSSStyleDeclarationcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-537.75-branch/Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp (166013 => 166014)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.75-branch/Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp        2014-03-20 23:08:30 UTC (rev 166013)
+++ branches/safari-537.75-branch/Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp        2014-03-20 23:09:45 UTC (rev 166014)
</span><span class="lines">@@ -150,7 +150,8 @@
</span><span class="cx"> void PropertySetCSSStyleDeclaration::setCssText(const String&amp; text, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><span class="cx">     StyleAttributeMutationScope mutationScope(this);
</span><del>-    willMutate();
</del><ins>+    if (!willMutate())
+        return;
</ins><span class="cx"> 
</span><span class="cx">     ec = 0;
</span><span class="cx">     // FIXME: Detect syntax errors and set ec.
</span><span class="lines">@@ -208,10 +209,11 @@
</span><span class="cx">     if (!propertyID)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+    if (!willMutate())
+        return;
+
</ins><span class="cx">     bool important = priority.find(&quot;important&quot;, 0, false) != notFound;
</span><span class="cx"> 
</span><del>-    willMutate();
-
</del><span class="cx">     ec = 0;
</span><span class="cx">     bool changed = m_propertySet-&gt;setProperty(propertyID, value, important, contextStyleSheet());
</span><span class="cx"> 
</span><span class="lines">@@ -231,7 +233,8 @@
</span><span class="cx">     if (!propertyID)
</span><span class="cx">         return String();
</span><span class="cx"> 
</span><del>-    willMutate();
</del><ins>+    if (!willMutate())
+        return String();
</ins><span class="cx"> 
</span><span class="cx">     ec = 0;
</span><span class="cx">     String result;
</span><span class="lines">@@ -257,7 +260,8 @@
</span><span class="cx"> void PropertySetCSSStyleDeclaration::setPropertyInternal(CSSPropertyID propertyID, const String&amp; value, bool important, ExceptionCode&amp; ec)
</span><span class="cx"> { 
</span><span class="cx">     StyleAttributeMutationScope mutationScope(this);
</span><del>-    willMutate();
</del><ins>+    if (!willMutate())
+        return;
</ins><span class="cx"> 
</span><span class="cx">     ec = 0;
</span><span class="cx">     bool changed = m_propertySet-&gt;setProperty(propertyID, value, important, contextStyleSheet());
</span><span class="lines">@@ -320,20 +324,24 @@
</span><span class="cx">         delete this;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void StyleRuleCSSStyleDeclaration::willMutate()
</del><ins>+bool StyleRuleCSSStyleDeclaration::willMutate()
</ins><span class="cx"> {
</span><del>-    if (m_parentRule &amp;&amp; m_parentRule-&gt;parentStyleSheet())
-        m_parentRule-&gt;parentStyleSheet()-&gt;willMutateRules();
</del><ins>+    if (!m_parentRule || !m_parentRule-&gt;parentStyleSheet())
+        return false;
+    m_parentRule-&gt;parentStyleSheet()-&gt;willMutateRules();
+    return true;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void StyleRuleCSSStyleDeclaration::didMutate(MutationType type)
</span><span class="cx"> {
</span><ins>+    ASSERT(m_parentRule);
+    ASSERT(m_parentRule-&gt;parentStyleSheet());
+
</ins><span class="cx">     if (type == PropertyChanged)
</span><span class="cx">         m_cssomCSSValueClones.clear();
</span><span class="cx"> 
</span><span class="cx">     // Style sheet mutation needs to be signaled even if the change failed. willMutate*/didMutate* must pair.
</span><del>-    if (m_parentRule &amp;&amp; m_parentRule-&gt;parentStyleSheet())
-        m_parentRule-&gt;parentStyleSheet()-&gt;didMutateRuleFromCSSStyleDeclaration();
</del><ins>+    m_parentRule-&gt;parentStyleSheet()-&gt;didMutateRuleFromCSSStyleDeclaration();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> CSSStyleSheet* StyleRuleCSSStyleDeclaration::parentStyleSheet() const
</span></span></pre></div>
<a id="branchessafari53775branchSourceWebCorecssPropertySetCSSStyleDeclarationh"></a>
<div class="modfile"><h4>Modified: branches/safari-537.75-branch/Source/WebCore/css/PropertySetCSSStyleDeclaration.h (166013 => 166014)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.75-branch/Source/WebCore/css/PropertySetCSSStyleDeclaration.h        2014-03-20 23:08:30 UTC (rev 166013)
+++ branches/safari-537.75-branch/Source/WebCore/css/PropertySetCSSStyleDeclaration.h        2014-03-20 23:09:45 UTC (rev 166014)
</span><span class="lines">@@ -74,7 +74,7 @@
</span><span class="cx">     
</span><span class="cx"> protected:
</span><span class="cx">     enum MutationType { NoChanges, PropertyChanged };
</span><del>-    virtual void willMutate() { }
</del><ins>+    virtual bool willMutate() WARN_UNUSED_RETURN { return true; }
</ins><span class="cx">     virtual void didMutate(MutationType) { }
</span><span class="cx"> 
</span><span class="cx">     MutableStylePropertySet* m_propertySet;
</span><span class="lines">@@ -104,7 +104,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual CSSRule* parentRule() const OVERRIDE { return m_parentRule;  }
</span><span class="cx"> 
</span><del>-    virtual void willMutate() OVERRIDE;
</del><ins>+    virtual bool willMutate() override WARN_UNUSED_RETURN;
</ins><span class="cx">     virtual void didMutate(MutationType) OVERRIDE;
</span><span class="cx"> 
</span><span class="cx">     unsigned m_refCount;
</span></span></pre>
</div>
</div>

</body>
</html>