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

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: Update global-interface-listing Created 4 years, 9 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 8c9d1e0e22f86c8fa1b84bdb59ab665e7f70f37e..125c93d33eef059ed9bad24edfffdf30399bcaa6 100644
--- a/third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.cpp
+++ b/third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.cpp
@@ -15,17 +15,6 @@
namespace blink {
-StyleValue* InlineStylePropertyMap::get(CSSPropertyID propertyID)
-{
- ASSERT(propertyID != CSSPropertyInvalid);
-
- StyleValueVector styleVector = getAll(propertyID);
- if (styleVector.isEmpty())
- return nullptr;
-
- return styleVector.at(0);
-}
-
StyleValueVector InlineStylePropertyMap::getAll(CSSPropertyID propertyID)
{
ASSERT(propertyID != CSSPropertyInvalid);
@@ -34,28 +23,18 @@ StyleValueVector InlineStylePropertyMap::getAll(CSSPropertyID propertyID)
if (!cssValue)
return StyleValueVector();
- StyleValueVector styleValueVector;
-
- if (!cssValue->isValueList()) {
- StyleValue* styleValue = StyleValueFactory::create(propertyID, *cssValue);
- if (styleValue)
- styleValueVector.append(styleValue);
- return styleValueVector;
- }
-
- for (auto& value : *toCSSValueList(cssValue.get())) {
- StyleValue* styleValue = StyleValueFactory::create(propertyID, *value);
- if (styleValue)
- styleValueVector.append(styleValue);
- }
-
- return styleValueVector;
+ return cssValueToStyleValueVector(propertyID, *cssValue);
}
bool InlineStylePropertyMap::has(CSSPropertyID propertyID)
{
ASSERT(propertyID != CSSPropertyInvalid);
- return !getAll(propertyID).isEmpty();
+
+ RefPtrWillBeRawPtr<CSSValue> cssValue = m_ownerElement->ensureMutableInlineStyle().getPropertyCSSValue(propertyID);
+ if (!cssValue)
+ return false;
+
+ return (!cssValue->isValueList() || toCSSValueList(cssValue)->length() > 0);
Timothy Loh 2016/03/31 06:59:25 CSSValueLists are never empty (if you're setting e
meade_UTC10 2016/04/04 03:32:41 Acknowledged. Seems best to look at that case thou
Timothy Loh 2016/04/15 04:16:07 Why would this function care about whether the val
}
Vector<String> InlineStylePropertyMap::getProperties()

Powered by Google App Engine
This is Rietveld 408576698