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

Unified Diff: third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.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: 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/InlineStylePropertyMap.cpp
diff --git a/third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.cpp b/third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.cpp
index 39c3c20b5c6312e4722d92043d5815f9e88ed1e2..c5b75350440daf66aa82699fd5a650276943f4fd 100644
--- a/third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.cpp
+++ b/third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.cpp
@@ -12,16 +12,17 @@
#include "core/css/StylePropertySet.h"
#include "core/css/cssom/CSSOMTypes.h"
#include "core/css/cssom/CSSSimpleLength.h"
+#include "core/css/cssom/StyleValueFactory.h"
namespace blink {
-StylePropertyMap::StyleValueVector InlineStylePropertyMap::getAll(CSSPropertyID propertyID)
+CSSStyleValueVector InlineStylePropertyMap::getAll(CSSPropertyID propertyID)
{
CSSValue* cssValue = m_ownerElement->ensureMutableInlineStyle().getPropertyCSSValue(propertyID);
if (!cssValue)
- return StyleValueVector();
+ return CSSStyleValueVector();
- return cssValueToStyleValueVector(propertyID, *cssValue);
+ return StyleValueFactory::cssValueToStyleValueVector(propertyID, *cssValue);
}
Vector<String> InlineStylePropertyMap::getProperties()
@@ -52,7 +53,7 @@ void InlineStylePropertyMap::set(CSSPropertyID propertyID, CSSStyleValueOrCSSSty
// TODO(meade): This won't always work. Figure out what kind of CSSValueList to create properly.
CSSValueList* valueList = CSSValueList::createSpaceSeparated();
- StyleValueVector styleValueVector = item.getAsCSSStyleValueSequence();
+ CSSStyleValueVector styleValueVector = item.getAsCSSStyleValueSequence();
for (const Member<CSSStyleValue> value : styleValueVector) {
if (!CSSOMTypes::propertyCanTake(propertyID, *value)) {
exceptionState.throwTypeError("Invalid type for property");
@@ -125,7 +126,7 @@ HeapVector<StylePropertyMap::StylePropertyMapEntry> InlineStylePropertyMap::getI
for (unsigned i = 0; i < inlineStyleSet.propertyCount(); i++) {
StylePropertySet::PropertyReference propertyReference = inlineStyleSet.propertyAt(i);
CSSPropertyID propertyID = propertyReference.id();
- StyleValueVector styleValueVector = cssValueToStyleValueVector(propertyID, *propertyReference.value());
+ CSSStyleValueVector styleValueVector = StyleValueFactory::cssValueToStyleValueVector(propertyID, *propertyReference.value());
CSSStyleValueOrCSSStyleValueSequence value;
if (styleValueVector.size() == 1)
value.setCSSStyleValue(styleValueVector[0]);

Powered by Google App Engine
This is Rietveld 408576698