OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/css/cssom/InlineStylePropertyMap.h" | 5 #include "core/css/cssom/InlineStylePropertyMap.h" |
6 | 6 |
| 7 #include "bindings/core/v8/Iterable.h" |
7 #include "core/CSSPropertyNames.h" | 8 #include "core/CSSPropertyNames.h" |
8 #include "core/css/CSSPrimitiveValue.h" | 9 #include "core/css/CSSPrimitiveValue.h" |
9 #include "core/css/CSSPropertyMetadata.h" | 10 #include "core/css/CSSPropertyMetadata.h" |
10 #include "core/css/CSSValueList.h" | 11 #include "core/css/CSSValueList.h" |
11 #include "core/css/StylePropertySet.h" | 12 #include "core/css/StylePropertySet.h" |
12 #include "core/css/cssom/CSSOMTypes.h" | 13 #include "core/css/cssom/CSSOMTypes.h" |
13 #include "core/css/cssom/CSSSimpleLength.h" | 14 #include "core/css/cssom/CSSSimpleLength.h" |
14 | 15 |
15 namespace blink { | 16 namespace blink { |
16 | 17 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 } | 111 } |
111 | 112 |
112 m_ownerElement->setInlineStyleProperty(propertyID, cssValueList); | 113 m_ownerElement->setInlineStyleProperty(propertyID, cssValueList); |
113 } | 114 } |
114 | 115 |
115 void InlineStylePropertyMap::remove(CSSPropertyID propertyID, ExceptionState& ex
ceptionState) | 116 void InlineStylePropertyMap::remove(CSSPropertyID propertyID, ExceptionState& ex
ceptionState) |
116 { | 117 { |
117 m_ownerElement->removeInlineStyleProperty(propertyID); | 118 m_ownerElement->removeInlineStyleProperty(propertyID); |
118 } | 119 } |
119 | 120 |
| 121 HeapVector<StylePropertyMap::StylePropertyMapEntry> InlineStylePropertyMap::getI
terationEntries() |
| 122 { |
| 123 HeapVector<StylePropertyMap::StylePropertyMapEntry> result; |
| 124 StylePropertySet& inlineStyleSet = m_ownerElement->ensureMutableInlineStyle(
); |
| 125 for (unsigned i = 0; i < inlineStyleSet.propertyCount(); i++) { |
| 126 StylePropertySet::PropertyReference propertyReference = inlineStyleSet.p
ropertyAt(i); |
| 127 CSSPropertyID propertyID = propertyReference.id(); |
| 128 StyleValueVector styleValueVector = cssValueToStyleValueVector(propertyI
D, *propertyReference.value()); |
| 129 StyleValueOrStyleValueSequence value; |
| 130 if (styleValueVector.size() == 1) |
| 131 value.setStyleValue(styleValueVector[0]); |
| 132 else |
| 133 value.setStyleValueSequence(styleValueVector); |
| 134 result.append(std::make_pair(getPropertyNameString(propertyID), value)); |
| 135 } |
| 136 return result; |
| 137 } |
| 138 |
120 } // namespace blink | 139 } // namespace blink |
121 | 140 |
OLD | NEW |