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

Unified Diff: third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp

Issue 2034013002: Make CSSComputedStyledeclaration::getPropertyCSSValue return const (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@_make_cssproperty_store_const
Patch Set: Rebase Created 4 years, 6 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
Index: third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp b/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp
index bab068756787f2186b9c3c0c01d77d3d9b2698ee..476cea750bbb3b65e4daf34028dd604e1f577e0f 100644
--- a/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp
+++ b/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp
@@ -401,7 +401,7 @@ inline static CSSPrimitiveValue* zoomAdjustedPixelValue(double value, const Comp
return CSSPrimitiveValue::create(adjustFloatForAbsoluteZoom(value, style), CSSPrimitiveValue::UnitType::Pixels);
}
-CSSValue* CSSComputedStyleDeclaration::getFontSizeCSSValuePreferringKeyword() const
+const CSSValue* CSSComputedStyleDeclaration::getFontSizeCSSValuePreferringKeyword() const
{
if (!m_node)
return nullptr;
@@ -514,7 +514,7 @@ Node* CSSComputedStyleDeclaration::styledNode() const
return m_node.get();
}
-CSSValue* CSSComputedStyleDeclaration::getPropertyCSSValue(AtomicString customPropertyName) const
+const CSSValue* CSSComputedStyleDeclaration::getPropertyCSSValue(AtomicString customPropertyName) const
{
Node* styledNode = this->styledNode();
if (!styledNode)
@@ -536,7 +536,7 @@ std::unique_ptr<HashMap<AtomicString, RefPtr<CSSVariableData>>> CSSComputedStyle
return ComputedStyleCSSValueMapping::getVariables(*style);
}
-CSSValue* CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropertyID propertyID) const
+const CSSValue* CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropertyID propertyID) const
{
Node* styledNode = this->styledNode();
if (!styledNode)
@@ -576,7 +576,7 @@ CSSValue* CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropertyID propert
String CSSComputedStyleDeclaration::getPropertyValue(CSSPropertyID propertyID) const
{
- CSSValue* value = getPropertyCSSValue(propertyID);
+ const CSSValue* value = getPropertyCSSValue(propertyID);
if (value)
return value->cssText();
return "";
@@ -610,7 +610,7 @@ bool CSSComputedStyleDeclaration::cssPropertyMatches(CSSPropertyID propertyID, c
return true;
}
}
- CSSValue* value = getPropertyCSSValue(propertyID);
+ const CSSValue* value = getPropertyCSSValue(propertyID);
return value && propertyValue && value->equals(*propertyValue);
}
@@ -624,7 +624,7 @@ MutableStylePropertySet* CSSComputedStyleDeclaration::copyPropertiesInSet(const
HeapVector<CSSProperty, 256> list;
list.reserveInitialCapacity(properties.size());
for (unsigned i = 0; i < properties.size(); ++i) {
- CSSValue* value = getPropertyCSSValue(properties[i]);
+ const CSSValue* value = getPropertyCSSValue(properties[i]);
if (value)
list.append(CSSProperty(properties[i], value, false));
}
@@ -641,7 +641,7 @@ String CSSComputedStyleDeclaration::getPropertyValue(const String& propertyName)
CSSPropertyID propertyID = cssPropertyID(propertyName);
if (!propertyID) {
if (RuntimeEnabledFeatures::cssVariablesEnabled() && CSSVariableParser::isValidVariableName(propertyName)) {
- CSSValue* value = getPropertyCSSValue(AtomicString(propertyName));
+ const CSSValue* value = getPropertyCSSValue(AtomicString(propertyName));
if (value)
return value->cssText();
}
@@ -678,7 +678,7 @@ String CSSComputedStyleDeclaration::removeProperty(const String& name, Exception
return String();
}
-CSSValue* CSSComputedStyleDeclaration::getPropertyCSSValueInternal(CSSPropertyID propertyID)
+const CSSValue* CSSComputedStyleDeclaration::getPropertyCSSValueInternal(CSSPropertyID propertyID)
{
return getPropertyCSSValue(propertyID);
}

Powered by Google App Engine
This is Rietveld 408576698