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

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

Issue 1849653003: Implement ComputedStylePropertyMap for Typed OM. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@maps-inline
Patch Set: sync to head Created 4 years, 7 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/ComputedStylePropertyMap.cpp
diff --git a/third_party/WebKit/Source/core/css/cssom/ComputedStylePropertyMap.cpp b/third_party/WebKit/Source/core/css/cssom/ComputedStylePropertyMap.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..4cbaab0536a60b93869135d7a3a28a4cf7f08e61
--- /dev/null
+++ b/third_party/WebKit/Source/core/css/cssom/ComputedStylePropertyMap.cpp
@@ -0,0 +1,36 @@
+// Copyright 2016 the Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "core/css/cssom/ComputedStylePropertyMap.h"
+
+#include "core/css/CSSComputedStyleDeclaration.h"
+#include "core/css/cssom/StyleValueFactory.h"
+
+namespace blink {
+
+StylePropertyMap::StyleValueVector ComputedStylePropertyMap::getAll(CSSPropertyID propertyID)
+{
+ CSSValue* cssValue = m_computedStyleDeclaration->getPropertyCSSValueInternal(propertyID);
+ return cssValueToStyleValueVector(propertyID, *cssValue);
+}
+
+bool ComputedStylePropertyMap::has(CSSPropertyID propertyID)
+{
+ CSSValue* cssValue = m_computedStyleDeclaration->getPropertyCSSValueInternal(propertyID);
+ if (!cssValue)
+ return false;
+
+ return (!cssValue->isValueList() || toCSSValueList(cssValue)->length() > 0);
Timothy Loh 2016/05/13 02:08:23 Commenting on this again - let's just change it to
meade_UTC10 2016/05/13 05:05:31 I changed this to use the base class version inste
+}
+
+Vector<String> ComputedStylePropertyMap::getProperties()
+{
+ Vector<String> result;
+ for (unsigned i = 0; i < m_computedStyleDeclaration->length(); i++) {
+ result.append(m_computedStyleDeclaration->item(i));
+ }
+ return result;
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698