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

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

Issue 1164573002: CSSValue Immediates: Change CSSValue to an object instead of a pointer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 5 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/CSSComputedStyleDeclaration.h ('k') | Source/core/css/CSSContentDistributionValue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSComputedStyleDeclaration.cpp
diff --git a/Source/core/css/CSSComputedStyleDeclaration.cpp b/Source/core/css/CSSComputedStyleDeclaration.cpp
index df84903ef27a30ab300efc8405dd9e60968ed193..efb9963d1792cab24c422a8205be7a0f940a75da 100644
--- a/Source/core/css/CSSComputedStyleDeclaration.cpp
+++ b/Source/core/css/CSSComputedStyleDeclaration.cpp
@@ -415,7 +415,7 @@ inline static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> zoomAdjustedPixelValue(d
return cssValuePool().createValue(adjustFloatForAbsoluteZoom(value, style), CSSPrimitiveValue::CSS_PX);
}
-PassRefPtrWillBeRawPtr<CSSValue> CSSComputedStyleDeclaration::getFontSizeCSSValuePreferringKeyword() const
+NullableCSSValue CSSComputedStyleDeclaration::getFontSizeCSSValuePreferringKeyword() const
{
if (!m_node)
return nullptr;
@@ -535,7 +535,7 @@ Node* CSSComputedStyleDeclaration::styledNode() const
return m_node.get();
}
-PassRefPtrWillBeRawPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropertyID propertyID) const
+NullableCSSValue CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropertyID propertyID) const
{
Node* styledNode = this->styledNode();
if (!styledNode)
@@ -571,9 +571,9 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValu
if (!style)
return nullptr;
- RefPtrWillBeRawPtr<CSSValue> value = ComputedStyleCSSValueMapping::get(propertyID, *style, layoutObject, styledNode, m_allowVisitedStyle);
+ NullableCSSValue value = ComputedStyleCSSValueMapping::get(propertyID, *style, layoutObject, styledNode, m_allowVisitedStyle);
if (value)
- return value;
+ return *value;
logUnimplementedPropertyID(propertyID);
return nullptr;
@@ -581,7 +581,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValu
String CSSComputedStyleDeclaration::getPropertyValue(CSSPropertyID propertyID) const
{
- RefPtrWillBeRawPtr<CSSValue> value = getPropertyCSSValue(propertyID);
+ NullableCSSValue value = getPropertyCSSValue(propertyID);
if (value)
return value->cssText();
return "";
@@ -603,20 +603,20 @@ String CSSComputedStyleDeclaration::item(unsigned i) const
return getPropertyNameString(computableProperties()[i]);
}
-bool CSSComputedStyleDeclaration::cssPropertyMatches(CSSPropertyID propertyID, const CSSValue* propertyValue) const
+bool CSSComputedStyleDeclaration::cssPropertyMatches(CSSPropertyID propertyID, const CSSValue propertyValue) const
{
- if (propertyID == CSSPropertyFontSize && propertyValue->isPrimitiveValue() && m_node) {
+ if (propertyID == CSSPropertyFontSize && propertyValue.isPrimitiveValue() && m_node) {
m_node->document().updateLayoutIgnorePendingStylesheets();
const ComputedStyle* style = m_node->ensureComputedStyle(m_pseudoElementSpecifier);
if (style && style->fontDescription().keywordSize()) {
CSSValueID sizeValue = cssIdentifierForFontSizeKeyword(style->fontDescription().keywordSize());
- const CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(propertyValue);
- if (primitiveValue->isValueID() && primitiveValue->getValueID() == sizeValue)
+ const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(propertyValue);
+ if (primitiveValue.isValueID() && primitiveValue.getValueID() == sizeValue)
return true;
}
}
- RefPtrWillBeRawPtr<CSSValue> value = getPropertyCSSValue(propertyID);
- return value && propertyValue && value->equals(*propertyValue);
+ NullableCSSValue value = getPropertyCSSValue(propertyID);
+ return value && value->equals(propertyValue);
}
PassRefPtrWillBeRawPtr<MutableStylePropertySet> CSSComputedStyleDeclaration::copyProperties() const
@@ -629,9 +629,9 @@ PassRefPtrWillBeRawPtr<MutableStylePropertySet> CSSComputedStyleDeclaration::cop
WillBeHeapVector<CSSProperty, 256> list;
list.reserveInitialCapacity(properties.size());
for (unsigned i = 0; i < properties.size(); ++i) {
- RefPtrWillBeRawPtr<CSSValue> value = getPropertyCSSValue(properties[i]);
+ NullableCSSValue value = getPropertyCSSValue(properties[i]);
if (value)
- list.append(CSSProperty(properties[i], value.release(), false));
+ list.append(CSSProperty(properties[i], *value, false));
}
return MutableStylePropertySet::create(list.data(), list.size());
}
@@ -677,7 +677,7 @@ String CSSComputedStyleDeclaration::removeProperty(const String& name, Exception
return String();
}
-PassRefPtrWillBeRawPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValueInternal(CSSPropertyID propertyID)
+NullableCSSValue CSSComputedStyleDeclaration::getPropertyCSSValueInternal(CSSPropertyID propertyID)
{
return getPropertyCSSValue(propertyID);
}
« no previous file with comments | « Source/core/css/CSSComputedStyleDeclaration.h ('k') | Source/core/css/CSSContentDistributionValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698