Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.cpp

Issue 2726733004: [Experimental] Implement some part of custom properties in style maps (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 const CSSValue* cssValue = 65 const CSSValue* cssValue =
66 m_ownerElement->ensureMutableInlineStyle().getPropertyCSSValue( 66 m_ownerElement->ensureMutableInlineStyle().getPropertyCSSValue(
67 propertyID); 67 propertyID);
68 if (!cssValue) 68 if (!cssValue)
69 return CSSStyleValueVector(); 69 return CSSStyleValueVector();
70 70
71 return StyleValueFactory::cssValueToStyleValueVector(propertyID, *cssValue); 71 return StyleValueFactory::cssValueToStyleValueVector(propertyID, *cssValue);
72 } 72 }
73 73
74 CSSStyleValueVector InlineStylePropertyMap::getAllInternal( 74 CSSStyleValueVector InlineStylePropertyMap::getAllInternal(
75 AtomicString customPropertyName) { 75 String customPropertyName) {
76 // TODO(meade): Let's avoid interning strings here if they're incorrect.
76 const CSSValue* cssValue = 77 const CSSValue* cssValue =
77 m_ownerElement->ensureMutableInlineStyle().getPropertyCSSValue( 78 m_ownerElement->ensureMutableInlineStyle().getPropertyCSSValue(
78 customPropertyName); 79 AtomicString(customPropertyName));
79 if (!cssValue) 80 if (!cssValue)
80 return CSSStyleValueVector(); 81 return CSSStyleValueVector();
81 82
82 return StyleValueFactory::cssValueToStyleValueVector(CSSPropertyInvalid, 83 return StyleValueFactory::cssValueToStyleValueVector(CSSPropertyInvalid,
83 *cssValue); 84 *cssValue);
84 } 85 }
85 86
86 Vector<String> InlineStylePropertyMap::getProperties() { 87 Vector<String> InlineStylePropertyMap::getProperties() {
87 DEFINE_STATIC_LOCAL(const String, kAtApply, ("@apply")); 88 DEFINE_STATIC_LOCAL(const String, kAtApply, ("@apply"));
88 Vector<String> result; 89 Vector<String> result;
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 value.setCSSStyleValue(styleValueVector[0]); 228 value.setCSSStyleValue(styleValueVector[0]);
228 else 229 else
229 value.setCSSStyleValueSequence(styleValueVector); 230 value.setCSSStyleValueSequence(styleValueVector);
230 } 231 }
231 result.push_back(std::make_pair(name, value)); 232 result.push_back(std::make_pair(name, value));
232 } 233 }
233 return result; 234 return result;
234 } 235 }
235 236
236 } // namespace blink 237 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698