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

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

Issue 2382653006: Split CSSPrimitiveValue into CSSPrimitiveValue and CSSIdentifierValue (Closed)
Patch Set: Make check-webkit-style happy 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 a542b86a29af0c43ec716470edf8351555636d34..eeee7a21f9756153cc71cfa1468aec8e3b43ac17 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"
@@ -240,7 +241,7 @@ CSSComputedStyleDeclaration::getFontSizeCSSValuePreferringKeyword() const {
return nullptr;
if (int keywordSize = style->getFontDescription().keywordSize())
- return CSSPrimitiveValue::createIdentifier(
+ return CSSIdentifierValue::create(
cssIdentifierForFontSizeKeyword(keywordSize));
return zoomAdjustedPixelValue(style->getFontDescription().computedPixelSize(),
@@ -441,7 +442,9 @@ String CSSComputedStyleDeclaration::item(unsigned i) const {
bool CSSComputedStyleDeclaration::cssPropertyMatches(
CSSPropertyID propertyID,
const CSSValue* propertyValue) const {
- if (propertyID == CSSPropertyFontSize && propertyValue->isPrimitiveValue() &&
+ if (propertyID == CSSPropertyFontSize &&
+ (propertyValue->isPrimitiveValue() ||
+ propertyValue->isIdentifierValue()) &&
m_node) {
m_node->document().updateStyleAndLayoutIgnorePendingStylesheets();
const ComputedStyle* style =
@@ -449,10 +452,8 @@ bool CSSComputedStyleDeclaration::cssPropertyMatches(
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