<!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>[176668] 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/176668">176668</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2014-12-02 09:59:18 -0800 (Tue, 02 Dec 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Use references instead of pointers in EditingStyle
https://bugs.webkit.org/show_bug.cgi?id=137918

Patch by Tibor Meszaros &lt;tmeszaros.u-szeged@partner.samsung.com&gt; on 2014-12-02
Reviewed by Darin Adler.

* editing/EditingStyle.cpp:
(WebCore::extractPropertyValue):
(WebCore::identifierForStyleProperty):
(WebCore::textColorFromStyle):
(WebCore::backgroundColorFromStyle):
(WebCore::textAlignResolvingStartAndEnd):
(WebCore::EditingStyle::triStateOfStyle):
(WebCore::EditingStyle::styleIsPresentInComputedStyleOfNode):
(WebCore::EditingStyle::prepareToApplyAt):
(WebCore::EditingStyle::removeStyleFromRulesAndContext):
(WebCore::StyleChange::StyleChange):
(WebCore::setTextDecorationProperty):
(WebCore::StyleChange::extractTextStyles):
(WebCore::diffTextDecorations):
(WebCore::fontWeightIsBold):
(WebCore::extractPropertiesNotIn):
(WebCore::getPropertiesNotIn):
* editing/EditingStyle.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreeditingEditingStylecpp">trunk/Source/WebCore/editing/EditingStyle.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingEditingStyleh">trunk/Source/WebCore/editing/EditingStyle.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (176667 => 176668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-12-02 17:33:43 UTC (rev 176667)
+++ trunk/Source/WebCore/ChangeLog        2014-12-02 17:59:18 UTC (rev 176668)
</span><span class="lines">@@ -1,3 +1,29 @@
</span><ins>+2014-12-02  Tibor Meszaros  &lt;tmeszaros.u-szeged@partner.samsung.com&gt;
+
+        Use references instead of pointers in EditingStyle
+        https://bugs.webkit.org/show_bug.cgi?id=137918
+
+        Reviewed by Darin Adler.
+
+        * editing/EditingStyle.cpp:
+        (WebCore::extractPropertyValue):
+        (WebCore::identifierForStyleProperty):
+        (WebCore::textColorFromStyle):
+        (WebCore::backgroundColorFromStyle):
+        (WebCore::textAlignResolvingStartAndEnd):
+        (WebCore::EditingStyle::triStateOfStyle):
+        (WebCore::EditingStyle::styleIsPresentInComputedStyleOfNode):
+        (WebCore::EditingStyle::prepareToApplyAt):
+        (WebCore::EditingStyle::removeStyleFromRulesAndContext):
+        (WebCore::StyleChange::StyleChange):
+        (WebCore::setTextDecorationProperty):
+        (WebCore::StyleChange::extractTextStyles):
+        (WebCore::diffTextDecorations):
+        (WebCore::fontWeightIsBold):
+        (WebCore::extractPropertiesNotIn):
+        (WebCore::getPropertiesNotIn):
+        * editing/EditingStyle.h:
+
</ins><span class="cx"> 2014-12-02  Bartlomiej Gajda  &lt;b.gajda@samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GStreamer] Media Source sending seek event fails.
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditingStylecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/EditingStyle.cpp (176667 => 176668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/EditingStyle.cpp        2014-12-02 17:33:43 UTC (rev 176667)
+++ trunk/Source/WebCore/editing/EditingStyle.cpp        2014-12-02 17:59:18 UTC (rev 176668)
</span><span class="lines">@@ -128,18 +128,18 @@
</span><span class="cx">     return copyPropertiesFromComputedStyle(computedStyle, propertiesToInclude);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static PassRefPtr&lt;CSSValue&gt; extractPropertyValue(const StyleProperties* style, CSSPropertyID propertyID)
</del><ins>+static PassRefPtr&lt;CSSValue&gt; extractPropertyValue(const StyleProperties&amp; style, CSSPropertyID propertyID)
</ins><span class="cx"> {
</span><del>-    return style ? style-&gt;getPropertyCSSValue(propertyID) : PassRefPtr&lt;CSSValue&gt;();
</del><ins>+    return style.getPropertyCSSValue(propertyID);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static PassRefPtr&lt;CSSValue&gt; extractPropertyValue(ComputedStyleExtractor* computedStyle, CSSPropertyID propertyID)
</del><ins>+static PassRefPtr&lt;CSSValue&gt; extractPropertyValue(ComputedStyleExtractor&amp; computedStyle, CSSPropertyID propertyID)
</ins><span class="cx"> {
</span><del>-    return computedStyle-&gt;propertyValue(propertyID);
</del><ins>+    return computedStyle.propertyValue(propertyID);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename T&gt;
</span><del>-int identifierForStyleProperty(T* style, CSSPropertyID propertyID)
</del><ins>+int identifierForStyleProperty(T&amp; style, CSSPropertyID propertyID)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;CSSValue&gt; value = extractPropertyValue(style, propertyID);
</span><span class="cx">     if (!is&lt;CSSPrimitiveValue&gt;(value.get()))
</span><span class="lines">@@ -147,7 +147,7 @@
</span><span class="cx">     return downcast&lt;CSSPrimitiveValue&gt;(*value).getValueID();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-template&lt;typename T&gt; PassRefPtr&lt;MutableStyleProperties&gt; getPropertiesNotIn(StyleProperties* styleWithRedundantProperties, T* baseStyle);
</del><ins>+template&lt;typename T&gt; PassRefPtr&lt;MutableStyleProperties&gt; getPropertiesNotIn(StyleProperties&amp; styleWithRedundantProperties, T&amp; baseStyle);
</ins><span class="cx"> enum LegacyFontSizeMode { AlwaysUseLegacyFontSize, UseLegacyFontSizeOnlyIfPixelValuesMatch };
</span><span class="cx"> static int legacyFontSizeFromCSSValue(Document*, CSSPrimitiveValue*, bool shouldUseFixedFontDefaultSize, LegacyFontSizeMode);
</span><span class="cx"> static bool isTransparentColorValue(CSSValue*);
</span><span class="lines">@@ -369,13 +369,13 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename T&gt;
</span><del>-static inline RGBA32 textColorFromStyle(T* style)
</del><ins>+static inline RGBA32 textColorFromStyle(T&amp; style)
</ins><span class="cx"> {
</span><span class="cx">     return cssValueToRGBA(extractPropertyValue(style, CSSPropertyColor).get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename T&gt;
</span><del>-static inline RGBA32 backgroundColorFromStyle(T* style)
</del><ins>+static inline RGBA32 backgroundColorFromStyle(T&amp; style)
</ins><span class="cx"> {
</span><span class="cx">     return cssValueToRGBA(extractPropertyValue(style, CSSPropertyBackgroundColor).get());
</span><span class="cx"> }
</span><span class="lines">@@ -408,7 +408,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename T&gt;
</span><del>-static int textAlignResolvingStartAndEnd(T* style)
</del><ins>+static int textAlignResolvingStartAndEnd(T&amp; style)
</ins><span class="cx"> {
</span><span class="cx">     return textAlignResolvingStartAndEnd(identifierForStyleProperty(style, CSSPropertyTextAlign), identifierForStyleProperty(style, CSSPropertyDirection));
</span><span class="cx"> }
</span><span class="lines">@@ -642,14 +642,17 @@
</span><span class="cx"> {
</span><span class="cx">     if (!style || !style-&gt;m_mutableStyle)
</span><span class="cx">         return FalseTriState;
</span><del>-    return triStateOfStyle(style-&gt;m_mutableStyle.get(), DoNotIgnoreTextOnlyProperties);
</del><ins>+    return triStateOfStyle(*style-&gt;m_mutableStyle, DoNotIgnoreTextOnlyProperties);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename T&gt;
</span><del>-TriState EditingStyle::triStateOfStyle(T* styleToCompare, ShouldIgnoreTextOnlyProperties shouldIgnoreTextOnlyProperties) const
</del><ins>+TriState EditingStyle::triStateOfStyle(T&amp; styleToCompare, ShouldIgnoreTextOnlyProperties shouldIgnoreTextOnlyProperties) const
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;MutableStyleProperties&gt; difference = getPropertiesNotIn(m_mutableStyle.get(), styleToCompare);
</del><ins>+    if (!m_mutableStyle)
+        return TrueTriState;
</ins><span class="cx"> 
</span><ins>+    RefPtr&lt;MutableStyleProperties&gt; difference = getPropertiesNotIn(*m_mutableStyle, styleToCompare);
+
</ins><span class="cx">     if (shouldIgnoreTextOnlyProperties == IgnoreTextOnlyProperties)
</span><span class="cx">         difference-&gt;removePropertiesInSet(textOnlyProperties, WTF_ARRAY_LENGTH(textOnlyProperties));
</span><span class="cx"> 
</span><span class="lines">@@ -674,7 +677,7 @@
</span><span class="cx">     for (Node* node = selection.start().deprecatedNode(); node; node = NodeTraversal::next(node)) {
</span><span class="cx">         if (node-&gt;renderer() &amp;&amp; node-&gt;hasEditableStyle()) {
</span><span class="cx">             ComputedStyleExtractor computedStyle(node);
</span><del>-            TriState nodeState = triStateOfStyle(&amp;computedStyle, node-&gt;isTextNode() ? EditingStyle::DoNotIgnoreTextOnlyProperties : EditingStyle::IgnoreTextOnlyProperties);
</del><ins>+            TriState nodeState = triStateOfStyle(computedStyle, node-&gt;isTextNode() ? EditingStyle::DoNotIgnoreTextOnlyProperties : EditingStyle::IgnoreTextOnlyProperties);
</ins><span class="cx">             if (nodeIsStart) {
</span><span class="cx">                 state = nodeState;
</span><span class="cx">                 nodeIsStart = false;
</span><span class="lines">@@ -849,7 +852,7 @@
</span><span class="cx">     if (!m_mutableStyle)
</span><span class="cx">         return true;
</span><span class="cx">     ComputedStyleExtractor computedStyle(node);
</span><del>-    return getPropertiesNotIn(m_mutableStyle.get(), &amp;computedStyle)-&gt;isEmpty();
</del><ins>+    return getPropertiesNotIn(*m_mutableStyle, computedStyle)-&gt;isEmpty();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool EditingStyle::elementIsStyledSpanOrHTMLEquivalent(const HTMLElement* element)
</span><span class="lines">@@ -920,10 +923,10 @@
</span><span class="cx"> 
</span><span class="cx">     removeEquivalentProperties(*styleAtPosition);
</span><span class="cx"> 
</span><del>-    if (textAlignResolvingStartAndEnd(m_mutableStyle.get()) == textAlignResolvingStartAndEnd(styleAtPosition))
</del><ins>+    if (textAlignResolvingStartAndEnd(*m_mutableStyle) == textAlignResolvingStartAndEnd(*styleAtPosition))
</ins><span class="cx">         m_mutableStyle-&gt;removeProperty(CSSPropertyTextAlign);
</span><span class="cx"> 
</span><del>-    if (textColorFromStyle(m_mutableStyle.get()) == textColorFromStyle(styleAtPosition))
</del><ins>+    if (textColorFromStyle(*m_mutableStyle) == textColorFromStyle(*styleAtPosition))
</ins><span class="cx">         m_mutableStyle-&gt;removeProperty(CSSPropertyColor);
</span><span class="cx"> 
</span><span class="cx">     if (hasTransparentBackgroundColor(m_mutableStyle.get())
</span><span class="lines">@@ -1161,7 +1164,7 @@
</span><span class="cx">     // 1. Remove style from matched rules because style remain without repeating it in inline style declaration
</span><span class="cx">     RefPtr&lt;MutableStyleProperties&gt; styleFromMatchedRules = styleFromMatchedRulesForElement(element, StyleResolver::AllButEmptyCSSRules);
</span><span class="cx">     if (styleFromMatchedRules &amp;&amp; !styleFromMatchedRules-&gt;isEmpty())
</span><del>-        m_mutableStyle = getPropertiesNotIn(m_mutableStyle.get(), styleFromMatchedRules.get());
</del><ins>+        m_mutableStyle = getPropertiesNotIn(*m_mutableStyle, *styleFromMatchedRules);
</ins><span class="cx"> 
</span><span class="cx">     // 2. Remove style present in context and not overriden by matched rules.
</span><span class="cx">     RefPtr&lt;EditingStyle&gt; computedStyle = EditingStyle::create(context, EditingPropertiesInEffect);
</span><span class="lines">@@ -1170,15 +1173,15 @@
</span><span class="cx">             computedStyle-&gt;m_mutableStyle-&gt;setProperty(CSSPropertyBackgroundColor, CSSValueTransparent);
</span><span class="cx"> 
</span><span class="cx">         removePropertiesInStyle(computedStyle-&gt;m_mutableStyle.get(), styleFromMatchedRules.get());
</span><del>-        m_mutableStyle = getPropertiesNotIn(m_mutableStyle.get(), computedStyle-&gt;m_mutableStyle.get());
</del><ins>+        m_mutableStyle = getPropertiesNotIn(*m_mutableStyle, *computedStyle-&gt;m_mutableStyle);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // 3. If this element is a span and has display: inline or float: none, remove them unless they are overriden by rules.
</span><span class="cx">     // These rules are added by serialization code to wrap text nodes.
</span><span class="cx">     if (isStyleSpanOrSpanWithOnlyStyleAttribute(element)) {
</span><del>-        if (!styleFromMatchedRules-&gt;getPropertyCSSValue(CSSPropertyDisplay) &amp;&amp; identifierForStyleProperty(m_mutableStyle.get(), CSSPropertyDisplay) == CSSValueInline)
</del><ins>+        if (!styleFromMatchedRules-&gt;getPropertyCSSValue(CSSPropertyDisplay) &amp;&amp; identifierForStyleProperty(*m_mutableStyle, CSSPropertyDisplay) == CSSValueInline)
</ins><span class="cx">             m_mutableStyle-&gt;removeProperty(CSSPropertyDisplay);
</span><del>-        if (!styleFromMatchedRules-&gt;getPropertyCSSValue(CSSPropertyFloat) &amp;&amp; identifierForStyleProperty(m_mutableStyle.get(), CSSPropertyFloat) == CSSValueNone)
</del><ins>+        if (!styleFromMatchedRules-&gt;getPropertyCSSValue(CSSPropertyFloat) &amp;&amp; identifierForStyleProperty(*m_mutableStyle, CSSPropertyFloat) == CSSValueNone)
</ins><span class="cx">             m_mutableStyle-&gt;removeProperty(CSSPropertyFloat);
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -1405,11 +1408,11 @@
</span><span class="cx">     ComputedStyleExtractor computedStyle(node);
</span><span class="cx"> 
</span><span class="cx">     // FIXME: take care of background-color in effect
</span><del>-    RefPtr&lt;MutableStyleProperties&gt; mutableStyle = getPropertiesNotIn(style-&gt;style(), &amp;computedStyle);
</del><ins>+    RefPtr&lt;MutableStyleProperties&gt; mutableStyle = getPropertiesNotIn(*style-&gt;style(), computedStyle);
</ins><span class="cx"> 
</span><span class="cx">     reconcileTextDecorationProperties(mutableStyle.get());
</span><span class="cx">     if (!document-&gt;frame()-&gt;editor().shouldStyleWithCSS())
</span><del>-        extractTextStyles(document, mutableStyle.get(), computedStyle.useFixedFontDefaultSize());
</del><ins>+        extractTextStyles(document, *mutableStyle, computedStyle.useFixedFontDefaultSize());
</ins><span class="cx"> 
</span><span class="cx">     // Changing the whitespace style in a tab span would collapse the tab into a space.
</span><span class="cx">     if (isTabSpanTextNode(position.deprecatedNode()) || isTabSpanNode((position.deprecatedNode())))
</span><span class="lines">@@ -1424,34 +1427,32 @@
</span><span class="cx">     m_cssStyle = mutableStyle-&gt;asText().stripWhiteSpace();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void setTextDecorationProperty(MutableStyleProperties* style, const CSSValueList* newTextDecoration, CSSPropertyID propertyID)
</del><ins>+static void setTextDecorationProperty(MutableStyleProperties&amp; style, const CSSValueList* newTextDecoration, CSSPropertyID propertyID)
</ins><span class="cx"> {
</span><span class="cx">     if (newTextDecoration-&gt;length())
</span><del>-        style-&gt;setProperty(propertyID, newTextDecoration-&gt;cssText(), style-&gt;propertyIsImportant(propertyID));
</del><ins>+        style.setProperty(propertyID, newTextDecoration-&gt;cssText(), style.propertyIsImportant(propertyID));
</ins><span class="cx">     else {
</span><span class="cx">         // text-decoration: none is redundant since it does not remove any text decorations.
</span><del>-        style-&gt;removeProperty(propertyID);
</del><ins>+        style.removeProperty(propertyID);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void StyleChange::extractTextStyles(Document* document, MutableStyleProperties* style, bool shouldUseFixedFontDefaultSize)
</del><ins>+void StyleChange::extractTextStyles(Document* document, MutableStyleProperties&amp; style, bool shouldUseFixedFontDefaultSize)
</ins><span class="cx"> {
</span><del>-    ASSERT(style);
-
</del><span class="cx">     if (identifierForStyleProperty(style, CSSPropertyFontWeight) == CSSValueBold) {
</span><del>-        style-&gt;removeProperty(CSSPropertyFontWeight);
</del><ins>+        style.removeProperty(CSSPropertyFontWeight);
</ins><span class="cx">         m_applyBold = true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     int fontStyle = identifierForStyleProperty(style, CSSPropertyFontStyle);
</span><span class="cx">     if (fontStyle == CSSValueItalic || fontStyle == CSSValueOblique) {
</span><del>-        style-&gt;removeProperty(CSSPropertyFontStyle);
</del><ins>+        style.removeProperty(CSSPropertyFontStyle);
</ins><span class="cx">         m_applyItalic = true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Assuming reconcileTextDecorationProperties has been called, there should not be -webkit-text-decorations-in-effect
</span><span class="cx">     // Furthermore, text-decoration: none has been trimmed so that text-decoration property is always a CSSValueList.
</span><del>-    RefPtr&lt;CSSValue&gt; textDecoration = style-&gt;getPropertyCSSValue(CSSPropertyTextDecoration);
</del><ins>+    RefPtr&lt;CSSValue&gt; textDecoration = style.getPropertyCSSValue(CSSPropertyTextDecoration);
</ins><span class="cx">     if (is&lt;CSSValueList&gt;(textDecoration.get())) {
</span><span class="cx">         RefPtr&lt;CSSPrimitiveValue&gt; underline = cssValuePool().createIdentifierValue(CSSValueUnderline);
</span><span class="cx">         RefPtr&lt;CSSPrimitiveValue&gt; lineThrough = cssValuePool().createIdentifierValue(CSSValueLineThrough);
</span><span class="lines">@@ -1469,39 +1470,39 @@
</span><span class="cx">     int verticalAlign = identifierForStyleProperty(style, CSSPropertyVerticalAlign);
</span><span class="cx">     switch (verticalAlign) {
</span><span class="cx">     case CSSValueSub:
</span><del>-        style-&gt;removeProperty(CSSPropertyVerticalAlign);
</del><ins>+        style.removeProperty(CSSPropertyVerticalAlign);
</ins><span class="cx">         m_applySubscript = true;
</span><span class="cx">         break;
</span><span class="cx">     case CSSValueSuper:
</span><del>-        style-&gt;removeProperty(CSSPropertyVerticalAlign);
</del><ins>+        style.removeProperty(CSSPropertyVerticalAlign);
</ins><span class="cx">         m_applySuperscript = true;
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (style-&gt;getPropertyCSSValue(CSSPropertyColor)) {
</del><ins>+    if (style.getPropertyCSSValue(CSSPropertyColor)) {
</ins><span class="cx">         m_applyFontColor = Color(textColorFromStyle(style)).serialized();
</span><del>-        style-&gt;removeProperty(CSSPropertyColor);
</del><ins>+        style.removeProperty(CSSPropertyColor);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    m_applyFontFace = style-&gt;getPropertyValue(CSSPropertyFontFamily);
</del><ins>+    m_applyFontFace = style.getPropertyValue(CSSPropertyFontFamily);
</ins><span class="cx">     // Remove single quotes for Outlook 2007 compatibility. See https://bugs.webkit.org/show_bug.cgi?id=79448
</span><span class="cx">     m_applyFontFace.replaceWithLiteral('\'', &quot;&quot;);
</span><del>-    style-&gt;removeProperty(CSSPropertyFontFamily);
</del><ins>+    style.removeProperty(CSSPropertyFontFamily);
</ins><span class="cx"> 
</span><del>-    if (RefPtr&lt;CSSValue&gt; fontSize = style-&gt;getPropertyCSSValue(CSSPropertyFontSize)) {
</del><ins>+    if (RefPtr&lt;CSSValue&gt; fontSize = style.getPropertyCSSValue(CSSPropertyFontSize)) {
</ins><span class="cx">         if (!is&lt;CSSPrimitiveValue&gt;(*fontSize))
</span><del>-            style-&gt;removeProperty(CSSPropertyFontSize); // Can't make sense of the number. Put no font size.
</del><ins>+            style.removeProperty(CSSPropertyFontSize); // Can't make sense of the number. Put no font size.
</ins><span class="cx">         else if (int legacyFontSize = legacyFontSizeFromCSSValue(document, downcast&lt;CSSPrimitiveValue&gt;(fontSize.get()),
</span><span class="cx">                 shouldUseFixedFontDefaultSize, UseLegacyFontSizeOnlyIfPixelValuesMatch)) {
</span><span class="cx">             m_applyFontSize = String::number(legacyFontSize);
</span><del>-            style-&gt;removeProperty(CSSPropertyFontSize);
</del><ins>+            style.removeProperty(CSSPropertyFontSize);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void diffTextDecorations(MutableStyleProperties* style, CSSPropertyID propertID, CSSValue* refTextDecoration)
</del><ins>+static void diffTextDecorations(MutableStyleProperties&amp; style, CSSPropertyID propertID, CSSValue* refTextDecoration)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;CSSValue&gt; textDecoration = style-&gt;getPropertyCSSValue(propertID);
</del><ins>+    RefPtr&lt;CSSValue&gt; textDecoration = style.getPropertyCSSValue(propertID);
</ins><span class="cx">     if (!is&lt;CSSValueList&gt;(textDecoration.get()) || !is&lt;CSSValueList&gt;(refTextDecoration))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -1514,14 +1515,14 @@
</span><span class="cx">     setTextDecorationProperty(style, newTextDecoration.get(), propertID);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool fontWeightIsBold(CSSValue* fontWeight)
</del><ins>+static bool fontWeightIsBold(CSSValue&amp; fontWeight)
</ins><span class="cx"> {
</span><span class="cx">     if (!is&lt;CSSPrimitiveValue&gt;(fontWeight))
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     // Because b tag can only bold text, there are only two states in plain html: bold and not bold.
</span><span class="cx">     // Collapse all other values to either one of these two states for editing purposes.
</span><del>-    switch (downcast&lt;CSSPrimitiveValue&gt;(*fontWeight).getValueID()) {
</del><ins>+    switch (downcast&lt;CSSPrimitiveValue&gt;(fontWeight).getValueID()) {
</ins><span class="cx">         case CSSValue100:
</span><span class="cx">         case CSSValue200:
</span><span class="cx">         case CSSValue300:
</span><span class="lines">@@ -1544,41 +1545,41 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename T&gt;
</span><del>-static bool fontWeightIsBold(T* style)
</del><ins>+static bool fontWeightIsBold(T&amp; style)
</ins><span class="cx"> {
</span><del>-    return fontWeightIsBold(extractPropertyValue(style, CSSPropertyFontWeight).get());
</del><ins>+    RefPtr&lt;CSSValue&gt; fontWeight = extractPropertyValue(style, CSSPropertyFontWeight);
+    return fontWeight &amp;&amp; fontWeightIsBold(*fontWeight);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename T&gt;
</span><del>-static PassRefPtr&lt;MutableStyleProperties&gt; extractPropertiesNotIn(StyleProperties* styleWithRedundantProperties, T* baseStyle)
</del><ins>+static PassRefPtr&lt;MutableStyleProperties&gt; extractPropertiesNotIn(StyleProperties&amp; styleWithRedundantProperties, T&amp; baseStyle)
</ins><span class="cx"> {
</span><del>-    ASSERT(styleWithRedundantProperties);
-    RefPtr&lt;EditingStyle&gt; result = EditingStyle::create(styleWithRedundantProperties);
-    result-&gt;removeEquivalentProperties(*baseStyle);
</del><ins>+    RefPtr&lt;EditingStyle&gt; result = EditingStyle::create(&amp;styleWithRedundantProperties);
+    result-&gt;removeEquivalentProperties(baseStyle);
</ins><span class="cx">     RefPtr&lt;MutableStyleProperties&gt; mutableStyle = result-&gt;style();
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;CSSValue&gt; baseTextDecorationsInEffect = extractPropertyValue(baseStyle, CSSPropertyWebkitTextDecorationsInEffect);
</span><del>-    diffTextDecorations(mutableStyle.get(), CSSPropertyTextDecoration, baseTextDecorationsInEffect.get());
-    diffTextDecorations(mutableStyle.get(), CSSPropertyWebkitTextDecorationsInEffect, baseTextDecorationsInEffect.get());
</del><ins>+    diffTextDecorations(*mutableStyle, CSSPropertyTextDecoration, baseTextDecorationsInEffect.get());
+    diffTextDecorations(*mutableStyle, CSSPropertyWebkitTextDecorationsInEffect, baseTextDecorationsInEffect.get());
</ins><span class="cx"> 
</span><del>-    if (extractPropertyValue(baseStyle, CSSPropertyFontWeight) &amp;&amp; fontWeightIsBold(mutableStyle.get()) == fontWeightIsBold(baseStyle))
</del><ins>+    if (extractPropertyValue(baseStyle, CSSPropertyFontWeight) &amp;&amp; fontWeightIsBold(*mutableStyle) == fontWeightIsBold(baseStyle))
</ins><span class="cx">         mutableStyle-&gt;removeProperty(CSSPropertyFontWeight);
</span><span class="cx"> 
</span><del>-    if (extractPropertyValue(baseStyle, CSSPropertyColor) &amp;&amp; textColorFromStyle(mutableStyle.get()) == textColorFromStyle(baseStyle))
</del><ins>+    if (extractPropertyValue(baseStyle, CSSPropertyColor) &amp;&amp; textColorFromStyle(*mutableStyle) == textColorFromStyle(baseStyle))
</ins><span class="cx">         mutableStyle-&gt;removeProperty(CSSPropertyColor);
</span><span class="cx"> 
</span><span class="cx">     if (extractPropertyValue(baseStyle, CSSPropertyTextAlign)
</span><del>-        &amp;&amp; textAlignResolvingStartAndEnd(mutableStyle.get()) == textAlignResolvingStartAndEnd(baseStyle))
</del><ins>+        &amp;&amp; textAlignResolvingStartAndEnd(*mutableStyle) == textAlignResolvingStartAndEnd(baseStyle))
</ins><span class="cx">         mutableStyle-&gt;removeProperty(CSSPropertyTextAlign);
</span><span class="cx"> 
</span><del>-    if (extractPropertyValue(baseStyle, CSSPropertyBackgroundColor) &amp;&amp; backgroundColorFromStyle(mutableStyle.get()) == backgroundColorFromStyle(baseStyle))
</del><ins>+    if (extractPropertyValue(baseStyle, CSSPropertyBackgroundColor) &amp;&amp; backgroundColorFromStyle(*mutableStyle) == backgroundColorFromStyle(baseStyle))
</ins><span class="cx">         mutableStyle-&gt;removeProperty(CSSPropertyBackgroundColor);
</span><span class="cx"> 
</span><span class="cx">     return mutableStyle.release();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename T&gt;
</span><del>-PassRefPtr&lt;MutableStyleProperties&gt; getPropertiesNotIn(StyleProperties* styleWithRedundantProperties, T* baseStyle)
</del><ins>+PassRefPtr&lt;MutableStyleProperties&gt; getPropertiesNotIn(StyleProperties&amp; styleWithRedundantProperties, T&amp; baseStyle)
</ins><span class="cx"> {
</span><span class="cx">     return extractPropertiesNotIn(styleWithRedundantProperties, baseStyle);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditingStyleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/EditingStyle.h (176667 => 176668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/EditingStyle.h        2014-12-02 17:33:43 UTC (rev 176667)
+++ trunk/Source/WebCore/editing/EditingStyle.h        2014-12-02 17:59:18 UTC (rev 176668)
</span><span class="lines">@@ -157,7 +157,7 @@
</span><span class="cx">     void removeTextFillAndStrokeColorsIfNeeded(RenderStyle*);
</span><span class="cx">     void setProperty(CSSPropertyID, const String&amp; value, bool important = false);
</span><span class="cx">     void extractFontSizeDelta();
</span><del>-    template&lt;typename T&gt; TriState triStateOfStyle(T* styleToCompare, ShouldIgnoreTextOnlyProperties) const;
</del><ins>+    template&lt;typename T&gt; TriState triStateOfStyle(T&amp; styleToCompare, ShouldIgnoreTextOnlyProperties) const;
</ins><span class="cx">     bool conflictsWithInlineStyleOfElement(StyledElement*, EditingStyle* extractedStyle, Vector&lt;CSSPropertyID&gt;* conflictingProperties) const;
</span><span class="cx">     void mergeInlineAndImplicitStyleOfElement(StyledElement*, CSSPropertyOverrideMode, PropertiesToInclude);
</span><span class="cx">     void mergeStyle(const StyleProperties*, CSSPropertyOverrideMode);
</span><span class="lines">@@ -216,7 +216,7 @@
</span><span class="cx">         return !(*this == other);
</span><span class="cx">     }
</span><span class="cx"> private:
</span><del>-    void extractTextStyles(Document*, MutableStyleProperties*, bool shouldUseFixedFontDefaultSize);
</del><ins>+    void extractTextStyles(Document*, MutableStyleProperties&amp;, bool shouldUseFixedFontDefaultSize);
</ins><span class="cx"> 
</span><span class="cx">     String m_cssStyle;
</span><span class="cx">     bool m_applyBold;
</span></span></pre>
</div>
</div>

</body>
</html>