<!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 <tmeszaros.u-szeged@partner.samsung.com> 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 <tmeszaros.u-szeged@partner.samsung.com>
+
+ 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 <b.gajda@samsung.com>
</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<CSSValue> extractPropertyValue(const StyleProperties* style, CSSPropertyID propertyID)
</del><ins>+static PassRefPtr<CSSValue> extractPropertyValue(const StyleProperties& style, CSSPropertyID propertyID)
</ins><span class="cx"> {
</span><del>- return style ? style->getPropertyCSSValue(propertyID) : PassRefPtr<CSSValue>();
</del><ins>+ return style.getPropertyCSSValue(propertyID);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-static PassRefPtr<CSSValue> extractPropertyValue(ComputedStyleExtractor* computedStyle, CSSPropertyID propertyID)
</del><ins>+static PassRefPtr<CSSValue> extractPropertyValue(ComputedStyleExtractor& computedStyle, CSSPropertyID propertyID)
</ins><span class="cx"> {
</span><del>- return computedStyle->propertyValue(propertyID);
</del><ins>+ return computedStyle.propertyValue(propertyID);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> template<typename T>
</span><del>-int identifierForStyleProperty(T* style, CSSPropertyID propertyID)
</del><ins>+int identifierForStyleProperty(T& style, CSSPropertyID propertyID)
</ins><span class="cx"> {
</span><span class="cx"> RefPtr<CSSValue> value = extractPropertyValue(style, propertyID);
</span><span class="cx"> if (!is<CSSPrimitiveValue>(value.get()))
</span><span class="lines">@@ -147,7 +147,7 @@
</span><span class="cx"> return downcast<CSSPrimitiveValue>(*value).getValueID();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-template<typename T> PassRefPtr<MutableStyleProperties> getPropertiesNotIn(StyleProperties* styleWithRedundantProperties, T* baseStyle);
</del><ins>+template<typename T> PassRefPtr<MutableStyleProperties> getPropertiesNotIn(StyleProperties& styleWithRedundantProperties, T& 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<typename T>
</span><del>-static inline RGBA32 textColorFromStyle(T* style)
</del><ins>+static inline RGBA32 textColorFromStyle(T& 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<typename T>
</span><del>-static inline RGBA32 backgroundColorFromStyle(T* style)
</del><ins>+static inline RGBA32 backgroundColorFromStyle(T& 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<typename T>
</span><del>-static int textAlignResolvingStartAndEnd(T* style)
</del><ins>+static int textAlignResolvingStartAndEnd(T& 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->m_mutableStyle)
</span><span class="cx"> return FalseTriState;
</span><del>- return triStateOfStyle(style->m_mutableStyle.get(), DoNotIgnoreTextOnlyProperties);
</del><ins>+ return triStateOfStyle(*style->m_mutableStyle, DoNotIgnoreTextOnlyProperties);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> template<typename T>
</span><del>-TriState EditingStyle::triStateOfStyle(T* styleToCompare, ShouldIgnoreTextOnlyProperties shouldIgnoreTextOnlyProperties) const
</del><ins>+TriState EditingStyle::triStateOfStyle(T& styleToCompare, ShouldIgnoreTextOnlyProperties shouldIgnoreTextOnlyProperties) const
</ins><span class="cx"> {
</span><del>- RefPtr<MutableStyleProperties> difference = getPropertiesNotIn(m_mutableStyle.get(), styleToCompare);
</del><ins>+ if (!m_mutableStyle)
+ return TrueTriState;
</ins><span class="cx">
</span><ins>+ RefPtr<MutableStyleProperties> difference = getPropertiesNotIn(*m_mutableStyle, styleToCompare);
+
</ins><span class="cx"> if (shouldIgnoreTextOnlyProperties == IgnoreTextOnlyProperties)
</span><span class="cx"> difference->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->renderer() && node->hasEditableStyle()) {
</span><span class="cx"> ComputedStyleExtractor computedStyle(node);
</span><del>- TriState nodeState = triStateOfStyle(&computedStyle, node->isTextNode() ? EditingStyle::DoNotIgnoreTextOnlyProperties : EditingStyle::IgnoreTextOnlyProperties);
</del><ins>+ TriState nodeState = triStateOfStyle(computedStyle, node->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(), &computedStyle)->isEmpty();
</del><ins>+ return getPropertiesNotIn(*m_mutableStyle, computedStyle)->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->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->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<MutableStyleProperties> styleFromMatchedRules = styleFromMatchedRulesForElement(element, StyleResolver::AllButEmptyCSSRules);
</span><span class="cx"> if (styleFromMatchedRules && !styleFromMatchedRules->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<EditingStyle> computedStyle = EditingStyle::create(context, EditingPropertiesInEffect);
</span><span class="lines">@@ -1170,15 +1173,15 @@
</span><span class="cx"> computedStyle->m_mutableStyle->setProperty(CSSPropertyBackgroundColor, CSSValueTransparent);
</span><span class="cx">
</span><span class="cx"> removePropertiesInStyle(computedStyle->m_mutableStyle.get(), styleFromMatchedRules.get());
</span><del>- m_mutableStyle = getPropertiesNotIn(m_mutableStyle.get(), computedStyle->m_mutableStyle.get());
</del><ins>+ m_mutableStyle = getPropertiesNotIn(*m_mutableStyle, *computedStyle->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->getPropertyCSSValue(CSSPropertyDisplay) && identifierForStyleProperty(m_mutableStyle.get(), CSSPropertyDisplay) == CSSValueInline)
</del><ins>+ if (!styleFromMatchedRules->getPropertyCSSValue(CSSPropertyDisplay) && identifierForStyleProperty(*m_mutableStyle, CSSPropertyDisplay) == CSSValueInline)
</ins><span class="cx"> m_mutableStyle->removeProperty(CSSPropertyDisplay);
</span><del>- if (!styleFromMatchedRules->getPropertyCSSValue(CSSPropertyFloat) && identifierForStyleProperty(m_mutableStyle.get(), CSSPropertyFloat) == CSSValueNone)
</del><ins>+ if (!styleFromMatchedRules->getPropertyCSSValue(CSSPropertyFloat) && identifierForStyleProperty(*m_mutableStyle, CSSPropertyFloat) == CSSValueNone)
</ins><span class="cx"> m_mutableStyle->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<MutableStyleProperties> mutableStyle = getPropertiesNotIn(style->style(), &computedStyle);
</del><ins>+ RefPtr<MutableStyleProperties> mutableStyle = getPropertiesNotIn(*style->style(), computedStyle);
</ins><span class="cx">
</span><span class="cx"> reconcileTextDecorationProperties(mutableStyle.get());
</span><span class="cx"> if (!document->frame()->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->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& style, const CSSValueList* newTextDecoration, CSSPropertyID propertyID)
</ins><span class="cx"> {
</span><span class="cx"> if (newTextDecoration->length())
</span><del>- style->setProperty(propertyID, newTextDecoration->cssText(), style->propertyIsImportant(propertyID));
</del><ins>+ style.setProperty(propertyID, newTextDecoration->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->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& style, bool shouldUseFixedFontDefaultSize)
</ins><span class="cx"> {
</span><del>- ASSERT(style);
-
</del><span class="cx"> if (identifierForStyleProperty(style, CSSPropertyFontWeight) == CSSValueBold) {
</span><del>- style->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->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<CSSValue> textDecoration = style->getPropertyCSSValue(CSSPropertyTextDecoration);
</del><ins>+ RefPtr<CSSValue> textDecoration = style.getPropertyCSSValue(CSSPropertyTextDecoration);
</ins><span class="cx"> if (is<CSSValueList>(textDecoration.get())) {
</span><span class="cx"> RefPtr<CSSPrimitiveValue> underline = cssValuePool().createIdentifierValue(CSSValueUnderline);
</span><span class="cx"> RefPtr<CSSPrimitiveValue> 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->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->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->getPropertyCSSValue(CSSPropertyColor)) {
</del><ins>+ if (style.getPropertyCSSValue(CSSPropertyColor)) {
</ins><span class="cx"> m_applyFontColor = Color(textColorFromStyle(style)).serialized();
</span><del>- style->removeProperty(CSSPropertyColor);
</del><ins>+ style.removeProperty(CSSPropertyColor);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- m_applyFontFace = style->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('\'', "");
</span><del>- style->removeProperty(CSSPropertyFontFamily);
</del><ins>+ style.removeProperty(CSSPropertyFontFamily);
</ins><span class="cx">
</span><del>- if (RefPtr<CSSValue> fontSize = style->getPropertyCSSValue(CSSPropertyFontSize)) {
</del><ins>+ if (RefPtr<CSSValue> fontSize = style.getPropertyCSSValue(CSSPropertyFontSize)) {
</ins><span class="cx"> if (!is<CSSPrimitiveValue>(*fontSize))
</span><del>- style->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<CSSPrimitiveValue>(fontSize.get()),
</span><span class="cx"> shouldUseFixedFontDefaultSize, UseLegacyFontSizeOnlyIfPixelValuesMatch)) {
</span><span class="cx"> m_applyFontSize = String::number(legacyFontSize);
</span><del>- style->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& style, CSSPropertyID propertID, CSSValue* refTextDecoration)
</ins><span class="cx"> {
</span><del>- RefPtr<CSSValue> textDecoration = style->getPropertyCSSValue(propertID);
</del><ins>+ RefPtr<CSSValue> textDecoration = style.getPropertyCSSValue(propertID);
</ins><span class="cx"> if (!is<CSSValueList>(textDecoration.get()) || !is<CSSValueList>(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& fontWeight)
</ins><span class="cx"> {
</span><span class="cx"> if (!is<CSSPrimitiveValue>(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<CSSPrimitiveValue>(*fontWeight).getValueID()) {
</del><ins>+ switch (downcast<CSSPrimitiveValue>(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<typename T>
</span><del>-static bool fontWeightIsBold(T* style)
</del><ins>+static bool fontWeightIsBold(T& style)
</ins><span class="cx"> {
</span><del>- return fontWeightIsBold(extractPropertyValue(style, CSSPropertyFontWeight).get());
</del><ins>+ RefPtr<CSSValue> fontWeight = extractPropertyValue(style, CSSPropertyFontWeight);
+ return fontWeight && fontWeightIsBold(*fontWeight);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> template<typename T>
</span><del>-static PassRefPtr<MutableStyleProperties> extractPropertiesNotIn(StyleProperties* styleWithRedundantProperties, T* baseStyle)
</del><ins>+static PassRefPtr<MutableStyleProperties> extractPropertiesNotIn(StyleProperties& styleWithRedundantProperties, T& baseStyle)
</ins><span class="cx"> {
</span><del>- ASSERT(styleWithRedundantProperties);
- RefPtr<EditingStyle> result = EditingStyle::create(styleWithRedundantProperties);
- result->removeEquivalentProperties(*baseStyle);
</del><ins>+ RefPtr<EditingStyle> result = EditingStyle::create(&styleWithRedundantProperties);
+ result->removeEquivalentProperties(baseStyle);
</ins><span class="cx"> RefPtr<MutableStyleProperties> mutableStyle = result->style();
</span><span class="cx">
</span><span class="cx"> RefPtr<CSSValue> 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) && fontWeightIsBold(mutableStyle.get()) == fontWeightIsBold(baseStyle))
</del><ins>+ if (extractPropertyValue(baseStyle, CSSPropertyFontWeight) && fontWeightIsBold(*mutableStyle) == fontWeightIsBold(baseStyle))
</ins><span class="cx"> mutableStyle->removeProperty(CSSPropertyFontWeight);
</span><span class="cx">
</span><del>- if (extractPropertyValue(baseStyle, CSSPropertyColor) && textColorFromStyle(mutableStyle.get()) == textColorFromStyle(baseStyle))
</del><ins>+ if (extractPropertyValue(baseStyle, CSSPropertyColor) && textColorFromStyle(*mutableStyle) == textColorFromStyle(baseStyle))
</ins><span class="cx"> mutableStyle->removeProperty(CSSPropertyColor);
</span><span class="cx">
</span><span class="cx"> if (extractPropertyValue(baseStyle, CSSPropertyTextAlign)
</span><del>- && textAlignResolvingStartAndEnd(mutableStyle.get()) == textAlignResolvingStartAndEnd(baseStyle))
</del><ins>+ && textAlignResolvingStartAndEnd(*mutableStyle) == textAlignResolvingStartAndEnd(baseStyle))
</ins><span class="cx"> mutableStyle->removeProperty(CSSPropertyTextAlign);
</span><span class="cx">
</span><del>- if (extractPropertyValue(baseStyle, CSSPropertyBackgroundColor) && backgroundColorFromStyle(mutableStyle.get()) == backgroundColorFromStyle(baseStyle))
</del><ins>+ if (extractPropertyValue(baseStyle, CSSPropertyBackgroundColor) && backgroundColorFromStyle(*mutableStyle) == backgroundColorFromStyle(baseStyle))
</ins><span class="cx"> mutableStyle->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<typename T>
</span><del>-PassRefPtr<MutableStyleProperties> getPropertiesNotIn(StyleProperties* styleWithRedundantProperties, T* baseStyle)
</del><ins>+PassRefPtr<MutableStyleProperties> getPropertiesNotIn(StyleProperties& styleWithRedundantProperties, T& 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& value, bool important = false);
</span><span class="cx"> void extractFontSizeDelta();
</span><del>- template<typename T> TriState triStateOfStyle(T* styleToCompare, ShouldIgnoreTextOnlyProperties) const;
</del><ins>+ template<typename T> TriState triStateOfStyle(T& styleToCompare, ShouldIgnoreTextOnlyProperties) const;
</ins><span class="cx"> bool conflictsWithInlineStyleOfElement(StyledElement*, EditingStyle* extractedStyle, Vector<CSSPropertyID>* 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&, 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>