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

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

Issue 1190303003: CL for perf tryjob on win (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: CL for perf tryjob on mac Created 5 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
« 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 8e2570aaef7a9e927b0d9c8b0ce82ccae20890c7..77d5d0f09d058595c840834218b668dad80a614e 100644
--- a/Source/core/css/CSSComputedStyleDeclaration.cpp
+++ b/Source/core/css/CSSComputedStyleDeclaration.cpp
@@ -412,7 +412,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;
@@ -529,7 +529,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)
@@ -565,9 +565,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;
@@ -575,7 +575,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 "";
@@ -597,20 +597,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
@@ -623,9 +623,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());
}
@@ -671,7 +671,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