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

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

Issue 1849653003: Implement ComputedStylePropertyMap for Typed OM. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@maps-inline
Patch Set: Fix compilation Created 4 years, 8 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 a3226026b0a924bdf64975802d7d1f65247bc9aa..585de1ad6b8ba7ed1f7cf9ce3d413f5e98cc7b28 100644
--- a/third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.cpp
+++ b/third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.cpp
@@ -15,43 +15,22 @@
namespace blink {
-StyleValue* InlineStylePropertyMap::get(CSSPropertyID propertyID)
-{
- StyleValueVector styleVector = getAll(propertyID);
- if (styleVector.isEmpty())
- return nullptr;
-
- return styleVector.at(0);
-}
-
-StyleValueVector InlineStylePropertyMap::getAll(CSSPropertyID propertyID)
+StylePropertyMap::StyleValueVector InlineStylePropertyMap::getAll(CSSPropertyID propertyID)
{
CSSValue* cssValue = m_ownerElement->ensureMutableInlineStyle().getPropertyCSSValue(propertyID);
if (!cssValue)
return StyleValueVector();
- StyleValueVector styleValueVector;
-
- if (!cssValue->isValueList()) {
- StyleValue* styleValue = StyleValueFactory::create(propertyID, *cssValue);
- if (styleValue)
- styleValueVector.append(styleValue);
- return styleValueVector;
- }
-
- for (CSSValue* value : *toCSSValueList(cssValue)) {
- StyleValue* styleValue = StyleValueFactory::create(propertyID, *value);
- if (!styleValue) {
- return StyleValueVector();
- }
- styleValueVector.append(styleValue);
- }
- return styleValueVector;
+ return cssValueToStyleValueVector(propertyID, *cssValue);
}
bool InlineStylePropertyMap::has(CSSPropertyID propertyID)
{
- return !getAll(propertyID).isEmpty();
+ CSSValue* cssValue = m_ownerElement->ensureMutableInlineStyle().getPropertyCSSValue(propertyID);
+ if (!cssValue)
+ return false;
+
+ return (!cssValue->isValueList() || toCSSValueList(cssValue)->length() > 0);
}
Vector<String> InlineStylePropertyMap::getProperties()
@@ -97,6 +76,7 @@ void InlineStylePropertyMap::set(CSSPropertyID propertyID, StyleValueOrStyleValu
ASSERT(item.isString());
// TODO(meade): Implement this.
exceptionState.throwTypeError("Not implemented yet");
+ return;
}
}

Powered by Google App Engine
This is Rietveld 408576698