| 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/CSSCustomIdentValue.h" | 9 #include "core/css/CSSCustomIdentValue.h" |
| 10 #include "core/css/CSSCustomPropertyDeclaration.h" | 10 #include "core/css/CSSCustomPropertyDeclaration.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 { | 25 { |
| 26 if (!CSSOMTypes::propertyCanTake(propertyID, styleValue)) | 26 if (!CSSOMTypes::propertyCanTake(propertyID, styleValue)) |
| 27 return nullptr; | 27 return nullptr; |
| 28 return styleValue.toCSSValueWithProperty(propertyID); | 28 return styleValue.toCSSValueWithProperty(propertyID); |
| 29 } | 29 } |
| 30 | 30 |
| 31 } // namespace | 31 } // namespace |
| 32 | 32 |
| 33 CSSStyleValueVector InlineStylePropertyMap::getAllInternal(CSSPropertyID propert
yID) | 33 CSSStyleValueVector InlineStylePropertyMap::getAllInternal(CSSPropertyID propert
yID) |
| 34 { | 34 { |
| 35 CSSValue* cssValue = m_ownerElement->ensureMutableInlineStyle().getPropertyC
SSValue(propertyID); | 35 const CSSValue* cssValue = m_ownerElement->ensureMutableInlineStyle().getPro
pertyCSSValue(propertyID); |
| 36 if (!cssValue) | 36 if (!cssValue) |
| 37 return CSSStyleValueVector(); | 37 return CSSStyleValueVector(); |
| 38 | 38 |
| 39 return StyleValueFactory::cssValueToStyleValueVector(propertyID, *cssValue); | 39 return StyleValueFactory::cssValueToStyleValueVector(propertyID, *cssValue); |
| 40 } | 40 } |
| 41 | 41 |
| 42 CSSStyleValueVector InlineStylePropertyMap::getAllInternal(AtomicString customPr
opertyName) | 42 CSSStyleValueVector InlineStylePropertyMap::getAllInternal(AtomicString customPr
opertyName) |
| 43 { | 43 { |
| 44 CSSValue* cssValue = m_ownerElement->ensureMutableInlineStyle().getPropertyC
SSValue(customPropertyName); | 44 const CSSValue* cssValue = m_ownerElement->ensureMutableInlineStyle().getPro
pertyCSSValue(customPropertyName); |
| 45 if (!cssValue) | 45 if (!cssValue) |
| 46 return CSSStyleValueVector(); | 46 return CSSStyleValueVector(); |
| 47 | 47 |
| 48 return StyleValueFactory::cssValueToStyleValueVector(CSSPropertyInvalid, *cs
sValue); | 48 return StyleValueFactory::cssValueToStyleValueVector(CSSPropertyInvalid, *cs
sValue); |
| 49 } | 49 } |
| 50 | 50 |
| 51 Vector<String> InlineStylePropertyMap::getProperties() | 51 Vector<String> InlineStylePropertyMap::getProperties() |
| 52 { | 52 { |
| 53 Vector<String> result; | 53 Vector<String> result; |
| 54 StylePropertySet& inlineStyleSet = m_ownerElement->ensureMutableInlineStyle(
); | 54 StylePropertySet& inlineStyleSet = m_ownerElement->ensureMutableInlineStyle(
); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 else | 169 else |
| 170 value.setCSSStyleValueSequence(styleValueVector); | 170 value.setCSSStyleValueSequence(styleValueVector); |
| 171 } | 171 } |
| 172 result.append(std::make_pair(name, value)); | 172 result.append(std::make_pair(name, value)); |
| 173 } | 173 } |
| 174 return result; | 174 return result; |
| 175 } | 175 } |
| 176 | 176 |
| 177 } // namespace blink | 177 } // namespace blink |
| 178 | 178 |
| OLD | NEW |