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

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

Issue 2346193002: Split CSSPrimitiveValue into CSSPrimitiveValue and CSSIdentifierValue (Closed)
Patch Set: Rebase please work Created 4 years, 3 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 1489935dda61b3d49b85ce06356f2bc97132f7ee..78962418e1598c1b888fc6fd7b2b743a3b680ccf 100644
--- a/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp
+++ b/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp
@@ -25,6 +25,7 @@
#include "bindings/core/v8/ExceptionState.h"
#include "core/CSSPropertyNames.h"
+#include "core/css/CSSIdentifierValue.h"
#include "core/css/CSSPrimitiveValue.h"
#include "core/css/CSSPrimitiveValueMappings.h"
#include "core/css/CSSPropertyIDTemplates.h"
@@ -412,7 +413,7 @@ const CSSValue* CSSComputedStyleDeclaration::getFontSizeCSSValuePreferringKeywor
return nullptr;
if (int keywordSize = style->getFontDescription().keywordSize())
- return CSSPrimitiveValue::createIdentifier(cssIdentifierForFontSizeKeyword(keywordSize));
+ return CSSIdentifierValue::create(cssIdentifierForFontSizeKeyword(keywordSize));
return zoomAdjustedPixelValue(style->getFontDescription().computedPixelSize(), *style);
@@ -599,13 +600,12 @@ String CSSComputedStyleDeclaration::item(unsigned i) const
bool CSSComputedStyleDeclaration::cssPropertyMatches(CSSPropertyID propertyID, const CSSValue* propertyValue) const
{
- if (propertyID == CSSPropertyFontSize && propertyValue->isPrimitiveValue() && m_node) {
+ if (propertyID == CSSPropertyFontSize && (propertyValue->isPrimitiveValue() || propertyValue->isIdentifierValue()) && m_node) {
m_node->document().updateStyleAndLayoutIgnorePendingStylesheets();
const ComputedStyle* style = m_node->ensureComputedStyle(m_pseudoElementSpecifier);
if (style && style->getFontDescription().keywordSize()) {
CSSValueID sizeValue = cssIdentifierForFontSizeKeyword(style->getFontDescription().keywordSize());
- const CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(propertyValue);
- if (primitiveValue->isValueID() && primitiveValue->getValueID() == sizeValue)
+ if (propertyValue->isIdentifierValue() && toCSSIdentifierValue(propertyValue)->getValueID() == sizeValue)
return true;
}
}

Powered by Google App Engine
This is Rietveld 408576698