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

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

Issue 2791193004: [Typed CSSOM] New design for computed styles which includes custom properties (Closed)
Patch Set: replace node check with dcheck Created 3 years, 7 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/FilteredComputedStylePropertyMap.h" 5 #include "core/css/cssom/FilteredComputedStylePropertyMap.h"
6 6
7 namespace blink { 7 namespace blink {
8 8
9 FilteredComputedStylePropertyMap::FilteredComputedStylePropertyMap( 9 FilteredComputedStylePropertyMap::FilteredComputedStylePropertyMap(
10 CSSComputedStyleDeclaration* computed_style_declaration, 10 CSSComputedStyleDeclaration* computed_style_declaration,
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 } 65 }
66 66
67 bool FilteredComputedStylePropertyMap::has(const String& property_name, 67 bool FilteredComputedStylePropertyMap::has(const String& property_name,
68 ExceptionState& exception_state) { 68 ExceptionState& exception_state) {
69 CSSPropertyID property_id = cssPropertyID(property_name); 69 CSSPropertyID property_id = cssPropertyID(property_name);
70 if (property_id >= firstCSSProperty && 70 if (property_id >= firstCSSProperty &&
71 native_properties_.Contains(property_id)) 71 native_properties_.Contains(property_id))
72 return !GetAllInternal(property_id).IsEmpty(); 72 return !GetAllInternal(property_id).IsEmpty();
73 73
74 if (property_id == CSSPropertyVariable && 74 if (property_id == CSSPropertyVariable &&
75 custom_properties_.Contains(AtomicString(property_name))) 75 custom_properties_.Contains(AtomicString(property_name))) {
76 return !GetAllInternal(AtomicString(property_name)).IsEmpty(); 76 return !GetAllInternal(AtomicString(property_name)).IsEmpty();
77 }
meade_UTC10 2017/05/09 04:59:36 nit: unrelated change?
77 78
78 exception_state.ThrowTypeError("Invalid propertyName: " + property_name); 79 exception_state.ThrowTypeError("Invalid propertyName: " + property_name);
79 return false; 80 return false;
80 } 81 }
81 82
82 Vector<String> FilteredComputedStylePropertyMap::getProperties() { 83 Vector<String> FilteredComputedStylePropertyMap::getProperties() {
83 Vector<String> result; 84 Vector<String> result;
84 for (const auto& native_property : native_properties_) { 85 for (const auto& native_property : native_properties_) {
85 result.push_back(getPropertyNameString(native_property)); 86 result.push_back(getPropertyNameString(native_property));
86 } 87 }
87 88
88 for (const auto& custom_property : custom_properties_) { 89 for (const auto& custom_property : custom_properties_) {
89 result.push_back(custom_property); 90 result.push_back(custom_property);
90 } 91 }
91 92
92 return result; 93 return result;
93 } 94 }
94 95
95 } // namespace blink 96 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698