<!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>[174313] trunk/Source/WebCore</title>
</head>
<body>

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

<h3>Log Message</h3>
<pre>Use is&lt;&gt;() / downcast&lt;&gt;() for CSS StyleProperties
https://bugs.webkit.org/show_bug.cgi?id=137398

Reviewed by Benjamin Poulain.

Use is&lt;&gt;() / downcast&lt;&gt;() for CSS StyleProperties subclasses.

No new tests, no behavior change.

* css/StyleProperties.cpp:
(WebCore::StyleProperties::immutableCopyIfNeeded):
(WebCore::MutableStyleProperties::MutableStyleProperties):
(WebCore::StyleProperties::hasCSSOMWrapper):
* css/StyleProperties.h:
(WebCore::StyleProperties::PropertyReference::propertyMetadata):
(WebCore::StyleProperties::PropertyReference::propertyValue):
(WebCore::StyleProperties::propertyCount):
(WebCore::StyleProperties::deref):
(WebCore::StyleProperties::findPropertyIndex):
(isType):
(WebCore::toMutableStyleProperties): Deleted.
(WebCore::toImmutableStyleProperties): Deleted.
* css/StyleRule.cpp:
(WebCore::StyleRule::mutableProperties):
(WebCore::StyleRulePage::mutableProperties):
(WebCore::StyleRuleFontFace::mutableProperties):
* css/WebKitCSSKeyframeRule.cpp:
(WebCore::StyleKeyframe::mutableProperties):
* dom/StyledElement.cpp:
(WebCore::StyledElement::ensureMutableInlineStyle):
(WebCore::StyledElement::setInlineStyleFromString):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssStylePropertiescpp">trunk/Source/WebCore/css/StyleProperties.cpp</a></li>
<li><a href="#trunkSourceWebCorecssStylePropertiesh">trunk/Source/WebCore/css/StyleProperties.h</a></li>
<li><a href="#trunkSourceWebCorecssStyleRulecpp">trunk/Source/WebCore/css/StyleRule.cpp</a></li>
<li><a href="#trunkSourceWebCorecssWebKitCSSKeyframeRulecpp">trunk/Source/WebCore/css/WebKitCSSKeyframeRule.cpp</a></li>
<li><a href="#trunkSourceWebCoredomStyledElementcpp">trunk/Source/WebCore/dom/StyledElement.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (174312 => 174313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-10-04 08:05:22 UTC (rev 174312)
+++ trunk/Source/WebCore/ChangeLog        2014-10-04 08:30:15 UTC (rev 174313)
</span><span class="lines">@@ -1,3 +1,37 @@
</span><ins>+2014-10-04  Christophe Dumez  &lt;cdumez@apple.com&gt;
+
+        Use is&lt;&gt;() / downcast&lt;&gt;() for CSS StyleProperties
+        https://bugs.webkit.org/show_bug.cgi?id=137398
+
+        Reviewed by Benjamin Poulain.
+
+        Use is&lt;&gt;() / downcast&lt;&gt;() for CSS StyleProperties subclasses.
+
+        No new tests, no behavior change.
+
+        * css/StyleProperties.cpp:
+        (WebCore::StyleProperties::immutableCopyIfNeeded):
+        (WebCore::MutableStyleProperties::MutableStyleProperties):
+        (WebCore::StyleProperties::hasCSSOMWrapper):
+        * css/StyleProperties.h:
+        (WebCore::StyleProperties::PropertyReference::propertyMetadata):
+        (WebCore::StyleProperties::PropertyReference::propertyValue):
+        (WebCore::StyleProperties::propertyCount):
+        (WebCore::StyleProperties::deref):
+        (WebCore::StyleProperties::findPropertyIndex):
+        (isType):
+        (WebCore::toMutableStyleProperties): Deleted.
+        (WebCore::toImmutableStyleProperties): Deleted.
+        * css/StyleRule.cpp:
+        (WebCore::StyleRule::mutableProperties):
+        (WebCore::StyleRulePage::mutableProperties):
+        (WebCore::StyleRuleFontFace::mutableProperties):
+        * css/WebKitCSSKeyframeRule.cpp:
+        (WebCore::StyleKeyframe::mutableProperties):
+        * dom/StyledElement.cpp:
+        (WebCore::StyledElement::ensureMutableInlineStyle):
+        (WebCore::StyledElement::setInlineStyleFromString):
+
</ins><span class="cx"> 2014-10-04  Zan Dobersek  &lt;zdobersek@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [TexMap] Clean up GraphicsLayerTextureMapper::prepareBackingStoreIfNeeded()
</span></span></pre></div>
<a id="trunkSourceWebCorecssStylePropertiescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleProperties.cpp (174312 => 174313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleProperties.cpp        2014-10-04 08:05:22 UTC (rev 174312)
+++ trunk/Source/WebCore/css/StyleProperties.cpp        2014-10-04 08:30:15 UTC (rev 174313)
</span><span class="lines">@@ -61,9 +61,9 @@
</span><span class="cx"> 
</span><span class="cx"> PassRef&lt;ImmutableStyleProperties&gt; StyleProperties::immutableCopyIfNeeded() const
</span><span class="cx"> {
</span><del>-    if (!isMutable())
-        return static_cast&lt;ImmutableStyleProperties&amp;&gt;(const_cast&lt;StyleProperties&amp;&gt;(*this));
-    const MutableStyleProperties&amp; mutableThis = static_cast&lt;const MutableStyleProperties&amp;&gt;(*this);
</del><ins>+    if (is&lt;ImmutableStyleProperties&gt;(*this))
+        return downcast&lt;ImmutableStyleProperties&gt;(const_cast&lt;StyleProperties&amp;&gt;(*this));
+    const MutableStyleProperties&amp; mutableThis = downcast&lt;MutableStyleProperties&gt;(*this);
</ins><span class="cx">     return ImmutableStyleProperties::create(mutableThis.m_propertyVector.data(), mutableThis.m_propertyVector.size(), cssParserMode());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -106,8 +106,8 @@
</span><span class="cx"> MutableStyleProperties::MutableStyleProperties(const StyleProperties&amp; other)
</span><span class="cx">     : StyleProperties(other.cssParserMode())
</span><span class="cx"> {
</span><del>-    if (other.isMutable())
-        m_propertyVector = static_cast&lt;const MutableStyleProperties&amp;&gt;(other).m_propertyVector;
</del><ins>+    if (is&lt;MutableStyleProperties&gt;(other))
+        m_propertyVector = downcast&lt;MutableStyleProperties&gt;(other).m_propertyVector;
</ins><span class="cx">     else {
</span><span class="cx">         m_propertyVector.reserveInitialCapacity(other.propertyCount());
</span><span class="cx">         for (unsigned i = 0; i &lt; other.propertyCount(); ++i)
</span><span class="lines">@@ -1028,7 +1028,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool StyleProperties::hasCSSOMWrapper() const
</span><span class="cx"> {
</span><del>-    return m_isMutable &amp;&amp; static_cast&lt;const MutableStyleProperties*&gt;(this)-&gt;m_cssomWrapper;
</del><ins>+    return is&lt;MutableStyleProperties&gt;(*this) &amp;&amp; downcast&lt;MutableStyleProperties&gt;(*this).m_cssomWrapper;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void MutableStyleProperties::mergeAndOverrideOnConflict(const StyleProperties&amp; other)
</span></span></pre></div>
<a id="trunkSourceWebCorecssStylePropertiesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleProperties.h (174312 => 174313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleProperties.h        2014-10-04 08:05:22 UTC (rev 174312)
+++ trunk/Source/WebCore/css/StyleProperties.h        2014-10-04 08:30:15 UTC (rev 174313)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #include &quot;CSSValueKeywords.h&quot;
</span><span class="cx"> #include &lt;memory&gt;
</span><span class="cx"> #include &lt;wtf/ListHashSet.h&gt;
</span><ins>+#include &lt;wtf/TypeCasts.h&gt;
</ins><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -235,38 +236,24 @@
</span><span class="cx">     friend class StyleProperties;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-TYPE_CASTS_BASE(MutableStyleProperties, StyleProperties, set, set-&gt;isMutable(), set.isMutable());
-
-inline MutableStyleProperties* toMutableStyleProperties(const RefPtr&lt;StyleProperties&gt;&amp; set)
-{
-    return toMutableStyleProperties(set.get());
-}
-
-TYPE_CASTS_BASE(ImmutableStyleProperties, StyleProperties, set, !set-&gt;isMutable(), !set.isMutable());
-
-inline ImmutableStyleProperties* toImmutableStyleProperties(const RefPtr&lt;StyleProperties&gt;&amp; set)
-{
-    return toImmutableStyleProperties(set.get());
-}
-
</del><span class="cx"> inline const StylePropertyMetadata&amp; StyleProperties::PropertyReference::propertyMetadata() const
</span><span class="cx"> {
</span><del>-    if (m_propertySet.isMutable())
-        return static_cast&lt;const MutableStyleProperties&amp;&gt;(m_propertySet).m_propertyVector.at(m_index).metadata();
-    return static_cast&lt;const ImmutableStyleProperties&amp;&gt;(m_propertySet).metadataArray()[m_index];
</del><ins>+    if (is&lt;MutableStyleProperties&gt;(m_propertySet))
+        return downcast&lt;MutableStyleProperties&gt;(m_propertySet).m_propertyVector.at(m_index).metadata();
+    return downcast&lt;ImmutableStyleProperties&gt;(m_propertySet).metadataArray()[m_index];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline const CSSValue* StyleProperties::PropertyReference::propertyValue() const
</span><span class="cx"> {
</span><del>-    if (m_propertySet.isMutable())
-        return static_cast&lt;const MutableStyleProperties&amp;&gt;(m_propertySet).m_propertyVector.at(m_index).value();
-    return static_cast&lt;const ImmutableStyleProperties&amp;&gt;(m_propertySet).valueArray()[m_index];
</del><ins>+    if (is&lt;MutableStyleProperties&gt;(m_propertySet))
+        return downcast&lt;MutableStyleProperties&gt;(m_propertySet).m_propertyVector.at(m_index).value();
+    return downcast&lt;ImmutableStyleProperties&gt;(m_propertySet).valueArray()[m_index];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline unsigned StyleProperties::propertyCount() const
</span><span class="cx"> {
</span><del>-    if (m_isMutable)
-        return static_cast&lt;const MutableStyleProperties*&gt;(this)-&gt;m_propertyVector.size();
</del><ins>+    if (is&lt;MutableStyleProperties&gt;(*this))
+        return downcast&lt;MutableStyleProperties&gt;(*this).m_propertyVector.size();
</ins><span class="cx">     return m_arraySize;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -280,19 +267,27 @@
</span><span class="cx">     if (!derefBase())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (m_isMutable)
-        delete static_cast&lt;MutableStyleProperties*&gt;(this);
</del><ins>+    if (is&lt;MutableStyleProperties&gt;(*this))
+        delete downcast&lt;MutableStyleProperties&gt;(this);
</ins><span class="cx">     else
</span><del>-        delete static_cast&lt;ImmutableStyleProperties*&gt;(this);
</del><ins>+        delete downcast&lt;ImmutableStyleProperties&gt;(this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline int StyleProperties::findPropertyIndex(CSSPropertyID propertyID) const
</span><span class="cx"> {
</span><del>-    if (m_isMutable)
-        return toMutableStyleProperties(this)-&gt;findPropertyIndex(propertyID);
-    return toImmutableStyleProperties(this)-&gt;findPropertyIndex(propertyID);
</del><ins>+    if (is&lt;MutableStyleProperties&gt;(*this))
+        return downcast&lt;MutableStyleProperties&gt;(*this).findPropertyIndex(propertyID);
+    return downcast&lt;ImmutableStyleProperties&gt;(*this).findPropertyIndex(propertyID);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::MutableStyleProperties)
+    static bool isType(const WebCore::StyleProperties&amp; set) { return set.isMutable(); }
+SPECIALIZE_TYPE_TRAITS_END()
+
+SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::ImmutableStyleProperties)
+    static bool isType(const WebCore::StyleProperties&amp; set) { return !set.isMutable(); }
+SPECIALIZE_TYPE_TRAITS_END()
+
</ins><span class="cx"> #endif // StyleProperties_h
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleRulecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleRule.cpp (174312 => 174313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleRule.cpp        2014-10-04 08:05:22 UTC (rev 174312)
+++ trunk/Source/WebCore/css/StyleRule.cpp        2014-10-04 08:30:15 UTC (rev 174313)
</span><span class="lines">@@ -220,9 +220,9 @@
</span><span class="cx"> 
</span><span class="cx"> MutableStyleProperties&amp; StyleRule::mutableProperties()
</span><span class="cx"> {
</span><del>-    if (!m_properties-&gt;isMutable())
</del><ins>+    if (!is&lt;MutableStyleProperties&gt;(m_properties.get()))
</ins><span class="cx">         m_properties = m_properties-&gt;mutableCopy();
</span><del>-    return static_cast&lt;MutableStyleProperties&amp;&gt;(m_properties.get());
</del><ins>+    return downcast&lt;MutableStyleProperties&gt;(m_properties.get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PassRef&lt;StyleRule&gt; StyleRule::create(int sourceLine, const Vector&lt;const CSSSelector*&gt;&amp; selectors, PassRef&lt;StyleProperties&gt; properties)
</span><span class="lines">@@ -282,9 +282,9 @@
</span><span class="cx"> 
</span><span class="cx"> MutableStyleProperties&amp; StyleRulePage::mutableProperties()
</span><span class="cx"> {
</span><del>-    if (!m_properties-&gt;isMutable())
</del><ins>+    if (!is&lt;MutableStyleProperties&gt;(m_properties.get()))
</ins><span class="cx">         m_properties = m_properties-&gt;mutableCopy();
</span><del>-    return static_cast&lt;MutableStyleProperties&amp;&gt;(m_properties.get());
</del><ins>+    return downcast&lt;MutableStyleProperties&gt;(m_properties.get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> StyleRuleFontFace::StyleRuleFontFace(PassRef&lt;StyleProperties&gt; properties)
</span><span class="lines">@@ -305,9 +305,9 @@
</span><span class="cx"> 
</span><span class="cx"> MutableStyleProperties&amp; StyleRuleFontFace::mutableProperties()
</span><span class="cx"> {
</span><del>-    if (!m_properties-&gt;isMutable())
</del><ins>+    if (!is&lt;MutableStyleProperties&gt;(m_properties.get()))
</ins><span class="cx">         m_properties = m_properties-&gt;mutableCopy();
</span><del>-    return static_cast&lt;MutableStyleProperties&amp;&gt;(m_properties.get());
</del><ins>+    return downcast&lt;MutableStyleProperties&gt;(m_properties.get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> StyleRuleGroup::StyleRuleGroup(Type type, Vector&lt;RefPtr&lt;StyleRuleBase&gt;&gt;&amp; adoptRule)
</span></span></pre></div>
<a id="trunkSourceWebCorecssWebKitCSSKeyframeRulecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/WebKitCSSKeyframeRule.cpp (174312 => 174313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/WebKitCSSKeyframeRule.cpp        2014-10-04 08:05:22 UTC (rev 174312)
+++ trunk/Source/WebCore/css/WebKitCSSKeyframeRule.cpp        2014-10-04 08:30:15 UTC (rev 174313)
</span><span class="lines">@@ -44,9 +44,9 @@
</span><span class="cx"> 
</span><span class="cx"> MutableStyleProperties&amp; StyleKeyframe::mutableProperties()
</span><span class="cx"> {
</span><del>-    if (!m_properties-&gt;isMutable())
</del><ins>+    if (!is&lt;MutableStyleProperties&gt;(m_properties.get()))
</ins><span class="cx">         m_properties = m_properties-&gt;mutableCopy();
</span><del>-    return static_cast&lt;MutableStyleProperties&amp;&gt;(m_properties.get());
</del><ins>+    return downcast&lt;MutableStyleProperties&gt;(m_properties.get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /* static */
</span></span></pre></div>
<a id="trunkSourceWebCoredomStyledElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/StyledElement.cpp (174312 => 174313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/StyledElement.cpp        2014-10-04 08:05:22 UTC (rev 174312)
+++ trunk/Source/WebCore/dom/StyledElement.cpp        2014-10-04 08:30:15 UTC (rev 174313)
</span><span class="lines">@@ -144,10 +144,9 @@
</span><span class="cx">     RefPtr&lt;StyleProperties&gt;&amp; inlineStyle = ensureUniqueElementData().m_inlineStyle;
</span><span class="cx">     if (!inlineStyle)
</span><span class="cx">         inlineStyle = MutableStyleProperties::create(strictToCSSParserMode(isHTMLElement() &amp;&amp; !document().inQuirksMode()));
</span><del>-    else if (!inlineStyle-&gt;isMutable())
</del><ins>+    else if (!is&lt;MutableStyleProperties&gt;(*inlineStyle))
</ins><span class="cx">         inlineStyle = inlineStyle-&gt;mutableCopy();
</span><del>-    ASSERT_WITH_SECURITY_IMPLICATION(inlineStyle-&gt;isMutable());
-    return static_cast&lt;MutableStyleProperties&amp;&gt;(*inlineStyle);
</del><ins>+    return downcast&lt;MutableStyleProperties&gt;(*inlineStyle);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void StyledElement::attributeChanged(const QualifiedName&amp; name, const AtomicString&amp; oldValue, const AtomicString&amp; newValue, AttributeModificationReason reason)
</span><span class="lines">@@ -181,15 +180,13 @@
</span><span class="cx"> 
</span><span class="cx">     // We reconstruct the property set instead of mutating if there is no CSSOM wrapper.
</span><span class="cx">     // This makes wrapperless property sets immutable and so cacheable.
</span><del>-    if (inlineStyle &amp;&amp; !inlineStyle-&gt;isMutable())
</del><ins>+    if (inlineStyle &amp;&amp; !is&lt;MutableStyleProperties&gt;(*inlineStyle))
</ins><span class="cx">         inlineStyle.clear();
</span><span class="cx"> 
</span><span class="cx">     if (!inlineStyle)
</span><span class="cx">         inlineStyle = CSSParser::parseInlineStyleDeclaration(newStyleString, this);
</span><del>-    else {
-        ASSERT(inlineStyle-&gt;isMutable());
-        static_pointer_cast&lt;MutableStyleProperties&gt;(inlineStyle)-&gt;parseDeclaration(newStyleString, &amp;document().elementSheet().contents());
-    }
</del><ins>+    else
+        downcast&lt;MutableStyleProperties&gt;(*inlineStyle).parseDeclaration(newStyleString, &amp;document().elementSheet().contents());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void StyledElement::styleAttributeChanged(const AtomicString&amp; newStyleString, AttributeModificationReason reason)
</span></span></pre>
</div>
</div>

</body>
</html>