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

Unified Diff: third_party/WebKit/Source/core/css/cssom/FilteredComputedStylePropertyMap.cpp

Issue 2288633002: Recognise variable names when parsing CSS property names (Closed)
Patch Set: fix long var names Created 4 years, 4 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/cssom/FilteredComputedStylePropertyMap.cpp
diff --git a/third_party/WebKit/Source/core/css/cssom/FilteredComputedStylePropertyMap.cpp b/third_party/WebKit/Source/core/css/cssom/FilteredComputedStylePropertyMap.cpp
index 9d7af980851c69a7f767379e0ef41a0fbab9adad..fd6bed5c062ce01d2a89705e95ad92f9979a2a31 100644
--- a/third_party/WebKit/Source/core/css/cssom/FilteredComputedStylePropertyMap.cpp
+++ b/third_party/WebKit/Source/core/css/cssom/FilteredComputedStylePropertyMap.cpp
@@ -4,8 +4,6 @@
#include "core/css/cssom/FilteredComputedStylePropertyMap.h"
-#include "core/css/parser/CSSVariableParser.h"
-
namespace blink {
FilteredComputedStylePropertyMap::FilteredComputedStylePropertyMap(CSSComputedStyleDeclaration* computedStyleDeclaration, const Vector<CSSPropertyID>& nativeProperties, const Vector<AtomicString>& customProperties)
@@ -24,7 +22,7 @@ FilteredComputedStylePropertyMap::FilteredComputedStylePropertyMap(CSSComputedSt
CSSStyleValue* FilteredComputedStylePropertyMap::get(const String& propertyName, ExceptionState& exceptionState)
{
CSSPropertyID propertyID = cssPropertyID(propertyName);
- if (propertyID != CSSPropertyInvalid && m_nativeProperties.contains(propertyID)) {
+ if (propertyID >= firstCSSProperty && m_nativeProperties.contains(propertyID)) {
CSSStyleValueVector styleVector = getAllInternal(propertyID);
if (styleVector.isEmpty())
return nullptr;
@@ -32,7 +30,7 @@ CSSStyleValue* FilteredComputedStylePropertyMap::get(const String& propertyName,
return styleVector[0];
}
- if (propertyID == CSSPropertyInvalid && CSSVariableParser::isValidVariableName(propertyName) && m_customProperties.contains(AtomicString(propertyName))) {
+ if (propertyID == CSSPropertyVariable && m_customProperties.contains(AtomicString(propertyName))) {
CSSStyleValueVector styleVector = getAllInternal(AtomicString(propertyName));
if (styleVector.isEmpty())
return nullptr;
@@ -47,10 +45,10 @@ CSSStyleValue* FilteredComputedStylePropertyMap::get(const String& propertyName,
CSSStyleValueVector FilteredComputedStylePropertyMap::getAll(const String& propertyName, ExceptionState& exceptionState)
{
CSSPropertyID propertyID = cssPropertyID(propertyName);
- if (propertyID != CSSPropertyInvalid && m_nativeProperties.contains(propertyID))
+ if (propertyID >= firstCSSProperty && m_nativeProperties.contains(propertyID))
return getAllInternal(propertyID);
- if (propertyID == CSSPropertyInvalid && CSSVariableParser::isValidVariableName(propertyName) && m_customProperties.contains(AtomicString(propertyName)))
+ if (propertyID == CSSPropertyVariable && m_customProperties.contains(AtomicString(propertyName)))
return getAllInternal(AtomicString(propertyName));
exceptionState.throwTypeError("Invalid propertyName: " + propertyName);
@@ -60,10 +58,10 @@ CSSStyleValueVector FilteredComputedStylePropertyMap::getAll(const String& prope
bool FilteredComputedStylePropertyMap::has(const String& propertyName, ExceptionState& exceptionState)
{
CSSPropertyID propertyID = cssPropertyID(propertyName);
- if (propertyID != CSSPropertyInvalid && m_nativeProperties.contains(propertyID))
+ if (propertyID >= firstCSSProperty && m_nativeProperties.contains(propertyID))
return !getAllInternal(propertyID).isEmpty();
- if (propertyID == CSSPropertyInvalid && CSSVariableParser::isValidVariableName(propertyName) && m_customProperties.contains(AtomicString(propertyName)))
+ if (propertyID == CSSPropertyVariable && m_customProperties.contains(AtomicString(propertyName)))
return !getAllInternal(AtomicString(propertyName)).isEmpty();
exceptionState.throwTypeError("Invalid propertyName: " + propertyName);

Powered by Google App Engine
This is Rietveld 408576698