Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(410)

Unified Diff: Source/core/css/PropertySetCSSStyleDeclaration.cpp

Issue 181783005: Have Element::ensureMutableInlineStyle() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/PropertySetCSSStyleDeclaration.h ('k') | Source/core/css/StylePropertySet.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/PropertySetCSSStyleDeclaration.cpp
diff --git a/Source/core/css/PropertySetCSSStyleDeclaration.cpp b/Source/core/css/PropertySetCSSStyleDeclaration.cpp
index 27a9a3946f6e5a6c79e364f2e09cd22b5d35ccd5..0f09c427ed04bc072e98aa5d998486bbcd29de03 100644
--- a/Source/core/css/PropertySetCSSStyleDeclaration.cpp
+++ b/Source/core/css/PropertySetCSSStyleDeclaration.cpp
@@ -137,19 +137,19 @@ void PropertySetCSSStyleDeclaration::deref()
unsigned AbstractPropertySetCSSStyleDeclaration::length() const
{
- return propertySet()->propertyCount();
+ return propertySet().propertyCount();
}
String AbstractPropertySetCSSStyleDeclaration::item(unsigned i) const
{
- if (i >= propertySet()->propertyCount())
+ if (i >= propertySet().propertyCount())
return "";
- return propertySet()->propertyAt(i).cssName();
+ return propertySet().propertyAt(i).cssName();
}
String AbstractPropertySetCSSStyleDeclaration::cssText() const
{
- return propertySet()->asText();
+ return propertySet().asText();
}
void AbstractPropertySetCSSStyleDeclaration::setCSSText(const String& text, ExceptionState& exceptionState)
@@ -158,7 +158,7 @@ void AbstractPropertySetCSSStyleDeclaration::setCSSText(const String& text, Exce
willMutate();
// FIXME: Detect syntax errors and set exceptionState.
- propertySet()->parseDeclaration(text, contextStyleSheet());
+ propertySet().parseDeclaration(text, contextStyleSheet());
didMutate(PropertyChanged);
@@ -170,7 +170,7 @@ PassRefPtrWillBeRawPtr<CSSValue> AbstractPropertySetCSSStyleDeclaration::getProp
CSSPropertyID propertyID = cssPropertyID(propertyName);
if (!propertyID)
return nullptr;
- return cloneAndCacheForCSSOM(propertySet()->getPropertyCSSValue(propertyID).get());
+ return cloneAndCacheForCSSOM(propertySet().getPropertyCSSValue(propertyID).get());
}
String AbstractPropertySetCSSStyleDeclaration::getPropertyValue(const String &propertyName)
@@ -178,7 +178,7 @@ String AbstractPropertySetCSSStyleDeclaration::getPropertyValue(const String &pr
CSSPropertyID propertyID = cssPropertyID(propertyName);
if (!propertyID)
return String();
- return propertySet()->getPropertyValue(propertyID);
+ return propertySet().getPropertyValue(propertyID);
}
String AbstractPropertySetCSSStyleDeclaration::getPropertyPriority(const String& propertyName)
@@ -186,7 +186,7 @@ String AbstractPropertySetCSSStyleDeclaration::getPropertyPriority(const String&
CSSPropertyID propertyID = cssPropertyID(propertyName);
if (!propertyID)
return String();
- return propertySet()->propertyIsImportant(propertyID) ? "important" : "";
+ return propertySet().propertyIsImportant(propertyID) ? "important" : "";
}
String AbstractPropertySetCSSStyleDeclaration::getPropertyShorthand(const String& propertyName)
@@ -194,7 +194,7 @@ String AbstractPropertySetCSSStyleDeclaration::getPropertyShorthand(const String
CSSPropertyID propertyID = cssPropertyID(propertyName);
if (!propertyID)
return String();
- CSSPropertyID shorthandID = propertySet()->getPropertyShorthand(propertyID);
+ CSSPropertyID shorthandID = propertySet().getPropertyShorthand(propertyID);
if (!shorthandID)
return String();
return getPropertyNameString(shorthandID);
@@ -205,7 +205,7 @@ bool AbstractPropertySetCSSStyleDeclaration::isPropertyImplicit(const String& pr
CSSPropertyID propertyID = cssPropertyID(propertyName);
if (!propertyID)
return false;
- return propertySet()->isPropertyImplicit(propertyID);
+ return propertySet().isPropertyImplicit(propertyID);
}
void AbstractPropertySetCSSStyleDeclaration::setProperty(const String& propertyName, const String& value, const String& priority, ExceptionState& exceptionState)
@@ -221,7 +221,7 @@ void AbstractPropertySetCSSStyleDeclaration::setProperty(const String& propertyN
willMutate();
- bool changed = propertySet()->setProperty(propertyID, value, important, contextStyleSheet());
+ bool changed = propertySet().setProperty(propertyID, value, important, contextStyleSheet());
didMutate(changed ? PropertyChanged : NoChanges);
@@ -242,7 +242,7 @@ String AbstractPropertySetCSSStyleDeclaration::removeProperty(const String& prop
willMutate();
String result;
- bool changed = propertySet()->removeProperty(propertyID, &result);
+ bool changed = propertySet().removeProperty(propertyID, &result);
didMutate(changed ? PropertyChanged : NoChanges);
@@ -253,12 +253,12 @@ String AbstractPropertySetCSSStyleDeclaration::removeProperty(const String& prop
PassRefPtrWillBeRawPtr<CSSValue> AbstractPropertySetCSSStyleDeclaration::getPropertyCSSValueInternal(CSSPropertyID propertyID)
{
- return propertySet()->getPropertyCSSValue(propertyID);
+ return propertySet().getPropertyCSSValue(propertyID);
}
String AbstractPropertySetCSSStyleDeclaration::getPropertyValueInternal(CSSPropertyID propertyID)
{
- return propertySet()->getPropertyValue(propertyID);
+ return propertySet().getPropertyValue(propertyID);
}
void AbstractPropertySetCSSStyleDeclaration::setPropertyInternal(CSSPropertyID propertyID, const String& value, bool important, ExceptionState&)
@@ -266,7 +266,7 @@ void AbstractPropertySetCSSStyleDeclaration::setPropertyInternal(CSSPropertyID p
StyleAttributeMutationScope mutationScope(this);
willMutate();
- bool changed = propertySet()->setProperty(propertyID, value, important, contextStyleSheet());
+ bool changed = propertySet().setProperty(propertyID, value, important, contextStyleSheet());
didMutate(changed ? PropertyChanged : NoChanges);
@@ -298,15 +298,15 @@ StyleSheetContents* AbstractPropertySetCSSStyleDeclaration::contextStyleSheet()
PassRefPtr<MutableStylePropertySet> AbstractPropertySetCSSStyleDeclaration::copyProperties() const
{
- return propertySet()->mutableCopy();
+ return propertySet().mutableCopy();
}
bool AbstractPropertySetCSSStyleDeclaration::cssPropertyMatches(CSSPropertyID propertyID, const CSSValue* propertyValue) const
{
- return propertySet()->propertyMatches(propertyID, propertyValue);
+ return propertySet().propertyMatches(propertyID, propertyValue);
}
-StyleRuleCSSStyleDeclaration::StyleRuleCSSStyleDeclaration(MutableStylePropertySet* propertySetArg, CSSRule* parentRule)
+StyleRuleCSSStyleDeclaration::StyleRuleCSSStyleDeclaration(MutableStylePropertySet& propertySetArg, CSSRule* parentRule)
: PropertySetCSSStyleDeclaration(propertySetArg)
, m_refCount(1)
, m_parentRule(parentRule)
@@ -352,15 +352,14 @@ CSSStyleSheet* StyleRuleCSSStyleDeclaration::parentStyleSheet() const
return m_parentRule ? m_parentRule->parentStyleSheet() : 0;
}
-void StyleRuleCSSStyleDeclaration::reattach(MutableStylePropertySet* propertySet)
+void StyleRuleCSSStyleDeclaration::reattach(MutableStylePropertySet& propertySet)
{
- ASSERT(propertySet);
m_propertySet->deref();
- m_propertySet = propertySet;
+ m_propertySet = &propertySet;
m_propertySet->ref();
}
-MutableStylePropertySet* InlineCSSStyleDeclaration::propertySet() const
+MutableStylePropertySet& InlineCSSStyleDeclaration::propertySet() const
{
return m_parentElement->ensureMutableInlineStyle();
}
« no previous file with comments | « Source/core/css/PropertySetCSSStyleDeclaration.h ('k') | Source/core/css/StylePropertySet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698