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

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

Issue 2042943003: Move CSSValue->CSSStyleValue logic out of StylePropertyMap and into the StyleValueFactory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@stylevaue
Patch Set: sync to HEAD Created 4 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
Index: third_party/WebKit/Source/core/css/cssom/StylePropertyMap.cpp
diff --git a/third_party/WebKit/Source/core/css/cssom/StylePropertyMap.cpp b/third_party/WebKit/Source/core/css/cssom/StylePropertyMap.cpp
index 9b45961275200e3d0d1d3ec012d4714351498b3f..30e7aff4c3599fac013147251f270344e189f2b3 100644
--- a/third_party/WebKit/Source/core/css/cssom/StylePropertyMap.cpp
+++ b/third_party/WebKit/Source/core/css/cssom/StylePropertyMap.cpp
@@ -55,14 +55,14 @@ CSSStyleValue* StylePropertyMap::get(const String& propertyName, ExceptionState&
return nullptr;
}
- StyleValueVector styleVector = getAll(propertyID);
+ CSSStyleValueVector styleVector = getAll(propertyID);
if (styleVector.isEmpty())
return nullptr;
return styleVector[0];
}
-StylePropertyMap::StyleValueVector StylePropertyMap::getAll(const String& propertyName, ExceptionState& exceptionState)
+CSSStyleValueVector StylePropertyMap::getAll(const String& propertyName, ExceptionState& exceptionState)
{
CSSPropertyID propertyID = cssPropertyID(propertyName);
if (propertyID != CSSPropertyInvalid)
@@ -70,7 +70,7 @@ StylePropertyMap::StyleValueVector StylePropertyMap::getAll(const String& proper
// TODO(meade): Handle custom properties here.
exceptionState.throwTypeError("Invalid propertyName: " + propertyName);
- return StyleValueVector();
+ return CSSStyleValueVector();
}
bool StylePropertyMap::has(const String& propertyName, ExceptionState& exceptionState)
@@ -117,26 +117,6 @@ void StylePropertyMap::remove(const String& propertyName, ExceptionState& except
exceptionState.throwTypeError("Invalid propertyName: " + propertyName);
}
-StylePropertyMap::StyleValueVector StylePropertyMap::cssValueToStyleValueVector(CSSPropertyID propertyID, const CSSValue& cssValue)
-{
- StyleValueVector styleValueVector;
-
- if (!cssValue.isValueList()) {
- CSSStyleValue* styleValue = StyleValueFactory::create(propertyID, cssValue);
- if (styleValue)
- styleValueVector.append(styleValue);
- return styleValueVector;
- }
-
- for (const CSSValue* value : toCSSValueList(cssValue)) {
- CSSStyleValue* styleValue = StyleValueFactory::create(propertyID, *value);
- if (!styleValue)
- return StyleValueVector();
- styleValueVector.append(styleValue);
- }
- return styleValueVector;
-}
-
StylePropertyMap::IterationSource* StylePropertyMap::startIteration(ScriptState*, ExceptionState&)
{
return new StylePropertyMapIterationSource(getIterationEntries());

Powered by Google App Engine
This is Rietveld 408576698