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

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

Issue 2227503002: Allow use of @apply and custom properties in InlineStylePropertyMap::getProperties() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
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( );
55 for (unsigned i = 0; i < inlineStyleSet.propertyCount(); i++) { 55 for (unsigned i = 0; i < inlineStyleSet.propertyCount(); i++) {
56 CSSPropertyID propertyID = inlineStyleSet.propertyAt(i).id(); 56 CSSPropertyID propertyID = inlineStyleSet.propertyAt(i).id();
57 result.append(getPropertyNameString(propertyID)); 57 if (propertyID == CSSPropertyVariable) {
58 StylePropertySet::PropertyReference propertyReference = inlineStyleS et.propertyAt(i);
59 const CSSCustomPropertyDeclaration& customDeclaration = toCSSCustomP ropertyDeclaration(propertyReference.value());
60 result.append(customDeclaration.name());
61 } else if (propertyID == CSSPropertyApplyAtRule) {
62 result.append("@apply");
63 } else if (propertyID >= firstCSSProperty && propertyID <= lastUnresolve dCSSProperty) {
sashab 2016/08/08 05:30:38 This should really be a function... But it's used
meade_UTC10 2016/08/08 06:04:00 Oops, that shouldn't even be there! Removed.
64 result.append(getPropertyNameString(propertyID));
65 }
58 } 66 }
59 return result; 67 return result;
60 } 68 }
61 69
62 void InlineStylePropertyMap::set(CSSPropertyID propertyID, CSSStyleValueOrCSSSty leValueSequenceOrString& item, ExceptionState& exceptionState) 70 void InlineStylePropertyMap::set(CSSPropertyID propertyID, CSSStyleValueOrCSSSty leValueSequenceOrString& item, ExceptionState& exceptionState)
63 { 71 {
64 if (item.isCSSStyleValue()) { 72 if (item.isCSSStyleValue()) {
65 const CSSValue* cssValue = styleValueToCSSValue(propertyID, *item.getAsC SSStyleValue()); 73 const CSSValue* cssValue = styleValueToCSSValue(propertyID, *item.getAsC SSStyleValue());
66 if (!cssValue) { 74 if (!cssValue) {
67 exceptionState.throwTypeError("Invalid type for property"); 75 exceptionState.throwTypeError("Invalid type for property");
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 else 177 else
170 value.setCSSStyleValueSequence(styleValueVector); 178 value.setCSSStyleValueSequence(styleValueVector);
171 } 179 }
172 result.append(std::make_pair(name, value)); 180 result.append(std::make_pair(name, value));
173 } 181 }
174 return result; 182 return result;
175 } 183 }
176 184
177 } // namespace blink 185 } // namespace blink
178 186
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698