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

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

Issue 1874623002: Implement iterable<DOMString, (StyleValue or sequence<StyleValue>)> for InlineStylePropertyMap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@computed-stylepropertymap-2
Patch Set: Update LayoutTests 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 5764f883645331e87d0d999243f92e02eb27692e..cf51a0cf01db3b2c3b91578a4b195a6bf607ea46 100644
--- a/third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.cpp
+++ b/third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.cpp
@@ -4,6 +4,7 @@
#include "core/css/cssom/InlineStylePropertyMap.h"
+#include "bindings/core/v8/Iterable.h"
#include "core/CSSPropertyNames.h"
#include "core/css/CSSPrimitiveValue.h"
#include "core/css/CSSPropertyMetadata.h"
@@ -117,5 +118,23 @@ void InlineStylePropertyMap::remove(CSSPropertyID propertyID, ExceptionState& ex
m_ownerElement->removeInlineStyleProperty(propertyID);
}
+HeapVector<StylePropertyMap::StylePropertyMapEntry> InlineStylePropertyMap::getIterationEntries()
+{
+ HeapVector<StylePropertyMap::StylePropertyMapEntry> result;
+ StylePropertySet& inlineStyleSet = m_ownerElement->ensureMutableInlineStyle();
+ for (unsigned i = 0; i < inlineStyleSet.propertyCount(); i++) {
+ StylePropertySet::PropertyReference propertyReference = inlineStyleSet.propertyAt(i);
+ CSSPropertyID propertyID = propertyReference.id();
+ StyleValueVector styleValueVector = cssValueToStyleValueVector(propertyID, *propertyReference.value());
+ StyleValueOrStyleValueSequence value;
+ if (styleValueVector.size() == 1)
+ value.setStyleValue(styleValueVector[0]);
+ else
+ value.setStyleValueSequence(styleValueVector);
+ result.append(std::make_pair(getPropertyNameString(propertyID), value));
+ }
+ return result;
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698