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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
78 CSSPropertyID property_id) { | 78 CSSPropertyID property_id) { |
79 const CSSValue* css_value = | 79 const CSSValue* css_value = |
80 owner_element_->EnsureMutableInlineStyle().GetPropertyCSSValue( | 80 owner_element_->EnsureMutableInlineStyle().GetPropertyCSSValue( |
81 property_id); | 81 property_id); |
82 if (!css_value) | 82 if (!css_value) |
83 return CSSStyleValueVector(); | 83 return CSSStyleValueVector(); |
84 | 84 |
85 return StyleValueFactory::CssValueToStyleValueVector(property_id, *css_value); | 85 return StyleValueFactory::CssValueToStyleValueVector(property_id, *css_value); |
86 } | 86 } |
87 | 87 |
88 // TODO(rjwright): This used to throw in the parent class but now is being used. | |
89 // Make sure it is tested and correct. | |
meade_UTC10
2017/05/09 04:59:36
Nit: please delete this TODO before submitting :)
| |
88 CSSStyleValueVector InlineStylePropertyMap::GetAllInternal( | 90 CSSStyleValueVector InlineStylePropertyMap::GetAllInternal( |
89 AtomicString custom_property_name) { | 91 AtomicString custom_property_name) { |
90 const CSSValue* css_value = | 92 const CSSValue* css_value = |
91 owner_element_->EnsureMutableInlineStyle().GetPropertyCSSValue( | 93 owner_element_->EnsureMutableInlineStyle().GetPropertyCSSValue( |
92 custom_property_name); | 94 custom_property_name); |
93 if (!css_value) | 95 if (!css_value) |
94 return CSSStyleValueVector(); | 96 return CSSStyleValueVector(); |
95 | 97 |
96 return StyleValueFactory::CssValueToStyleValueVector(CSSPropertyInvalid, | 98 return StyleValueFactory::CssValueToStyleValueVector(CSSPropertyInvalid, |
97 *css_value); | 99 *css_value); |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
243 value.setCSSStyleValue(style_value_vector[0]); | 245 value.setCSSStyleValue(style_value_vector[0]); |
244 else | 246 else |
245 value.setCSSStyleValueSequence(style_value_vector); | 247 value.setCSSStyleValueSequence(style_value_vector); |
246 } | 248 } |
247 result.push_back(std::make_pair(name, value)); | 249 result.push_back(std::make_pair(name, value)); |
248 } | 250 } |
249 return result; | 251 return result; |
250 } | 252 } |
251 | 253 |
252 } // namespace blink | 254 } // namespace blink |
OLD | NEW |