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 "bindings/core/v8/Iterable.h" |
8 #include "core/CSSPropertyNames.h" | 8 #include "core/CSSPropertyNames.h" |
9 #include "core/css/CSSPrimitiveValue.h" | 9 #include "core/css/CSSPrimitiveValue.h" |
10 #include "core/css/CSSPropertyMetadata.h" | 10 #include "core/css/CSSPropertyMetadata.h" |
11 #include "core/css/CSSValueList.h" | 11 #include "core/css/CSSValueList.h" |
12 #include "core/css/StylePropertySet.h" | 12 #include "core/css/StylePropertySet.h" |
13 #include "core/css/cssom/CSSOMTypes.h" | 13 #include "core/css/cssom/CSSOMTypes.h" |
14 #include "core/css/cssom/CSSSimpleLength.h" | 14 #include "core/css/cssom/CSSSimpleLength.h" |
15 #include "core/css/cssom/StyleValueFactory.h" | 15 #include "core/css/cssom/StyleValueFactory.h" |
16 | 16 |
17 namespace blink { | 17 namespace blink { |
18 | 18 |
19 CSSStyleValueVector InlineStylePropertyMap::getAll(CSSPropertyID propertyID) | 19 CSSStyleValueVector InlineStylePropertyMap::getAllInternal(CSSPropertyID propert
yID) |
20 { | 20 { |
21 CSSValue* cssValue = m_ownerElement->ensureMutableInlineStyle().getPropertyC
SSValue(propertyID); | 21 CSSValue* cssValue = m_ownerElement->ensureMutableInlineStyle().getPropertyC
SSValue(propertyID); |
22 if (!cssValue) | 22 if (!cssValue) |
23 return CSSStyleValueVector(); | 23 return CSSStyleValueVector(); |
24 | 24 |
25 return StyleValueFactory::cssValueToStyleValueVector(propertyID, *cssValue); | 25 return StyleValueFactory::cssValueToStyleValueVector(propertyID, *cssValue); |
26 } | 26 } |
27 | 27 |
| 28 CSSStyleValueVector InlineStylePropertyMap::getAllInternal(AtomicString customPr
opertyName) |
| 29 { |
| 30 CSSValue* cssValue = m_ownerElement->ensureMutableInlineStyle().getPropertyC
SSValue(customPropertyName); |
| 31 if (!cssValue) |
| 32 return CSSStyleValueVector(); |
| 33 |
| 34 return StyleValueFactory::cssValueToStyleValueVector(CSSPropertyInvalid, *cs
sValue); |
| 35 } |
| 36 |
28 Vector<String> InlineStylePropertyMap::getProperties() | 37 Vector<String> InlineStylePropertyMap::getProperties() |
29 { | 38 { |
30 Vector<String> result; | 39 Vector<String> result; |
31 StylePropertySet& inlineStyleSet = m_ownerElement->ensureMutableInlineStyle(
); | 40 StylePropertySet& inlineStyleSet = m_ownerElement->ensureMutableInlineStyle(
); |
32 for (unsigned i = 0; i < inlineStyleSet.propertyCount(); i++) { | 41 for (unsigned i = 0; i < inlineStyleSet.propertyCount(); i++) { |
33 CSSPropertyID propertyID = inlineStyleSet.propertyAt(i).id(); | 42 CSSPropertyID propertyID = inlineStyleSet.propertyAt(i).id(); |
34 result.append(getPropertyNameString(propertyID)); | 43 result.append(getPropertyNameString(propertyID)); |
35 } | 44 } |
36 return result; | 45 return result; |
37 } | 46 } |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 value.setCSSStyleValue(styleValueVector[0]); | 141 value.setCSSStyleValue(styleValueVector[0]); |
133 else | 142 else |
134 value.setCSSStyleValueSequence(styleValueVector); | 143 value.setCSSStyleValueSequence(styleValueVector); |
135 result.append(std::make_pair(getPropertyNameString(propertyID), value)); | 144 result.append(std::make_pair(getPropertyNameString(propertyID), value)); |
136 } | 145 } |
137 return result; | 146 return result; |
138 } | 147 } |
139 | 148 |
140 } // namespace blink | 149 } // namespace blink |
141 | 150 |
OLD | NEW |