Chromium Code Reviews| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 79 const CSSValue* cssValue = | 79 const CSSValue* cssValue = |
| 80 m_ownerElement->ensureMutableInlineStyle().getPropertyCSSValue( | 80 m_ownerElement->ensureMutableInlineStyle().getPropertyCSSValue( |
| 81 propertyID); | 81 propertyID); |
| 82 if (!cssValue) | 82 if (!cssValue) |
| 83 return CSSStyleValueVector(); | 83 return CSSStyleValueVector(); |
| 84 | 84 |
| 85 return StyleValueFactory::cssValueToStyleValueVector(propertyID, *cssValue); | 85 return StyleValueFactory::cssValueToStyleValueVector(propertyID, *cssValue); |
| 86 } | 86 } |
| 87 | 87 |
| 88 CSSStyleValueVector InlineStylePropertyMap::getAllInternal( | 88 CSSStyleValueVector InlineStylePropertyMap::getAllInternal( |
| 89 AtomicString customPropertyName) { | 89 AtomicString customPropertyName, |
| 90 const CSSValue* cssValue = | 90 ExceptionState& exceptionState) { |
| 91 m_ownerElement->ensureMutableInlineStyle().getPropertyCSSValue( | 91 // TODO(rjwright/meade): Handle custom properties. |
| 92 customPropertyName); | 92 exceptionState.throwTypeError("Invalid propertyName: " + customPropertyName); |
|
alancutter (OOO until 2018)
2017/04/05 04:54:09
Is this part still WIP for this patch?
| |
| 93 if (!cssValue) | 93 return CSSStyleValueVector(); |
| 94 return CSSStyleValueVector(); | |
| 95 | |
| 96 return StyleValueFactory::cssValueToStyleValueVector(CSSPropertyInvalid, | |
| 97 *cssValue); | |
|
meade_UTC10
2017/04/06 03:47:32
It seems like removing this is moving backwards?
| |
| 98 } | 94 } |
| 99 | 95 |
| 100 Vector<String> InlineStylePropertyMap::getProperties() { | 96 Vector<String> InlineStylePropertyMap::getProperties() { |
| 101 DEFINE_STATIC_LOCAL(const String, kAtApply, ("@apply")); | 97 DEFINE_STATIC_LOCAL(const String, kAtApply, ("@apply")); |
| 102 Vector<String> result; | 98 Vector<String> result; |
| 103 bool containsAtApply = false; | 99 bool containsAtApply = false; |
| 104 StylePropertySet& inlineStyleSet = m_ownerElement->ensureMutableInlineStyle(); | 100 StylePropertySet& inlineStyleSet = m_ownerElement->ensureMutableInlineStyle(); |
| 105 for (unsigned i = 0; i < inlineStyleSet.propertyCount(); i++) { | 101 for (unsigned i = 0; i < inlineStyleSet.propertyCount(); i++) { |
| 106 CSSPropertyID propertyID = inlineStyleSet.propertyAt(i).id(); | 102 CSSPropertyID propertyID = inlineStyleSet.propertyAt(i).id(); |
| 107 if (propertyID == CSSPropertyVariable) { | 103 if (propertyID == CSSPropertyVariable) { |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 240 value.setCSSStyleValue(styleValueVector[0]); | 236 value.setCSSStyleValue(styleValueVector[0]); |
| 241 else | 237 else |
| 242 value.setCSSStyleValueSequence(styleValueVector); | 238 value.setCSSStyleValueSequence(styleValueVector); |
| 243 } | 239 } |
| 244 result.push_back(std::make_pair(name, value)); | 240 result.push_back(std::make_pair(name, value)); |
| 245 } | 241 } |
| 246 return result; | 242 return result; |
| 247 } | 243 } |
| 248 | 244 |
| 249 } // namespace blink | 245 } // namespace blink |
| OLD | NEW |