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

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

Issue 2692043004: [Typed OM] Output correct types from CSSKeywordValue for css-wide keywords (Closed)
Patch Set: Remove debugging code; use getComputedStyle instead of offsetTop Created 3 years, 10 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 | « third_party/WebKit/Source/core/css/cssom/CSSKeywordValue.cpp ('k') | 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 12 matching lines...) Expand all
23 23
24 const CSSValue* styleValueToCSSValue(CSSPropertyID propertyID, 24 const CSSValue* styleValueToCSSValue(CSSPropertyID propertyID,
25 const CSSStyleValue& styleValue) { 25 const CSSStyleValue& styleValue) {
26 if (!CSSOMTypes::propertyCanTake(propertyID, styleValue)) 26 if (!CSSOMTypes::propertyCanTake(propertyID, styleValue))
27 return nullptr; 27 return nullptr;
28 return styleValue.toCSSValueWithProperty(propertyID); 28 return styleValue.toCSSValueWithProperty(propertyID);
29 } 29 }
30 30
31 const CSSValue* singleStyleValueAsCSSValue(CSSPropertyID propertyID, 31 const CSSValue* singleStyleValueAsCSSValue(CSSPropertyID propertyID,
32 const CSSStyleValue& styleValue) { 32 const CSSStyleValue& styleValue) {
33 if (!CSSPropertyMetadata::propertyIsRepeated(propertyID))
34 return styleValueToCSSValue(propertyID, styleValue);
35
36 const CSSValue* cssValue = styleValueToCSSValue(propertyID, styleValue); 33 const CSSValue* cssValue = styleValueToCSSValue(propertyID, styleValue);
37 if (!cssValue) 34 if (!cssValue)
38 return nullptr; 35 return nullptr;
39 36
37 if (!CSSPropertyMetadata::propertyIsRepeated(propertyID) ||
38 cssValue->isCSSWideKeyword())
39 return cssValue;
40
40 // TODO(meade): Determine the correct separator for each property. 41 // TODO(meade): Determine the correct separator for each property.
41 CSSValueList* valueList = CSSValueList::createSpaceSeparated(); 42 CSSValueList* valueList = CSSValueList::createSpaceSeparated();
42 valueList->append(*cssValue); 43 valueList->append(*cssValue);
43 return valueList; 44 return valueList;
44 } 45 }
45 46
46 CSSValueList* asCSSValueList(CSSPropertyID propertyID, 47 CSSValueList* asCSSValueList(CSSPropertyID propertyID,
47 const CSSStyleValueVector& styleValueVector) { 48 const CSSStyleValueVector& styleValueVector) {
48 // TODO(meade): Determine the correct separator for each property. 49 // TODO(meade): Determine the correct separator for each property.
49 CSSValueList* valueList = CSSValueList::createSpaceSeparated(); 50 CSSValueList* valueList = CSSValueList::createSpaceSeparated();
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 value.setCSSStyleValue(styleValueVector[0]); 227 value.setCSSStyleValue(styleValueVector[0]);
227 else 228 else
228 value.setCSSStyleValueSequence(styleValueVector); 229 value.setCSSStyleValueSequence(styleValueVector);
229 } 230 }
230 result.push_back(std::make_pair(name, value)); 231 result.push_back(std::make_pair(name, value));
231 } 232 }
232 return result; 233 return result;
233 } 234 }
234 235
235 } // namespace blink 236 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/cssom/CSSKeywordValue.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698