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

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

Issue 2346193002: Split CSSPrimitiveValue into CSSPrimitiveValue and CSSIdentifierValue (Closed)
Patch Set: Fixed tests Created 4 years, 2 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 /* 1 /*
2 * Copyright (C) 2004 Zack Rusin <zack@kde.org> 2 * Copyright (C) 2004 Zack Rusin <zack@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
6 * Copyright (C) 2011 Sencha, Inc. All rights reserved. 6 * Copyright (C) 2011 Sencha, Inc. All rights reserved.
7 * Copyright (C) 2015 Google Inc. All rights reserved. 7 * Copyright (C) 2015 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public 10 * modify it under the terms of the GNU Lesser General Public
(...skipping 23 matching lines...) Expand all
34 #include "core/css/CSSColorValue.h" 34 #include "core/css/CSSColorValue.h"
35 #include "core/css/CSSCounterValue.h" 35 #include "core/css/CSSCounterValue.h"
36 #include "core/css/CSSCursorImageValue.h" 36 #include "core/css/CSSCursorImageValue.h"
37 #include "core/css/CSSCustomIdentValue.h" 37 #include "core/css/CSSCustomIdentValue.h"
38 #include "core/css/CSSCustomPropertyDeclaration.h" 38 #include "core/css/CSSCustomPropertyDeclaration.h"
39 #include "core/css/CSSFontFamilyValue.h" 39 #include "core/css/CSSFontFamilyValue.h"
40 #include "core/css/CSSFontFeatureValue.h" 40 #include "core/css/CSSFontFeatureValue.h"
41 #include "core/css/CSSFunctionValue.h" 41 #include "core/css/CSSFunctionValue.h"
42 #include "core/css/CSSGridLineNamesValue.h" 42 #include "core/css/CSSGridLineNamesValue.h"
43 #include "core/css/CSSGridTemplateAreasValue.h" 43 #include "core/css/CSSGridTemplateAreasValue.h"
44 #include "core/css/CSSIdentifierValue.h"
44 #include "core/css/CSSInitialValue.h" 45 #include "core/css/CSSInitialValue.h"
45 #include "core/css/CSSPathValue.h" 46 #include "core/css/CSSPathValue.h"
46 #include "core/css/CSSPrimitiveValue.h" 47 #include "core/css/CSSPrimitiveValue.h"
47 #include "core/css/CSSPrimitiveValueMappings.h" 48 #include "core/css/CSSPrimitiveValueMappings.h"
48 #include "core/css/CSSQuadValue.h" 49 #include "core/css/CSSQuadValue.h"
49 #include "core/css/CSSReflectValue.h" 50 #include "core/css/CSSReflectValue.h"
50 #include "core/css/CSSShadowValue.h" 51 #include "core/css/CSSShadowValue.h"
51 #include "core/css/CSSStringValue.h" 52 #include "core/css/CSSStringValue.h"
52 #include "core/css/CSSTimingFunctionValue.h" 53 #include "core/css/CSSTimingFunctionValue.h"
53 #include "core/css/CSSURIValue.h" 54 #include "core/css/CSSURIValue.h"
(...skipping 17 matching lines...) Expand all
71 inline static bool isFlexOrGrid(const ComputedStyle* style) 72 inline static bool isFlexOrGrid(const ComputedStyle* style)
72 { 73 {
73 return style && style->isDisplayFlexibleOrGridBox(); 74 return style && style->isDisplayFlexibleOrGridBox();
74 } 75 }
75 76
76 inline static CSSPrimitiveValue* zoomAdjustedPixelValue(double value, const Comp utedStyle& style) 77 inline static CSSPrimitiveValue* zoomAdjustedPixelValue(double value, const Comp utedStyle& style)
77 { 78 {
78 return CSSPrimitiveValue::create(adjustFloatForAbsoluteZoom(value, style), C SSPrimitiveValue::UnitType::Pixels); 79 return CSSPrimitiveValue::create(adjustFloatForAbsoluteZoom(value, style), C SSPrimitiveValue::UnitType::Pixels);
79 } 80 }
80 81
82 inline static CSSValue* zoomAdjustedPixelValueOrAuto(const Length& length, const ComputedStyle& style)
83 {
84 if (length.isAuto())
85 return CSSIdentifierValue::create(CSSValueAuto);
86 return zoomAdjustedPixelValue(length.value(), style);
87 }
88
81 inline static CSSPrimitiveValue* zoomAdjustedNumberValue(double value, const Com putedStyle& style) 89 inline static CSSPrimitiveValue* zoomAdjustedNumberValue(double value, const Com putedStyle& style)
82 { 90 {
83 return CSSPrimitiveValue::create(value / style.effectiveZoom(), CSSPrimitive Value::UnitType::Number); 91 return CSSPrimitiveValue::create(value / style.effectiveZoom(), CSSPrimitive Value::UnitType::Number);
84 } 92 }
85 93
86 static CSSPrimitiveValue* zoomAdjustedPixelValueForLength(const Length& length, const ComputedStyle& style) 94 static CSSValue* zoomAdjustedPixelValueForLength(const Length& length, const Com putedStyle& style)
87 { 95 {
88 if (length.isFixed()) 96 if (length.isFixed())
89 return zoomAdjustedPixelValue(length.value(), style); 97 return zoomAdjustedPixelValue(length.value(), style);
90 return CSSPrimitiveValue::create(length, style.effectiveZoom()); 98 return CSSValue::create(length, style.effectiveZoom());
91 } 99 }
92 100
93 static CSSPrimitiveValue* pixelValueForUnzoomedLength(const UnzoomedLength& unzo omedLength, const ComputedStyle& style) 101 static CSSValue* pixelValueForUnzoomedLength(const UnzoomedLength& unzoomedLengt h, const ComputedStyle& style)
94 { 102 {
95 const Length& length = unzoomedLength.length(); 103 const Length& length = unzoomedLength.length();
96 if (length.isFixed()) 104 if (length.isFixed())
97 return CSSPrimitiveValue::create(length.value(), CSSPrimitiveValue::Unit Type::Pixels); 105 return CSSPrimitiveValue::create(length.value(), CSSPrimitiveValue::Unit Type::Pixels);
98 return CSSPrimitiveValue::create(length, style.effectiveZoom()); 106 return CSSValue::create(length, style.effectiveZoom());
99 } 107 }
100 108
101 static CSSValueList* createPositionListForLayer(CSSPropertyID propertyID, const FillLayer& layer, const ComputedStyle& style) 109 static CSSValueList* createPositionListForLayer(CSSPropertyID propertyID, const FillLayer& layer, const ComputedStyle& style)
102 { 110 {
103 CSSValueList* positionList = CSSValueList::createSpaceSeparated(); 111 CSSValueList* positionList = CSSValueList::createSpaceSeparated();
104 if (layer.isBackgroundXOriginSet()) { 112 if (layer.isBackgroundXOriginSet()) {
105 ASSERT_UNUSED(propertyID, propertyID == CSSPropertyBackgroundPosition || propertyID == CSSPropertyWebkitMaskPosition); 113 ASSERT_UNUSED(propertyID, propertyID == CSSPropertyBackgroundPosition || propertyID == CSSPropertyWebkitMaskPosition);
106 positionList->append(*CSSPrimitiveValue::create(layer.backgroundXOrigin( ))); 114 positionList->append(*CSSIdentifierValue::create(layer.backgroundXOrigin ()));
107 } 115 }
108 positionList->append(*zoomAdjustedPixelValueForLength(layer.xPosition(), sty le)); 116 positionList->append(*zoomAdjustedPixelValueForLength(layer.xPosition(), sty le));
109 if (layer.isBackgroundYOriginSet()) { 117 if (layer.isBackgroundYOriginSet()) {
110 ASSERT(propertyID == CSSPropertyBackgroundPosition || propertyID == CSSP ropertyWebkitMaskPosition); 118 ASSERT(propertyID == CSSPropertyBackgroundPosition || propertyID == CSSP ropertyWebkitMaskPosition);
111 positionList->append(*CSSPrimitiveValue::create(layer.backgroundYOrigin( ))); 119 positionList->append(*CSSIdentifierValue::create(layer.backgroundYOrigin ()));
112 } 120 }
113 positionList->append(*zoomAdjustedPixelValueForLength(layer.yPosition(), sty le)); 121 positionList->append(*zoomAdjustedPixelValueForLength(layer.yPosition(), sty le));
114 return positionList; 122 return positionList;
115 } 123 }
116 124
117 CSSValue* ComputedStyleCSSValueMapping::currentColorOrValidColor(const ComputedS tyle& style, const StyleColor& color) 125 CSSValue* ComputedStyleCSSValueMapping::currentColorOrValidColor(const ComputedS tyle& style, const StyleColor& color)
118 { 126 {
119 // This function does NOT look at visited information, so that computed styl e doesn't expose that. 127 // This function does NOT look at visited information, so that computed styl e doesn't expose that.
120 return CSSColorValue::create(color.resolve(style.color()).rgb()); 128 return CSSColorValue::create(color.resolve(style.color()).rgb());
121 } 129 }
122 130
123 static CSSValue* valueForFillSize(const FillSize& fillSize, const ComputedStyle& style) 131 static CSSValue* valueForFillSize(const FillSize& fillSize, const ComputedStyle& style)
124 { 132 {
125 if (fillSize.type == Contain) 133 if (fillSize.type == Contain)
126 return CSSPrimitiveValue::createIdentifier(CSSValueContain); 134 return CSSIdentifierValue::create(CSSValueContain);
127 135
128 if (fillSize.type == Cover) 136 if (fillSize.type == Cover)
129 return CSSPrimitiveValue::createIdentifier(CSSValueCover); 137 return CSSIdentifierValue::create(CSSValueCover);
130 138
131 if (fillSize.size.height().isAuto()) 139 if (fillSize.size.height().isAuto())
132 return zoomAdjustedPixelValueForLength(fillSize.size.width(), style); 140 return zoomAdjustedPixelValueForLength(fillSize.size.width(), style);
133 141
134 CSSValueList* list = CSSValueList::createSpaceSeparated(); 142 CSSValueList* list = CSSValueList::createSpaceSeparated();
135 list->append(*zoomAdjustedPixelValueForLength(fillSize.size.width(), style)) ; 143 list->append(*zoomAdjustedPixelValueForLength(fillSize.size.width(), style)) ;
136 list->append(*zoomAdjustedPixelValueForLength(fillSize.size.height(), style) ); 144 list->append(*zoomAdjustedPixelValueForLength(fillSize.size.height(), style) );
137 return list; 145 return list;
138 } 146 }
139 147
140 static CSSValue* valueForFillRepeat(EFillRepeat xRepeat, EFillRepeat yRepeat) 148 static CSSValue* valueForFillRepeat(EFillRepeat xRepeat, EFillRepeat yRepeat)
141 { 149 {
142 // For backwards compatibility, if both values are equal, just return one of them. And 150 // For backwards compatibility, if both values are equal, just return one of them. And
143 // if the two values are equivalent to repeat-x or repeat-y, just return the shorthand. 151 // if the two values are equivalent to repeat-x or repeat-y, just return the shorthand.
144 if (xRepeat == yRepeat) 152 if (xRepeat == yRepeat)
145 return CSSPrimitiveValue::create(xRepeat); 153 return CSSIdentifierValue::create(xRepeat);
146 if (xRepeat == RepeatFill && yRepeat == NoRepeatFill) 154 if (xRepeat == RepeatFill && yRepeat == NoRepeatFill)
147 return CSSPrimitiveValue::createIdentifier(CSSValueRepeatX); 155 return CSSIdentifierValue::create(CSSValueRepeatX);
148 if (xRepeat == NoRepeatFill && yRepeat == RepeatFill) 156 if (xRepeat == NoRepeatFill && yRepeat == RepeatFill)
149 return CSSPrimitiveValue::createIdentifier(CSSValueRepeatY); 157 return CSSIdentifierValue::create(CSSValueRepeatY);
150 158
151 CSSValueList* list = CSSValueList::createSpaceSeparated(); 159 CSSValueList* list = CSSValueList::createSpaceSeparated();
152 list->append(*CSSPrimitiveValue::create(xRepeat)); 160 list->append(*CSSIdentifierValue::create(xRepeat));
153 list->append(*CSSPrimitiveValue::create(yRepeat)); 161 list->append(*CSSIdentifierValue::create(yRepeat));
154 return list; 162 return list;
155 } 163 }
156 164
157 static CSSValue* valueForFillSourceType(EMaskSourceType type) 165 static CSSValue* valueForFillSourceType(EMaskSourceType type)
158 { 166 {
159 switch (type) { 167 switch (type) {
160 case MaskAlpha: 168 case MaskAlpha:
161 return CSSPrimitiveValue::createIdentifier(CSSValueAlpha); 169 return CSSIdentifierValue::create(CSSValueAlpha);
162 case MaskLuminance: 170 case MaskLuminance:
163 return CSSPrimitiveValue::createIdentifier(CSSValueLuminance); 171 return CSSIdentifierValue::create(CSSValueLuminance);
164 } 172 }
165 173
166 ASSERT_NOT_REACHED(); 174 ASSERT_NOT_REACHED();
167 175
168 return nullptr; 176 return nullptr;
169 } 177 }
170 178
171 static CSSValue* valueForPositionOffset(const ComputedStyle& style, CSSPropertyI D propertyID, const LayoutObject* layoutObject) 179 static CSSValue* valueForPositionOffset(const ComputedStyle& style, CSSPropertyI D propertyID, const LayoutObject* layoutObject)
172 { 180 {
173 Length offset, opposite; 181 Length offset, opposite;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 218
211 if (opposite.isPercentOrCalc() || opposite.isCalculated()) { 219 if (opposite.isPercentOrCalc() || opposite.isCalculated()) {
212 if (layoutObject->isBox()) { 220 if (layoutObject->isBox()) {
213 LayoutUnit containingBlockSize = 221 LayoutUnit containingBlockSize =
214 (propertyID == CSSPropertyLeft || propertyID == CSSPrope rtyRight) ? 222 (propertyID == CSSPropertyLeft || propertyID == CSSPrope rtyRight) ?
215 toLayoutBox(layoutObject)->containingBlockLogicalWidthFo rContent() : 223 toLayoutBox(layoutObject)->containingBlockLogicalWidthFo rContent() :
216 toLayoutBox(layoutObject)->containingBlockLogicalHeightF orGetComputedStyle(); 224 toLayoutBox(layoutObject)->containingBlockLogicalHeightF orGetComputedStyle();
217 return zoomAdjustedPixelValue(-floatValueForLength(opposite, containingBlockSize), style); 225 return zoomAdjustedPixelValue(-floatValueForLength(opposite, containingBlockSize), style);
218 } 226 }
219 // FIXME: fall back to auto for position:relative, display:inli ne 227 // FIXME: fall back to auto for position:relative, display:inli ne
220 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); 228 return CSSIdentifierValue::create(CSSValueAuto);
221 } 229 }
222 230
223 // Length doesn't provide operator -, so multiply by -1. 231 // Length doesn't provide operator -, so multiply by -1.
224 opposite *= -1.f; 232 opposite *= -1.f;
225 return zoomAdjustedPixelValueForLength(opposite, style); 233 return zoomAdjustedPixelValueForLength(opposite, style);
226 } 234 }
227 235
228 if (layoutObject->isOutOfFlowPositioned() && layoutObject->isBox()) { 236 if (layoutObject->isOutOfFlowPositioned() && layoutObject->isBox()) {
229 // For fixed and absolute positioned elements, the top, left, bottom , and right 237 // For fixed and absolute positioned elements, the top, left, bottom , and right
230 // are defined relative to the corresponding sides of the containing block. 238 // are defined relative to the corresponding sides of the containing block.
(...skipping 22 matching lines...) Expand all
253 (layoutBox->offsetHeight() + clientOffset.height()); 261 (layoutBox->offsetHeight() + clientOffset.height());
254 break; 262 break;
255 default: 263 default:
256 ASSERT_NOT_REACHED(); 264 ASSERT_NOT_REACHED();
257 } 265 }
258 return zoomAdjustedPixelValue(position, style); 266 return zoomAdjustedPixelValue(position, style);
259 } 267 }
260 } 268 }
261 269
262 if (offset.isAuto()) 270 if (offset.isAuto())
263 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); 271 return CSSIdentifierValue::create(CSSValueAuto);
264 272
265 return zoomAdjustedPixelValueForLength(offset, style); 273 return zoomAdjustedPixelValueForLength(offset, style);
266 } 274 }
267 275
268 static CSSBorderImageSliceValue* valueForNinePieceImageSlice(const NinePieceImag e& image) 276 static CSSBorderImageSliceValue* valueForNinePieceImageSlice(const NinePieceImag e& image)
269 { 277 {
270 // Create the slices. 278 // Create the slices.
271 CSSPrimitiveValue* top = nullptr; 279 CSSPrimitiveValue* top = nullptr;
272 CSSPrimitiveValue* right = nullptr; 280 CSSPrimitiveValue* right = nullptr;
273 CSSPrimitiveValue* bottom = nullptr; 281 CSSPrimitiveValue* bottom = nullptr;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 left = CSSPrimitiveValue::create(image.imageSlices().left(). value(), CSSPrimitiveValue::UnitType::Percentage); 314 left = CSSPrimitiveValue::create(image.imageSlices().left(). value(), CSSPrimitiveValue::UnitType::Percentage);
307 else 315 else
308 left = CSSPrimitiveValue::create(image.imageSlices().left(). value(), CSSPrimitiveValue::UnitType::Number); 316 left = CSSPrimitiveValue::create(image.imageSlices().left(). value(), CSSPrimitiveValue::UnitType::Number);
309 } 317 }
310 } 318 }
311 } 319 }
312 320
313 return CSSBorderImageSliceValue::create(CSSQuadValue::create(top, right, bot tom, left, CSSQuadValue::SerializeAsQuad), image.fill()); 321 return CSSBorderImageSliceValue::create(CSSQuadValue::create(top, right, bot tom, left, CSSQuadValue::SerializeAsQuad), image.fill());
314 } 322 }
315 323
316 static CSSPrimitiveValue* valueForBorderImageLength(const BorderImageLength& bor derImageLength, const ComputedStyle& style) 324 static CSSValue* valueForBorderImageLength(const BorderImageLength& borderImageL ength, const ComputedStyle& style)
317 { 325 {
318 if (borderImageLength.isNumber()) 326 if (borderImageLength.isNumber())
319 return CSSPrimitiveValue::create(borderImageLength.number(), CSSPrimitiv eValue::UnitType::Number); 327 return CSSPrimitiveValue::create(borderImageLength.number(), CSSPrimitiv eValue::UnitType::Number);
320 return CSSPrimitiveValue::create(borderImageLength.length(), style.effective Zoom()); 328 return CSSValue::create(borderImageLength.length(), style.effectiveZoom());
321 } 329 }
322 330
323 static CSSQuadValue* valueForNinePieceImageQuad(const BorderImageLengthBox& box, const ComputedStyle& style) 331 static CSSQuadValue* valueForNinePieceImageQuad(const BorderImageLengthBox& box, const ComputedStyle& style)
324 { 332 {
325 // Create the slices. 333 // Create the slices.
326 CSSPrimitiveValue* top = nullptr; 334 CSSValue* top = nullptr;
327 CSSPrimitiveValue* right = nullptr; 335 CSSValue* right = nullptr;
328 CSSPrimitiveValue* bottom = nullptr; 336 CSSValue* bottom = nullptr;
329 CSSPrimitiveValue* left = nullptr; 337 CSSValue* left = nullptr;
330 338
331 top = valueForBorderImageLength(box.top(), style); 339 top = valueForBorderImageLength(box.top(), style);
332 340
333 if (box.right() == box.top() && box.bottom() == box.top() && box.left() == b ox.top()) { 341 if (box.right() == box.top() && box.bottom() == box.top() && box.left() == b ox.top()) {
334 right = top; 342 right = top;
335 bottom = top; 343 bottom = top;
336 left = top; 344 left = top;
337 } else { 345 } else {
338 right = valueForBorderImageLength(box.right(), style); 346 right = valueForBorderImageLength(box.right(), style);
339 347
(...skipping 21 matching lines...) Expand all
361 return CSSValueRound; 369 return CSSValueRound;
362 case SpaceImageRule: 370 case SpaceImageRule:
363 return CSSValueSpace; 371 return CSSValueSpace;
364 default: 372 default:
365 return CSSValueStretch; 373 return CSSValueStretch;
366 } 374 }
367 } 375 }
368 376
369 static CSSValue* valueForNinePieceImageRepeat(const NinePieceImage& image) 377 static CSSValue* valueForNinePieceImageRepeat(const NinePieceImage& image)
370 { 378 {
371 CSSPrimitiveValue* horizontalRepeat = nullptr; 379 CSSIdentifierValue* horizontalRepeat = nullptr;
372 CSSPrimitiveValue* verticalRepeat = nullptr; 380 CSSIdentifierValue* verticalRepeat = nullptr;
373 381
374 horizontalRepeat = CSSPrimitiveValue::createIdentifier(valueForRepeatRule(im age.horizontalRule())); 382 horizontalRepeat = CSSIdentifierValue::create(valueForRepeatRule(image.horiz ontalRule()));
375 if (image.horizontalRule() == image.verticalRule()) 383 if (image.horizontalRule() == image.verticalRule())
376 verticalRepeat = horizontalRepeat; 384 verticalRepeat = horizontalRepeat;
377 else 385 else
378 verticalRepeat = CSSPrimitiveValue::createIdentifier(valueForRepeatRule( image.verticalRule())); 386 verticalRepeat = CSSIdentifierValue::create(valueForRepeatRule(image.ver ticalRule()));
379 return CSSValuePair::create(horizontalRepeat, verticalRepeat, CSSValuePair:: DropIdenticalValues); 387 return CSSValuePair::create(horizontalRepeat, verticalRepeat, CSSValuePair:: DropIdenticalValues);
380 } 388 }
381 389
382 static CSSValue* valueForNinePieceImage(const NinePieceImage& image, const Compu tedStyle& style) 390 static CSSValue* valueForNinePieceImage(const NinePieceImage& image, const Compu tedStyle& style)
383 { 391 {
384 if (!image.hasImage()) 392 if (!image.hasImage())
385 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 393 return CSSIdentifierValue::create(CSSValueNone);
386 394
387 // Image first. 395 // Image first.
388 CSSValue* imageValue = nullptr; 396 CSSValue* imageValue = nullptr;
389 if (image.image()) 397 if (image.image())
390 imageValue = image.image()->computedCSSValue(); 398 imageValue = image.image()->computedCSSValue();
391 399
392 // Create the image slice. 400 // Create the image slice.
393 CSSBorderImageSliceValue* imageSlices = valueForNinePieceImageSlice(image); 401 CSSBorderImageSliceValue* imageSlices = valueForNinePieceImageSlice(image);
394 402
395 // Create the border area slices. 403 // Create the border area slices.
396 CSSValue* borderSlices = valueForNinePieceImageQuad(image.borderSlices(), st yle); 404 CSSValue* borderSlices = valueForNinePieceImageQuad(image.borderSlices(), st yle);
397 405
398 // Create the border outset. 406 // Create the border outset.
399 CSSValue* outset = valueForNinePieceImageQuad(image.outset(), style); 407 CSSValue* outset = valueForNinePieceImageQuad(image.outset(), style);
400 408
401 // Create the repeat rules. 409 // Create the repeat rules.
402 CSSValue* repeat = valueForNinePieceImageRepeat(image); 410 CSSValue* repeat = valueForNinePieceImageRepeat(image);
403 411
404 return createBorderImageValue(imageValue, imageSlices, borderSlices, outset, repeat); 412 return createBorderImageValue(imageValue, imageSlices, borderSlices, outset, repeat);
405 } 413 }
406 414
407 static CSSValue* valueForReflection(const StyleReflection* reflection, const Com putedStyle& style) 415 static CSSValue* valueForReflection(const StyleReflection* reflection, const Com putedStyle& style)
408 { 416 {
409 if (!reflection) 417 if (!reflection)
410 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 418 return CSSIdentifierValue::create(CSSValueNone);
411 419
412 CSSPrimitiveValue* offset = nullptr; 420 CSSPrimitiveValue* offset = nullptr;
413 // TODO(alancutter): Make this work correctly for calc lengths. 421 // TODO(alancutter): Make this work correctly for calc lengths.
414 if (reflection->offset().isPercentOrCalc()) 422 if (reflection->offset().isPercentOrCalc())
415 offset = CSSPrimitiveValue::create(reflection->offset().percent(), CSSPr imitiveValue::UnitType::Percentage); 423 offset = CSSPrimitiveValue::create(reflection->offset().percent(), CSSPr imitiveValue::UnitType::Percentage);
416 else 424 else
417 offset = zoomAdjustedPixelValue(reflection->offset().value(), style); 425 offset = zoomAdjustedPixelValue(reflection->offset().value(), style);
418 426
419 CSSPrimitiveValue* direction = nullptr; 427 CSSIdentifierValue* direction = nullptr;
420 switch (reflection->direction()) { 428 switch (reflection->direction()) {
421 case ReflectionBelow: 429 case ReflectionBelow:
422 direction = CSSPrimitiveValue::createIdentifier(CSSValueBelow); 430 direction = CSSIdentifierValue::create(CSSValueBelow);
423 break; 431 break;
424 case ReflectionAbove: 432 case ReflectionAbove:
425 direction = CSSPrimitiveValue::createIdentifier(CSSValueAbove); 433 direction = CSSIdentifierValue::create(CSSValueAbove);
426 break; 434 break;
427 case ReflectionLeft: 435 case ReflectionLeft:
428 direction = CSSPrimitiveValue::createIdentifier(CSSValueLeft); 436 direction = CSSIdentifierValue::create(CSSValueLeft);
429 break; 437 break;
430 case ReflectionRight: 438 case ReflectionRight:
431 direction = CSSPrimitiveValue::createIdentifier(CSSValueRight); 439 direction = CSSIdentifierValue::create(CSSValueRight);
432 break; 440 break;
433 } 441 }
434 442
435 return CSSReflectValue::create(direction, offset, valueForNinePieceImage(ref lection->mask(), style)); 443 return CSSReflectValue::create(direction, offset, valueForNinePieceImage(ref lection->mask(), style));
436 } 444 }
437 445
438 static CSSValueList* valueForItemPositionWithOverflowAlignment(const StyleSelfAl ignmentData& data) 446 static CSSValueList* valueForItemPositionWithOverflowAlignment(const StyleSelfAl ignmentData& data)
439 { 447 {
440 CSSValueList* result = CSSValueList::createSpaceSeparated(); 448 CSSValueList* result = CSSValueList::createSpaceSeparated();
441 if (data.positionType() == LegacyPosition) 449 if (data.positionType() == LegacyPosition)
442 result->append(*CSSPrimitiveValue::createIdentifier(CSSValueLegacy)); 450 result->append(*CSSIdentifierValue::create(CSSValueLegacy));
443 // To avoid needing to copy the RareNonInheritedData, we repurpose the 'auto ' flag to not just mean 'auto' prior to running the StyleAdjuster but also mean 'normal' after running it. 451 // To avoid needing to copy the RareNonInheritedData, we repurpose the 'auto ' flag to not just mean 'auto' prior to running the StyleAdjuster but also mean 'normal' after running it.
444 result->append(*CSSPrimitiveValue::create(data.position() == ItemPositionAut o ? ComputedStyle::initialDefaultAlignment().position() : data.position())); 452 result->append(*CSSIdentifierValue::create(data.position() == ItemPositionAu to ? ComputedStyle::initialDefaultAlignment().position() : data.position()));
445 if (data.position() >= ItemPositionCenter && data.overflow() != OverflowAlig nmentDefault) 453 if (data.position() >= ItemPositionCenter && data.overflow() != OverflowAlig nmentDefault)
446 result->append(*CSSPrimitiveValue::create(data.overflow())); 454 result->append(*CSSIdentifierValue::create(data.overflow()));
447 ASSERT(result->length() <= 2); 455 ASSERT(result->length() <= 2);
448 return result; 456 return result;
449 } 457 }
450 458
451 static CSSValueList* valuesForGridShorthand(const StylePropertyShorthand& shorth and, const ComputedStyle& style, const LayoutObject* layoutObject, Node* styledN ode, bool allowVisitedStyle) 459 static CSSValueList* valuesForGridShorthand(const StylePropertyShorthand& shorth and, const ComputedStyle& style, const LayoutObject* layoutObject, Node* styledN ode, bool allowVisitedStyle)
452 { 460 {
453 CSSValueList* list = CSSValueList::createSlashSeparated(); 461 CSSValueList* list = CSSValueList::createSlashSeparated();
454 for (size_t i = 0; i < shorthand.length(); ++i) { 462 for (size_t i = 0; i < shorthand.length(); ++i) {
455 const CSSValue* value = ComputedStyleCSSValueMapping::get(shorthand.prop erties()[i], style, layoutObject, styledNode, allowVisitedStyle); 463 const CSSValue* value = ComputedStyleCSSValueMapping::get(shorthand.prop erties()[i], style, layoutObject, styledNode, allowVisitedStyle);
456 ASSERT(value); 464 ASSERT(value);
457 list->append(*value); 465 list->append(*value);
458 } 466 }
459 return list; 467 return list;
460 } 468 }
461 469
462 static CSSValueList* valuesForShorthandProperty(const StylePropertyShorthand& sh orthand, const ComputedStyle& style, const LayoutObject* layoutObject, Node* sty ledNode, bool allowVisitedStyle) 470 static CSSValueList* valuesForShorthandProperty(const StylePropertyShorthand& sh orthand, const ComputedStyle& style, const LayoutObject* layoutObject, Node* sty ledNode, bool allowVisitedStyle)
463 { 471 {
464 CSSValueList* list = CSSValueList::createSpaceSeparated(); 472 CSSValueList* list = CSSValueList::createSpaceSeparated();
465 for (size_t i = 0; i < shorthand.length(); ++i) { 473 for (size_t i = 0; i < shorthand.length(); ++i) {
466 const CSSValue* value = ComputedStyleCSSValueMapping::get(shorthand.prop erties()[i], style, layoutObject, styledNode, allowVisitedStyle); 474 const CSSValue* value = ComputedStyleCSSValueMapping::get(shorthand.prop erties()[i], style, layoutObject, styledNode, allowVisitedStyle);
467 ASSERT(value); 475 ASSERT(value);
468 list->append(*value); 476 list->append(*value);
469 } 477 }
470 return list; 478 return list;
471 } 479 }
472 480
473 static CSSValue* expandNoneLigaturesValue() 481 static CSSValue* expandNoneLigaturesValue()
474 { 482 {
475 CSSValueList* list = CSSValueList::createSpaceSeparated(); 483 CSSValueList* list = CSSValueList::createSpaceSeparated();
476 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueNoCommonLigatures) ); 484 list->append(*CSSIdentifierValue::create(CSSValueNoCommonLigatures));
477 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueNoDiscretionaryLig atures)); 485 list->append(*CSSIdentifierValue::create(CSSValueNoDiscretionaryLigatures));
478 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueNoHistoricalLigatu res)); 486 list->append(*CSSIdentifierValue::create(CSSValueNoHistoricalLigatures));
479 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueNoContextual)); 487 list->append(*CSSIdentifierValue::create(CSSValueNoContextual));
480 return list; 488 return list;
481 } 489 }
482 490
483 static CSSValue* valuesForFontVariantProperty(const ComputedStyle& style, const LayoutObject* layoutObject, Node* styledNode, bool allowVisitedStyle) 491 static CSSValue* valuesForFontVariantProperty(const ComputedStyle& style, const LayoutObject* layoutObject, Node* styledNode, bool allowVisitedStyle)
484 { 492 {
485 enum VariantShorthandCases { AllNormal, NoneLigatures, ConcatenateNonNormal }; 493 enum VariantShorthandCases { AllNormal, NoneLigatures, ConcatenateNonNormal };
486 VariantShorthandCases shorthandCase = AllNormal; 494 VariantShorthandCases shorthandCase = AllNormal;
487 for (size_t i = 0; i < fontVariantShorthand().length(); ++i) { 495 for (size_t i = 0; i < fontVariantShorthand().length(); ++i) {
488 const CSSValue* value = ComputedStyleCSSValueMapping::get(fontVariantSho rthand().properties()[i], style, layoutObject, styledNode, allowVisitedStyle); 496 const CSSValue* value = ComputedStyleCSSValueMapping::get(fontVariantSho rthand().properties()[i], style, layoutObject, styledNode, allowVisitedStyle);
489 497
490 if (shorthandCase == AllNormal 498 if (shorthandCase == AllNormal
491 && value->isPrimitiveValue() 499 && value->isIdentifierValue()
492 && toCSSPrimitiveValue(value)->getValueID() == CSSValueNone 500 && toCSSIdentifierValue(value)->getValueID() == CSSValueNone
493 && fontVariantShorthand().properties()[i] == CSSPropertyFontVariantL igatures) { 501 && fontVariantShorthand().properties()[i] == CSSPropertyFontVariantL igatures) {
494 shorthandCase = NoneLigatures; 502 shorthandCase = NoneLigatures;
495 } else if (!(value->isPrimitiveValue() && toCSSPrimitiveValue(value)->ge tValueID() == CSSValueNormal)) { 503 } else if (!(value->isIdentifierValue() && toCSSIdentifierValue(value)-> getValueID() == CSSValueNormal)) {
496 shorthandCase = ConcatenateNonNormal; 504 shorthandCase = ConcatenateNonNormal;
497 break; 505 break;
498 } 506 }
499 } 507 }
500 508
501 switch (shorthandCase) { 509 switch (shorthandCase) {
502 case AllNormal: 510 case AllNormal:
503 return CSSPrimitiveValue::createIdentifier(CSSValueNormal); 511 return CSSIdentifierValue::create(CSSValueNormal);
504 case NoneLigatures: 512 case NoneLigatures:
505 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 513 return CSSIdentifierValue::create(CSSValueNone);
506 case ConcatenateNonNormal: 514 case ConcatenateNonNormal:
507 { 515 {
508 CSSValueList* list = CSSValueList::createSpaceSeparated(); 516 CSSValueList* list = CSSValueList::createSpaceSeparated();
509 for (size_t i = 0; i < fontVariantShorthand().length(); ++i) { 517 for (size_t i = 0; i < fontVariantShorthand().length(); ++i) {
510 const CSSValue* value = ComputedStyleCSSValueMapping::get(fontVarian tShorthand().properties()[i], style, layoutObject, styledNode, allowVisitedStyle ); 518 const CSSValue* value = ComputedStyleCSSValueMapping::get(fontVarian tShorthand().properties()[i], style, layoutObject, styledNode, allowVisitedStyle );
511 ASSERT(value); 519 ASSERT(value);
512 if (value->isPrimitiveValue() && toCSSPrimitiveValue(value)->getValu eID() == CSSValueNone) { 520 if (value->isIdentifierValue() && toCSSIdentifierValue(value)->getVa lueID() == CSSValueNone) {
513 list->append(*expandNoneLigaturesValue()); 521 list->append(*expandNoneLigaturesValue());
514 } else if (!(value->isPrimitiveValue() && toCSSPrimitiveValue(value) ->getValueID() == CSSValueNormal)) { 522 } else if (!(value->isIdentifierValue() && toCSSIdentifierValue(valu e)->getValueID() == CSSValueNormal)) {
515 list->append(*value); 523 list->append(*value);
516 } 524 }
517 } 525 }
518 return list; 526 return list;
519 } 527 }
520 default: 528 default:
521 NOTREACHED(); 529 NOTREACHED();
522 return nullptr; 530 return nullptr;
523 } 531 }
524 } 532 }
525 533
526 static CSSValueList* valuesForBackgroundShorthand(const ComputedStyle& style, co nst LayoutObject* layoutObject, Node* styledNode, bool allowVisitedStyle) 534 static CSSValueList* valuesForBackgroundShorthand(const ComputedStyle& style, co nst LayoutObject* layoutObject, Node* styledNode, bool allowVisitedStyle)
527 { 535 {
528 CSSValueList* ret = CSSValueList::createCommaSeparated(); 536 CSSValueList* ret = CSSValueList::createCommaSeparated();
529 const FillLayer* currLayer = &style.backgroundLayers(); 537 const FillLayer* currLayer = &style.backgroundLayers();
530 for (; currLayer; currLayer = currLayer->next()) { 538 for (; currLayer; currLayer = currLayer->next()) {
531 CSSValueList* list = CSSValueList::createSlashSeparated(); 539 CSSValueList* list = CSSValueList::createSlashSeparated();
532 CSSValueList* beforeSlash = CSSValueList::createSpaceSeparated(); 540 CSSValueList* beforeSlash = CSSValueList::createSpaceSeparated();
533 if (!currLayer->next()) { // color only for final layer 541 if (!currLayer->next()) { // color only for final layer
534 const CSSValue* value = ComputedStyleCSSValueMapping::get(CSSPropert yBackgroundColor, style, layoutObject, styledNode, allowVisitedStyle); 542 const CSSValue* value = ComputedStyleCSSValueMapping::get(CSSPropert yBackgroundColor, style, layoutObject, styledNode, allowVisitedStyle);
535 ASSERT(value); 543 ASSERT(value);
536 beforeSlash->append(*value); 544 beforeSlash->append(*value);
537 } 545 }
538 beforeSlash->append(currLayer->image() ? *currLayer->image()->computedCS SValue() : *CSSPrimitiveValue::createIdentifier(CSSValueNone)); 546 beforeSlash->append(currLayer->image() ? *currLayer->image()->computedCS SValue() : *CSSIdentifierValue::create(CSSValueNone));
539 beforeSlash->append(*valueForFillRepeat(currLayer->repeatX(), currLayer- >repeatY())); 547 beforeSlash->append(*valueForFillRepeat(currLayer->repeatX(), currLayer- >repeatY()));
540 beforeSlash->append(*CSSPrimitiveValue::create(currLayer->attachment())) ; 548 beforeSlash->append(*CSSIdentifierValue::create(currLayer->attachment()) );
541 beforeSlash->append(*createPositionListForLayer(CSSPropertyBackgroundPos ition, *currLayer, style)); 549 beforeSlash->append(*createPositionListForLayer(CSSPropertyBackgroundPos ition, *currLayer, style));
542 list->append(*beforeSlash); 550 list->append(*beforeSlash);
543 CSSValueList* afterSlash = CSSValueList::createSpaceSeparated(); 551 CSSValueList* afterSlash = CSSValueList::createSpaceSeparated();
544 afterSlash->append(*valueForFillSize(currLayer->size(), style)); 552 afterSlash->append(*valueForFillSize(currLayer->size(), style));
545 afterSlash->append(*CSSPrimitiveValue::create(currLayer->origin())); 553 afterSlash->append(*CSSIdentifierValue::create(currLayer->origin()));
546 afterSlash->append(*CSSPrimitiveValue::create(currLayer->clip())); 554 afterSlash->append(*CSSIdentifierValue::create(currLayer->clip()));
547 list->append(*afterSlash); 555 list->append(*afterSlash);
548 ret->append(*list); 556 ret->append(*list);
549 } 557 }
550 return ret; 558 return ret;
551 } 559 }
552 560
553 static CSSValueList* valueForContentPositionAndDistributionWithOverflowAlignment (const StyleContentAlignmentData& data, CSSValueID normalBehaviorValueID) 561 static CSSValueList* valueForContentPositionAndDistributionWithOverflowAlignment (const StyleContentAlignmentData& data, CSSValueID normalBehaviorValueID)
554 { 562 {
555 CSSValueList* result = CSSValueList::createSpaceSeparated(); 563 CSSValueList* result = CSSValueList::createSpaceSeparated();
556 if (data.distribution() != ContentDistributionDefault) 564 if (data.distribution() != ContentDistributionDefault)
557 result->append(*CSSPrimitiveValue::create(data.distribution())); 565 result->append(*CSSIdentifierValue::create(data.distribution()));
558 if (data.distribution() == ContentDistributionDefault || data.position() != ContentPositionNormal) { 566 if (data.distribution() == ContentDistributionDefault || data.position() != ContentPositionNormal) {
559 if (!RuntimeEnabledFeatures::cssGridLayoutEnabled() && data.position() = = ContentPositionNormal) 567 if (!RuntimeEnabledFeatures::cssGridLayoutEnabled() && data.position() = = ContentPositionNormal)
560 result->append(*CSSPrimitiveValue::createIdentifier(normalBehaviorVa lueID)); 568 result->append(*CSSIdentifierValue::create(normalBehaviorValueID));
561 else 569 else
562 result->append(*CSSPrimitiveValue::create(data.position())); 570 result->append(*CSSIdentifierValue::create(data.position()));
563 } 571 }
564 if ((data.position() >= ContentPositionCenter || data.distribution() != Cont entDistributionDefault) && data.overflow() != OverflowAlignmentDefault) 572 if ((data.position() >= ContentPositionCenter || data.distribution() != Cont entDistributionDefault) && data.overflow() != OverflowAlignmentDefault)
565 result->append(*CSSPrimitiveValue::create(data.overflow())); 573 result->append(*CSSIdentifierValue::create(data.overflow()));
566 ASSERT(result->length() > 0); 574 ASSERT(result->length() > 0);
567 ASSERT(result->length() <= 3); 575 ASSERT(result->length() <= 3);
568 return result; 576 return result;
569 } 577 }
570 578
571 static CSSPrimitiveValue* valueForLineHeight(const ComputedStyle& style) 579 static CSSValue* valueForLineHeight(const ComputedStyle& style)
572 { 580 {
573 Length length = style.lineHeight(); 581 Length length = style.lineHeight();
574 if (length.isNegative()) 582 if (length.isNegative())
575 return CSSPrimitiveValue::createIdentifier(CSSValueNormal); 583 return CSSIdentifierValue::create(CSSValueNormal);
576 584
577 return zoomAdjustedPixelValue(floatValueForLength(length, style.getFontDescr iption().computedSize()), style); 585 return zoomAdjustedPixelValue(floatValueForLength(length, style.getFontDescr iption().computedSize()), style);
578 } 586 }
579 587
580 static CSSValue* valueForPosition(const LengthPoint& position, const ComputedSty le& style) 588 static CSSValue* valueForPosition(const LengthPoint& position, const ComputedSty le& style)
581 { 589 {
582 DCHECK((position.x() == Auto) == (position.y() == Auto)); 590 DCHECK((position.x() == Auto) == (position.y() == Auto));
583 if (position.x() == Auto) { 591 if (position.x() == Auto) {
584 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); 592 return CSSIdentifierValue::create(CSSValueAuto);
585 } 593 }
586 CSSValueList* list = CSSValueList::createSpaceSeparated(); 594 CSSValueList* list = CSSValueList::createSpaceSeparated();
587 list->append(*zoomAdjustedPixelValueForLength(position.x(), style)); 595 list->append(*zoomAdjustedPixelValueForLength(position.x(), style));
588 list->append(*zoomAdjustedPixelValueForLength(position.y(), style)); 596 list->append(*zoomAdjustedPixelValueForLength(position.y(), style));
589 return list; 597 return list;
590 } 598 }
591 599
592 static CSSValueID identifierForFamily(const AtomicString& family) 600 static CSSValueID identifierForFamily(const AtomicString& family)
593 { 601 {
594 if (family == FontFamilyNames::webkit_cursive) 602 if (family == FontFamilyNames::webkit_cursive)
595 return CSSValueCursive; 603 return CSSValueCursive;
596 if (family == FontFamilyNames::webkit_fantasy) 604 if (family == FontFamilyNames::webkit_fantasy)
597 return CSSValueFantasy; 605 return CSSValueFantasy;
598 if (family == FontFamilyNames::webkit_monospace) 606 if (family == FontFamilyNames::webkit_monospace)
599 return CSSValueMonospace; 607 return CSSValueMonospace;
600 if (family == FontFamilyNames::webkit_pictograph) 608 if (family == FontFamilyNames::webkit_pictograph)
601 return CSSValueWebkitPictograph; 609 return CSSValueWebkitPictograph;
602 if (family == FontFamilyNames::webkit_sans_serif) 610 if (family == FontFamilyNames::webkit_sans_serif)
603 return CSSValueSansSerif; 611 return CSSValueSansSerif;
604 if (family == FontFamilyNames::webkit_serif) 612 if (family == FontFamilyNames::webkit_serif)
605 return CSSValueSerif; 613 return CSSValueSerif;
606 return CSSValueInvalid; 614 return CSSValueInvalid;
607 } 615 }
608 616
609 static CSSValue* valueForFamily(const AtomicString& family) 617 static CSSValue* valueForFamily(const AtomicString& family)
610 { 618 {
611 if (CSSValueID familyIdentifier = identifierForFamily(family)) 619 if (CSSValueID familyIdentifier = identifierForFamily(family))
612 return CSSPrimitiveValue::createIdentifier(familyIdentifier); 620 return CSSIdentifierValue::create(familyIdentifier);
613 return CSSFontFamilyValue::create(family.getString()); 621 return CSSFontFamilyValue::create(family.getString());
614 } 622 }
615 623
616 static CSSValueList* valueForFontFamily(const ComputedStyle& style) 624 static CSSValueList* valueForFontFamily(const ComputedStyle& style)
617 { 625 {
618 const FontFamily& firstFamily = style.getFontDescription().family(); 626 const FontFamily& firstFamily = style.getFontDescription().family();
619 CSSValueList* list = CSSValueList::createCommaSeparated(); 627 CSSValueList* list = CSSValueList::createCommaSeparated();
620 for (const FontFamily* family = &firstFamily; family; family = family->next( )) 628 for (const FontFamily* family = &firstFamily; family; family = family->next( ))
621 list->append(*valueForFamily(family->family())); 629 list->append(*valueForFamily(family->family()));
622 return list; 630 return list;
623 } 631 }
624 632
625 static CSSPrimitiveValue* valueForFontSize(const ComputedStyle& style) 633 static CSSPrimitiveValue* valueForFontSize(const ComputedStyle& style)
626 { 634 {
627 return zoomAdjustedPixelValue(style.getFontDescription().computedSize(), sty le); 635 return zoomAdjustedPixelValue(style.getFontDescription().computedSize(), sty le);
628 } 636 }
629 637
630 static CSSPrimitiveValue* valueForFontStretch(const ComputedStyle& style) 638 static CSSIdentifierValue* valueForFontStretch(const ComputedStyle& style)
631 { 639 {
632 return CSSPrimitiveValue::create(style.getFontDescription().stretch()); 640 return CSSIdentifierValue::create(style.getFontDescription().stretch());
633 } 641 }
634 642
635 static CSSPrimitiveValue* valueForFontStyle(const ComputedStyle& style) 643 static CSSIdentifierValue* valueForFontStyle(const ComputedStyle& style)
636 { 644 {
637 return CSSPrimitiveValue::create(style.getFontDescription().style()); 645 return CSSIdentifierValue::create(style.getFontDescription().style());
638 } 646 }
639 647
640 static CSSPrimitiveValue* valueForFontWeight(const ComputedStyle& style) 648 static CSSIdentifierValue* valueForFontWeight(const ComputedStyle& style)
641 { 649 {
642 return CSSPrimitiveValue::create(style.getFontDescription().weight()); 650 return CSSIdentifierValue::create(style.getFontDescription().weight());
643 } 651 }
644 652
645 static CSSPrimitiveValue* valueForFontVariantCaps(const ComputedStyle& style) 653 static CSSIdentifierValue* valueForFontVariantCaps(const ComputedStyle& style)
646 { 654 {
647 FontDescription::FontVariantCaps variantCaps = style.getFontDescription().va riantCaps(); 655 FontDescription::FontVariantCaps variantCaps = style.getFontDescription().va riantCaps();
648 switch (variantCaps) { 656 switch (variantCaps) {
649 case FontDescription::CapsNormal: 657 case FontDescription::CapsNormal:
650 return CSSPrimitiveValue::createIdentifier(CSSValueNormal); 658 return CSSIdentifierValue::create(CSSValueNormal);
651 case FontDescription::SmallCaps: 659 case FontDescription::SmallCaps:
652 return CSSPrimitiveValue::createIdentifier(CSSValueSmallCaps); 660 return CSSIdentifierValue::create(CSSValueSmallCaps);
653 case FontDescription::AllSmallCaps: 661 case FontDescription::AllSmallCaps:
654 return CSSPrimitiveValue::createIdentifier(CSSValueAllSmallCaps); 662 return CSSIdentifierValue::create(CSSValueAllSmallCaps);
655 case FontDescription::PetiteCaps: 663 case FontDescription::PetiteCaps:
656 return CSSPrimitiveValue::createIdentifier(CSSValuePetiteCaps); 664 return CSSIdentifierValue::create(CSSValuePetiteCaps);
657 case FontDescription::AllPetiteCaps: 665 case FontDescription::AllPetiteCaps:
658 return CSSPrimitiveValue::createIdentifier(CSSValueAllPetiteCaps); 666 return CSSIdentifierValue::create(CSSValueAllPetiteCaps);
659 case FontDescription::Unicase: 667 case FontDescription::Unicase:
660 return CSSPrimitiveValue::createIdentifier(CSSValueUnicase); 668 return CSSIdentifierValue::create(CSSValueUnicase);
661 case FontDescription::TitlingCaps: 669 case FontDescription::TitlingCaps:
662 return CSSPrimitiveValue::createIdentifier(CSSValueTitlingCaps); 670 return CSSIdentifierValue::create(CSSValueTitlingCaps);
663 default: 671 default:
664 NOTREACHED(); 672 NOTREACHED();
665 return nullptr; 673 return nullptr;
666 } 674 }
667 } 675 }
668 676
669 static CSSValue* valueForFontVariantLigatures(const ComputedStyle& style) 677 static CSSValue* valueForFontVariantLigatures(const ComputedStyle& style)
670 { 678 {
671 FontDescription::LigaturesState commonLigaturesState = style.getFontDescript ion().commonLigaturesState(); 679 FontDescription::LigaturesState commonLigaturesState = style.getFontDescript ion().commonLigaturesState();
672 FontDescription::LigaturesState discretionaryLigaturesState = style.getFontD escription().discretionaryLigaturesState(); 680 FontDescription::LigaturesState discretionaryLigaturesState = style.getFontD escription().discretionaryLigaturesState();
673 FontDescription::LigaturesState historicalLigaturesState = style.getFontDesc ription().historicalLigaturesState(); 681 FontDescription::LigaturesState historicalLigaturesState = style.getFontDesc ription().historicalLigaturesState();
674 FontDescription::LigaturesState contextualLigaturesState = style.getFontDesc ription().contextualLigaturesState(); 682 FontDescription::LigaturesState contextualLigaturesState = style.getFontDesc ription().contextualLigaturesState();
675 if (commonLigaturesState == FontDescription::NormalLigaturesState && discret ionaryLigaturesState == FontDescription::NormalLigaturesState 683 if (commonLigaturesState == FontDescription::NormalLigaturesState && discret ionaryLigaturesState == FontDescription::NormalLigaturesState
676 && historicalLigaturesState == FontDescription::NormalLigaturesState && contextualLigaturesState == FontDescription::NormalLigaturesState) 684 && historicalLigaturesState == FontDescription::NormalLigaturesState && contextualLigaturesState == FontDescription::NormalLigaturesState)
677 return CSSPrimitiveValue::createIdentifier(CSSValueNormal); 685 return CSSIdentifierValue::create(CSSValueNormal);
678 686
679 if (commonLigaturesState == FontDescription::DisabledLigaturesState && discr etionaryLigaturesState == FontDescription::DisabledLigaturesState 687 if (commonLigaturesState == FontDescription::DisabledLigaturesState && discr etionaryLigaturesState == FontDescription::DisabledLigaturesState
680 && historicalLigaturesState == FontDescription::DisabledLigaturesState & & contextualLigaturesState == FontDescription::DisabledLigaturesState) 688 && historicalLigaturesState == FontDescription::DisabledLigaturesState & & contextualLigaturesState == FontDescription::DisabledLigaturesState)
681 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 689 return CSSIdentifierValue::create(CSSValueNone);
682 690
683 CSSValueList* valueList = CSSValueList::createSpaceSeparated(); 691 CSSValueList* valueList = CSSValueList::createSpaceSeparated();
684 if (commonLigaturesState != FontDescription::NormalLigaturesState) 692 if (commonLigaturesState != FontDescription::NormalLigaturesState)
685 valueList->append(*CSSPrimitiveValue::createIdentifier(commonLigaturesSt ate == FontDescription::DisabledLigaturesState ? CSSValueNoCommonLigatures : CSS ValueCommonLigatures)); 693 valueList->append(*CSSIdentifierValue::create(commonLigaturesState == Fo ntDescription::DisabledLigaturesState ? CSSValueNoCommonLigatures : CSSValueComm onLigatures));
686 if (discretionaryLigaturesState != FontDescription::NormalLigaturesState) 694 if (discretionaryLigaturesState != FontDescription::NormalLigaturesState)
687 valueList->append(*CSSPrimitiveValue::createIdentifier(discretionaryLiga turesState == FontDescription::DisabledLigaturesState ? CSSValueNoDiscretionaryL igatures : CSSValueDiscretionaryLigatures)); 695 valueList->append(*CSSIdentifierValue::create(discretionaryLigaturesStat e == FontDescription::DisabledLigaturesState ? CSSValueNoDiscretionaryLigatures : CSSValueDiscretionaryLigatures));
688 if (historicalLigaturesState != FontDescription::NormalLigaturesState) 696 if (historicalLigaturesState != FontDescription::NormalLigaturesState)
689 valueList->append(*CSSPrimitiveValue::createIdentifier(historicalLigatur esState == FontDescription::DisabledLigaturesState ? CSSValueNoHistoricalLigatur es : CSSValueHistoricalLigatures)); 697 valueList->append(*CSSIdentifierValue::create(historicalLigaturesState = = FontDescription::DisabledLigaturesState ? CSSValueNoHistoricalLigatures : CSSV alueHistoricalLigatures));
690 if (contextualLigaturesState != FontDescription::NormalLigaturesState) 698 if (contextualLigaturesState != FontDescription::NormalLigaturesState)
691 valueList->append(*CSSPrimitiveValue::createIdentifier(contextualLigatur esState == FontDescription::DisabledLigaturesState ? CSSValueNoContextual : CSSV alueContextual)); 699 valueList->append(*CSSIdentifierValue::create(contextualLigaturesState = = FontDescription::DisabledLigaturesState ? CSSValueNoContextual : CSSValueConte xtual));
692 return valueList; 700 return valueList;
693 } 701 }
694 702
695 static CSSValue* valueForFontVariantNumeric(const ComputedStyle& style) 703 static CSSValue* valueForFontVariantNumeric(const ComputedStyle& style)
696 { 704 {
697 FontVariantNumeric variantNumeric = style.getFontDescription().variantNumeri c(); 705 FontVariantNumeric variantNumeric = style.getFontDescription().variantNumeri c();
698 if (variantNumeric.isAllNormal()) 706 if (variantNumeric.isAllNormal())
699 return CSSPrimitiveValue::createIdentifier(CSSValueNormal); 707 return CSSIdentifierValue::create(CSSValueNormal);
700 708
701 CSSValueList* valueList = CSSValueList::createSpaceSeparated(); 709 CSSValueList* valueList = CSSValueList::createSpaceSeparated();
702 if (variantNumeric.numericFigureValue() != FontVariantNumeric::NormalFigure) 710 if (variantNumeric.numericFigureValue() != FontVariantNumeric::NormalFigure)
703 valueList->append(*CSSPrimitiveValue::createIdentifier(variantNumeric.nu mericFigureValue() == FontVariantNumeric::LiningNums ? CSSValueLiningNums : CSSV alueOldstyleNums)); 711 valueList->append(*CSSIdentifierValue::create(variantNumeric.numericFigu reValue() == FontVariantNumeric::LiningNums ? CSSValueLiningNums : CSSValueOldst yleNums));
704 if (variantNumeric.numericSpacingValue() != FontVariantNumeric::NormalSpacin g) 712 if (variantNumeric.numericSpacingValue() != FontVariantNumeric::NormalSpacin g)
705 valueList->append(*CSSPrimitiveValue::createIdentifier(variantNumeric.nu mericSpacingValue() == FontVariantNumeric::ProportionalNums ? CSSValueProportion alNums : CSSValueTabularNums)); 713 valueList->append(*CSSIdentifierValue::create(variantNumeric.numericSpac ingValue() == FontVariantNumeric::ProportionalNums ? CSSValueProportionalNums : CSSValueTabularNums));
706 if (variantNumeric.numericFractionValue() != FontVariantNumeric::NormalFract ion) 714 if (variantNumeric.numericFractionValue() != FontVariantNumeric::NormalFract ion)
707 valueList->append(*CSSPrimitiveValue::createIdentifier(variantNumeric.nu mericFractionValue() == FontVariantNumeric::DiagonalFractions ? CSSValueDiagonal Fractions : CSSValueStackedFractions)); 715 valueList->append(*CSSIdentifierValue::create(variantNumeric.numericFrac tionValue() == FontVariantNumeric::DiagonalFractions ? CSSValueDiagonalFractions : CSSValueStackedFractions));
708 if (variantNumeric.ordinalValue() == FontVariantNumeric::OrdinalOn) 716 if (variantNumeric.ordinalValue() == FontVariantNumeric::OrdinalOn)
709 valueList->append(*CSSPrimitiveValue::createIdentifier(CSSValueOrdinal)) ; 717 valueList->append(*CSSIdentifierValue::create(CSSValueOrdinal));
710 if (variantNumeric.slashedZeroValue() == FontVariantNumeric::SlashedZeroOn) 718 if (variantNumeric.slashedZeroValue() == FontVariantNumeric::SlashedZeroOn)
711 valueList->append(*CSSPrimitiveValue::createIdentifier(CSSValueSlashedZe ro)); 719 valueList->append(*CSSIdentifierValue::create(CSSValueSlashedZero));
712 720
713 return valueList; 721 return valueList;
714 } 722 }
715 723
716 724
717 static CSSValue* specifiedValueForGridTrackBreadth(const GridLength& trackBreadt h, const ComputedStyle& style) 725 static CSSValue* specifiedValueForGridTrackBreadth(const GridLength& trackBreadt h, const ComputedStyle& style)
718 { 726 {
719 if (!trackBreadth.isLength()) 727 if (!trackBreadth.isLength())
720 return CSSPrimitiveValue::create(trackBreadth.flex(), CSSPrimitiveValue: :UnitType::Fraction); 728 return CSSPrimitiveValue::create(trackBreadth.flex(), CSSPrimitiveValue: :UnitType::Fraction);
721 729
722 const Length& trackBreadthLength = trackBreadth.length(); 730 const Length& trackBreadthLength = trackBreadth.length();
723 if (trackBreadthLength.isAuto()) 731 if (trackBreadthLength.isAuto())
724 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); 732 return CSSIdentifierValue::create(CSSValueAuto);
725 return zoomAdjustedPixelValueForLength(trackBreadthLength, style); 733 return zoomAdjustedPixelValueForLength(trackBreadthLength, style);
726 } 734 }
727 735
728 static CSSValue* specifiedValueForGridTrackSize(const GridTrackSize& trackSize, const ComputedStyle& style) 736 static CSSValue* specifiedValueForGridTrackSize(const GridTrackSize& trackSize, const ComputedStyle& style)
729 { 737 {
730 switch (trackSize.type()) { 738 switch (trackSize.type()) {
731 case LengthTrackSizing: 739 case LengthTrackSizing:
732 return specifiedValueForGridTrackBreadth(trackSize.minTrackBreadth(), st yle); 740 return specifiedValueForGridTrackBreadth(trackSize.minTrackBreadth(), st yle);
733 case MinMaxTrackSizing: { 741 case MinMaxTrackSizing: {
734 auto* minMaxTrackBreadths = CSSFunctionValue::create(CSSValueMinmax); 742 auto* minMaxTrackBreadths = CSSFunctionValue::create(CSSValueMinmax);
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
848 // Handle the 'none' case. 856 // Handle the 'none' case.
849 bool trackListIsEmpty = trackSizes.isEmpty() && autoRepeatTrackSizes.isEmpty (); 857 bool trackListIsEmpty = trackSizes.isEmpty() && autoRepeatTrackSizes.isEmpty ();
850 if (isLayoutGrid && trackListIsEmpty) { 858 if (isLayoutGrid && trackListIsEmpty) {
851 // For grids we should consider every listed track, whether implicitly o r explicitly 859 // For grids we should consider every listed track, whether implicitly o r explicitly
852 // created. Empty grids have a sole grid line per axis. 860 // created. Empty grids have a sole grid line per axis.
853 auto& positions = isRowAxis ? toLayoutGrid(layoutObject)->columnPosition s() : toLayoutGrid(layoutObject)->rowPositions(); 861 auto& positions = isRowAxis ? toLayoutGrid(layoutObject)->columnPosition s() : toLayoutGrid(layoutObject)->rowPositions();
854 trackListIsEmpty = positions.size() == 1; 862 trackListIsEmpty = positions.size() == 1;
855 } 863 }
856 864
857 if (trackListIsEmpty) 865 if (trackListIsEmpty)
858 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 866 return CSSIdentifierValue::create(CSSValueNone);
859 867
860 size_t autoRepeatTotalTracks = isLayoutGrid ? toLayoutGrid(layoutObject)->au toRepeatCountForDirection(direction) : 0; 868 size_t autoRepeatTotalTracks = isLayoutGrid ? toLayoutGrid(layoutObject)->au toRepeatCountForDirection(direction) : 0;
861 OrderedNamedLinesCollector collector(style, isRowAxis, autoRepeatTotalTracks ); 869 OrderedNamedLinesCollector collector(style, isRowAxis, autoRepeatTotalTracks );
862 CSSValueList* list = CSSValueList::createSpaceSeparated(); 870 CSSValueList* list = CSSValueList::createSpaceSeparated();
863 size_t insertionIndex; 871 size_t insertionIndex;
864 if (isLayoutGrid) { 872 if (isLayoutGrid) {
865 const auto* grid = toLayoutGrid(layoutObject); 873 const auto* grid = toLayoutGrid(layoutObject);
866 Vector<LayoutUnit> computedTrackSizes = grid->trackSizesForComputedStyle (direction); 874 Vector<LayoutUnit> computedTrackSizes = grid->trackSizesForComputedStyle (direction);
867 size_t numTracks = computedTrackSizes.size(); 875 size_t numTracks = computedTrackSizes.size();
868 876
(...skipping 12 matching lines...) Expand all
881 insertionIndex = trackSizes.size(); 889 insertionIndex = trackSizes.size();
882 } 890 }
883 // Those are the trailing <string>* allowed in the syntax. 891 // Those are the trailing <string>* allowed in the syntax.
884 addValuesForNamedGridLinesAtIndex(collector, insertionIndex, *list); 892 addValuesForNamedGridLinesAtIndex(collector, insertionIndex, *list);
885 return list; 893 return list;
886 } 894 }
887 895
888 static CSSValue* valueForGridPosition(const GridPosition& position) 896 static CSSValue* valueForGridPosition(const GridPosition& position)
889 { 897 {
890 if (position.isAuto()) 898 if (position.isAuto())
891 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); 899 return CSSIdentifierValue::create(CSSValueAuto);
892 900
893 if (position.isNamedGridArea()) 901 if (position.isNamedGridArea())
894 return CSSCustomIdentValue::create(position.namedGridLine()); 902 return CSSCustomIdentValue::create(position.namedGridLine());
895 903
896 CSSValueList* list = CSSValueList::createSpaceSeparated(); 904 CSSValueList* list = CSSValueList::createSpaceSeparated();
897 if (position.isSpan()) { 905 if (position.isSpan()) {
898 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueSpan)); 906 list->append(*CSSIdentifierValue::create(CSSValueSpan));
899 list->append(*CSSPrimitiveValue::create(position.spanPosition(), CSSPrim itiveValue::UnitType::Number)); 907 list->append(*CSSPrimitiveValue::create(position.spanPosition(), CSSPrim itiveValue::UnitType::Number));
900 } else { 908 } else {
901 list->append(*CSSPrimitiveValue::create(position.integerPosition(), CSSP rimitiveValue::UnitType::Number)); 909 list->append(*CSSPrimitiveValue::create(position.integerPosition(), CSSP rimitiveValue::UnitType::Number));
902 } 910 }
903 911
904 if (!position.namedGridLine().isNull()) 912 if (!position.namedGridLine().isNull())
905 list->append(*CSSCustomIdentValue::create(position.namedGridLine())); 913 list->append(*CSSCustomIdentValue::create(position.namedGridLine()));
906 return list; 914 return list;
907 } 915 }
908 916
909 static LayoutRect sizingBox(const LayoutObject* layoutObject) 917 static LayoutRect sizingBox(const LayoutObject* layoutObject)
910 { 918 {
911 if (!layoutObject->isBox()) 919 if (!layoutObject->isBox())
912 return LayoutRect(); 920 return LayoutRect();
913 921
914 const LayoutBox* box = toLayoutBox(layoutObject); 922 const LayoutBox* box = toLayoutBox(layoutObject);
915 return box->style()->boxSizing() == BoxSizingBorderBox ? box->borderBoxRect( ) : box->computedCSSContentBoxRect(); 923 return box->style()->boxSizing() == BoxSizingBorderBox ? box->borderBoxRect( ) : box->computedCSSContentBoxRect();
916 } 924 }
917 925
918 static CSSValue* renderTextDecorationFlagsToCSSValue(int textDecoration) 926 static CSSValue* renderTextDecorationFlagsToCSSValue(int textDecoration)
919 { 927 {
920 // Blink value is ignored. 928 // Blink value is ignored.
921 CSSValueList* list = CSSValueList::createSpaceSeparated(); 929 CSSValueList* list = CSSValueList::createSpaceSeparated();
922 if (textDecoration & TextDecorationUnderline) 930 if (textDecoration & TextDecorationUnderline)
923 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueUnderline)); 931 list->append(*CSSIdentifierValue::create(CSSValueUnderline));
924 if (textDecoration & TextDecorationOverline) 932 if (textDecoration & TextDecorationOverline)
925 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueOverline)); 933 list->append(*CSSIdentifierValue::create(CSSValueOverline));
926 if (textDecoration & TextDecorationLineThrough) 934 if (textDecoration & TextDecorationLineThrough)
927 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueLineThrough)); 935 list->append(*CSSIdentifierValue::create(CSSValueLineThrough));
928 936
929 if (!list->length()) 937 if (!list->length())
930 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 938 return CSSIdentifierValue::create(CSSValueNone);
931 return list; 939 return list;
932 } 940 }
933 941
934 static CSSValue* valueForTextDecorationStyle(TextDecorationStyle textDecorationS tyle) 942 static CSSValue* valueForTextDecorationStyle(TextDecorationStyle textDecorationS tyle)
935 { 943 {
936 switch (textDecorationStyle) { 944 switch (textDecorationStyle) {
937 case TextDecorationStyleSolid: 945 case TextDecorationStyleSolid:
938 return CSSPrimitiveValue::createIdentifier(CSSValueSolid); 946 return CSSIdentifierValue::create(CSSValueSolid);
939 case TextDecorationStyleDouble: 947 case TextDecorationStyleDouble:
940 return CSSPrimitiveValue::createIdentifier(CSSValueDouble); 948 return CSSIdentifierValue::create(CSSValueDouble);
941 case TextDecorationStyleDotted: 949 case TextDecorationStyleDotted:
942 return CSSPrimitiveValue::createIdentifier(CSSValueDotted); 950 return CSSIdentifierValue::create(CSSValueDotted);
943 case TextDecorationStyleDashed: 951 case TextDecorationStyleDashed:
944 return CSSPrimitiveValue::createIdentifier(CSSValueDashed); 952 return CSSIdentifierValue::create(CSSValueDashed);
945 case TextDecorationStyleWavy: 953 case TextDecorationStyleWavy:
946 return CSSPrimitiveValue::createIdentifier(CSSValueWavy); 954 return CSSIdentifierValue::create(CSSValueWavy);
947 } 955 }
948 956
949 ASSERT_NOT_REACHED(); 957 ASSERT_NOT_REACHED();
950 return CSSInitialValue::create(); 958 return CSSInitialValue::create();
951 } 959 }
952 960
953 static CSSValue* touchActionFlagsToCSSValue(TouchAction touchAction) 961 static CSSValue* touchActionFlagsToCSSValue(TouchAction touchAction)
954 { 962 {
955 CSSValueList* list = CSSValueList::createSpaceSeparated(); 963 CSSValueList* list = CSSValueList::createSpaceSeparated();
956 if (touchAction == TouchActionAuto) { 964 if (touchAction == TouchActionAuto) {
957 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueAuto)); 965 list->append(*CSSIdentifierValue::create(CSSValueAuto));
958 } else if (touchAction == TouchActionNone) { 966 } else if (touchAction == TouchActionNone) {
959 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueNone)); 967 list->append(*CSSIdentifierValue::create(CSSValueNone));
960 } else if (touchAction == TouchActionManipulation) { 968 } else if (touchAction == TouchActionManipulation) {
961 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueManipulation)) ; 969 list->append(*CSSIdentifierValue::create(CSSValueManipulation));
962 } else { 970 } else {
963 if ((touchAction & TouchActionPanX) == TouchActionPanX) 971 if ((touchAction & TouchActionPanX) == TouchActionPanX)
964 list->append(*CSSPrimitiveValue::createIdentifier(CSSValuePanX)); 972 list->append(*CSSIdentifierValue::create(CSSValuePanX));
965 else if (touchAction & TouchActionPanLeft) 973 else if (touchAction & TouchActionPanLeft)
966 list->append(*CSSPrimitiveValue::createIdentifier(CSSValuePanLeft)); 974 list->append(*CSSIdentifierValue::create(CSSValuePanLeft));
967 else if (touchAction & TouchActionPanRight) 975 else if (touchAction & TouchActionPanRight)
968 list->append(*CSSPrimitiveValue::createIdentifier(CSSValuePanRight)) ; 976 list->append(*CSSIdentifierValue::create(CSSValuePanRight));
969 if ((touchAction & TouchActionPanY) == TouchActionPanY) 977 if ((touchAction & TouchActionPanY) == TouchActionPanY)
970 list->append(*CSSPrimitiveValue::createIdentifier(CSSValuePanY)); 978 list->append(*CSSIdentifierValue::create(CSSValuePanY));
971 else if (touchAction & TouchActionPanUp) 979 else if (touchAction & TouchActionPanUp)
972 list->append(*CSSPrimitiveValue::createIdentifier(CSSValuePanUp)); 980 list->append(*CSSIdentifierValue::create(CSSValuePanUp));
973 else if (touchAction & TouchActionPanDown) 981 else if (touchAction & TouchActionPanDown)
974 list->append(*CSSPrimitiveValue::createIdentifier(CSSValuePanDown)); 982 list->append(*CSSIdentifierValue::create(CSSValuePanDown));
975 983
976 if ((touchAction & TouchActionPinchZoom) == TouchActionPinchZoom) 984 if ((touchAction & TouchActionPinchZoom) == TouchActionPinchZoom)
977 list->append(*CSSPrimitiveValue::createIdentifier(CSSValuePinchZoom) ); 985 list->append(*CSSIdentifierValue::create(CSSValuePinchZoom));
978 } 986 }
979 987
980 ASSERT(list->length()); 988 ASSERT(list->length());
981 return list; 989 return list;
982 } 990 }
983 991
984 static CSSValue* valueForWillChange(const Vector<CSSPropertyID>& willChangePrope rties, bool willChangeContents, bool willChangeScrollPosition) 992 static CSSValue* valueForWillChange(const Vector<CSSPropertyID>& willChangePrope rties, bool willChangeContents, bool willChangeScrollPosition)
985 { 993 {
986 CSSValueList* list = CSSValueList::createCommaSeparated(); 994 CSSValueList* list = CSSValueList::createCommaSeparated();
987 if (willChangeContents) 995 if (willChangeContents)
988 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueContents)); 996 list->append(*CSSIdentifierValue::create(CSSValueContents));
989 if (willChangeScrollPosition) 997 if (willChangeScrollPosition)
990 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueScrollPosition )); 998 list->append(*CSSIdentifierValue::create(CSSValueScrollPosition));
991 for (size_t i = 0; i < willChangeProperties.size(); ++i) 999 for (size_t i = 0; i < willChangeProperties.size(); ++i)
992 list->append(*CSSCustomIdentValue::create(willChangeProperties[i])); 1000 list->append(*CSSCustomIdentValue::create(willChangeProperties[i]));
993 if (!list->length()) 1001 if (!list->length())
994 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueAuto)); 1002 list->append(*CSSIdentifierValue::create(CSSValueAuto));
995 return list; 1003 return list;
996 } 1004 }
997 1005
998 static CSSValue* valueForAnimationDelay(const CSSTimingData* timingData) 1006 static CSSValue* valueForAnimationDelay(const CSSTimingData* timingData)
999 { 1007 {
1000 CSSValueList* list = CSSValueList::createCommaSeparated(); 1008 CSSValueList* list = CSSValueList::createCommaSeparated();
1001 if (timingData) { 1009 if (timingData) {
1002 for (size_t i = 0; i < timingData->delayList().size(); ++i) 1010 for (size_t i = 0; i < timingData->delayList().size(); ++i)
1003 list->append(*CSSPrimitiveValue::create(timingData->delayList()[i], CSSPrimitiveValue::UnitType::Seconds)); 1011 list->append(*CSSPrimitiveValue::create(timingData->delayList()[i], CSSPrimitiveValue::UnitType::Seconds));
1004 } else { 1012 } else {
1005 list->append(*CSSPrimitiveValue::create(CSSTimingData::initialDelay(), C SSPrimitiveValue::UnitType::Seconds)); 1013 list->append(*CSSPrimitiveValue::create(CSSTimingData::initialDelay(), C SSPrimitiveValue::UnitType::Seconds));
1006 } 1014 }
1007 return list; 1015 return list;
1008 } 1016 }
1009 1017
1010 static CSSValue* valueForAnimationDirection(Timing::PlaybackDirection direction) 1018 static CSSValue* valueForAnimationDirection(Timing::PlaybackDirection direction)
1011 { 1019 {
1012 switch (direction) { 1020 switch (direction) {
1013 case Timing::PlaybackDirection::NORMAL: 1021 case Timing::PlaybackDirection::NORMAL:
1014 return CSSPrimitiveValue::createIdentifier(CSSValueNormal); 1022 return CSSIdentifierValue::create(CSSValueNormal);
1015 case Timing::PlaybackDirection::ALTERNATE_NORMAL: 1023 case Timing::PlaybackDirection::ALTERNATE_NORMAL:
1016 return CSSPrimitiveValue::createIdentifier(CSSValueAlternate); 1024 return CSSIdentifierValue::create(CSSValueAlternate);
1017 case Timing::PlaybackDirection::REVERSE: 1025 case Timing::PlaybackDirection::REVERSE:
1018 return CSSPrimitiveValue::createIdentifier(CSSValueReverse); 1026 return CSSIdentifierValue::create(CSSValueReverse);
1019 case Timing::PlaybackDirection::ALTERNATE_REVERSE: 1027 case Timing::PlaybackDirection::ALTERNATE_REVERSE:
1020 return CSSPrimitiveValue::createIdentifier(CSSValueAlternateReverse); 1028 return CSSIdentifierValue::create(CSSValueAlternateReverse);
1021 default: 1029 default:
1022 ASSERT_NOT_REACHED(); 1030 ASSERT_NOT_REACHED();
1023 return nullptr; 1031 return nullptr;
1024 } 1032 }
1025 } 1033 }
1026 1034
1027 static CSSValue* valueForAnimationDuration(const CSSTimingData* timingData) 1035 static CSSValue* valueForAnimationDuration(const CSSTimingData* timingData)
1028 { 1036 {
1029 CSSValueList* list = CSSValueList::createCommaSeparated(); 1037 CSSValueList* list = CSSValueList::createCommaSeparated();
1030 if (timingData) { 1038 if (timingData) {
1031 for (size_t i = 0; i < timingData->durationList().size(); ++i) 1039 for (size_t i = 0; i < timingData->durationList().size(); ++i)
1032 list->append(*CSSPrimitiveValue::create(timingData->durationList()[i ], CSSPrimitiveValue::UnitType::Seconds)); 1040 list->append(*CSSPrimitiveValue::create(timingData->durationList()[i ], CSSPrimitiveValue::UnitType::Seconds));
1033 } else { 1041 } else {
1034 list->append(*CSSPrimitiveValue::create(CSSTimingData::initialDuration() , CSSPrimitiveValue::UnitType::Seconds)); 1042 list->append(*CSSPrimitiveValue::create(CSSTimingData::initialDuration() , CSSPrimitiveValue::UnitType::Seconds));
1035 } 1043 }
1036 return list; 1044 return list;
1037 } 1045 }
1038 1046
1039 static CSSValue* valueForAnimationFillMode(Timing::FillMode fillMode) 1047 static CSSValue* valueForAnimationFillMode(Timing::FillMode fillMode)
1040 { 1048 {
1041 switch (fillMode) { 1049 switch (fillMode) {
1042 case Timing::FillMode::NONE: 1050 case Timing::FillMode::NONE:
1043 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 1051 return CSSIdentifierValue::create(CSSValueNone);
1044 case Timing::FillMode::FORWARDS: 1052 case Timing::FillMode::FORWARDS:
1045 return CSSPrimitiveValue::createIdentifier(CSSValueForwards); 1053 return CSSIdentifierValue::create(CSSValueForwards);
1046 case Timing::FillMode::BACKWARDS: 1054 case Timing::FillMode::BACKWARDS:
1047 return CSSPrimitiveValue::createIdentifier(CSSValueBackwards); 1055 return CSSIdentifierValue::create(CSSValueBackwards);
1048 case Timing::FillMode::BOTH: 1056 case Timing::FillMode::BOTH:
1049 return CSSPrimitiveValue::createIdentifier(CSSValueBoth); 1057 return CSSIdentifierValue::create(CSSValueBoth);
1050 default: 1058 default:
1051 ASSERT_NOT_REACHED(); 1059 ASSERT_NOT_REACHED();
1052 return nullptr; 1060 return nullptr;
1053 } 1061 }
1054 } 1062 }
1055 1063
1056 static CSSValue* valueForAnimationIterationCount(double iterationCount) 1064 static CSSValue* valueForAnimationIterationCount(double iterationCount)
1057 { 1065 {
1058 if (iterationCount == std::numeric_limits<double>::infinity()) 1066 if (iterationCount == std::numeric_limits<double>::infinity())
1059 return CSSPrimitiveValue::createIdentifier(CSSValueInfinite); 1067 return CSSIdentifierValue::create(CSSValueInfinite);
1060 return CSSPrimitiveValue::create(iterationCount, CSSPrimitiveValue::UnitType ::Number); 1068 return CSSPrimitiveValue::create(iterationCount, CSSPrimitiveValue::UnitType ::Number);
1061 } 1069 }
1062 1070
1063 static CSSValue* valueForAnimationPlayState(EAnimPlayState playState) 1071 static CSSValue* valueForAnimationPlayState(EAnimPlayState playState)
1064 { 1072 {
1065 if (playState == AnimPlayStatePlaying) 1073 if (playState == AnimPlayStatePlaying)
1066 return CSSPrimitiveValue::createIdentifier(CSSValueRunning); 1074 return CSSIdentifierValue::create(CSSValueRunning);
1067 ASSERT(playState == AnimPlayStatePaused); 1075 ASSERT(playState == AnimPlayStatePaused);
1068 return CSSPrimitiveValue::createIdentifier(CSSValuePaused); 1076 return CSSIdentifierValue::create(CSSValuePaused);
1069 } 1077 }
1070 1078
1071 static CSSValue* createTimingFunctionValue(const TimingFunction* timingFunction) 1079 static CSSValue* createTimingFunctionValue(const TimingFunction* timingFunction)
1072 { 1080 {
1073 switch (timingFunction->getType()) { 1081 switch (timingFunction->getType()) {
1074 case TimingFunction::Type::CUBIC_BEZIER: 1082 case TimingFunction::Type::CUBIC_BEZIER:
1075 { 1083 {
1076 const CubicBezierTimingFunction* bezierTimingFunction = toCubicBezie rTimingFunction(timingFunction); 1084 const CubicBezierTimingFunction* bezierTimingFunction = toCubicBezie rTimingFunction(timingFunction);
1077 if (bezierTimingFunction->getEaseType() != CubicBezierTimingFunction ::EaseType::CUSTOM) { 1085 if (bezierTimingFunction->getEaseType() != CubicBezierTimingFunction ::EaseType::CUSTOM) {
1078 CSSValueID valueId = CSSValueInvalid; 1086 CSSValueID valueId = CSSValueInvalid;
1079 switch (bezierTimingFunction->getEaseType()) { 1087 switch (bezierTimingFunction->getEaseType()) {
1080 case CubicBezierTimingFunction::EaseType::EASE: 1088 case CubicBezierTimingFunction::EaseType::EASE:
1081 valueId = CSSValueEase; 1089 valueId = CSSValueEase;
1082 break; 1090 break;
1083 case CubicBezierTimingFunction::EaseType::EASE_IN: 1091 case CubicBezierTimingFunction::EaseType::EASE_IN:
1084 valueId = CSSValueEaseIn; 1092 valueId = CSSValueEaseIn;
1085 break; 1093 break;
1086 case CubicBezierTimingFunction::EaseType::EASE_OUT: 1094 case CubicBezierTimingFunction::EaseType::EASE_OUT:
1087 valueId = CSSValueEaseOut; 1095 valueId = CSSValueEaseOut;
1088 break; 1096 break;
1089 case CubicBezierTimingFunction::EaseType::EASE_IN_OUT: 1097 case CubicBezierTimingFunction::EaseType::EASE_IN_OUT:
1090 valueId = CSSValueEaseInOut; 1098 valueId = CSSValueEaseInOut;
1091 break; 1099 break;
1092 default: 1100 default:
1093 ASSERT_NOT_REACHED(); 1101 ASSERT_NOT_REACHED();
1094 return nullptr; 1102 return nullptr;
1095 } 1103 }
1096 return CSSPrimitiveValue::createIdentifier(valueId); 1104 return CSSIdentifierValue::create(valueId);
1097 } 1105 }
1098 return CSSCubicBezierTimingFunctionValue::create(bezierTimingFunctio n->x1(), bezierTimingFunction->y1(), bezierTimingFunction->x2(), bezierTimingFun ction->y2()); 1106 return CSSCubicBezierTimingFunctionValue::create(bezierTimingFunctio n->x1(), bezierTimingFunction->y1(), bezierTimingFunction->x2(), bezierTimingFun ction->y2());
1099 } 1107 }
1100 1108
1101 case TimingFunction::Type::STEPS: 1109 case TimingFunction::Type::STEPS:
1102 { 1110 {
1103 const StepsTimingFunction* stepsTimingFunction = toStepsTimingFuncti on(timingFunction); 1111 const StepsTimingFunction* stepsTimingFunction = toStepsTimingFuncti on(timingFunction);
1104 StepsTimingFunction::StepPosition position = stepsTimingFunction->ge tStepPosition(); 1112 StepsTimingFunction::StepPosition position = stepsTimingFunction->ge tStepPosition();
1105 int steps = stepsTimingFunction->numberOfSteps(); 1113 int steps = stepsTimingFunction->numberOfSteps();
1106 DCHECK(position == StepsTimingFunction::StepPosition::START || posit ion == StepsTimingFunction::StepPosition::END); 1114 DCHECK(position == StepsTimingFunction::StepPosition::START || posit ion == StepsTimingFunction::StepPosition::END);
1107 1115
1108 if (steps > 1) 1116 if (steps > 1)
1109 return CSSStepsTimingFunctionValue::create(steps, position); 1117 return CSSStepsTimingFunctionValue::create(steps, position);
1110 CSSValueID valueId = position == StepsTimingFunction::StepPosition:: START ? CSSValueStepStart : CSSValueStepEnd; 1118 CSSValueID valueId = position == StepsTimingFunction::StepPosition:: START ? CSSValueStepStart : CSSValueStepEnd;
1111 return CSSPrimitiveValue::createIdentifier(valueId); 1119 return CSSIdentifierValue::create(valueId);
1112 } 1120 }
1113 1121
1114 default: 1122 default:
1115 return CSSPrimitiveValue::createIdentifier(CSSValueLinear); 1123 return CSSIdentifierValue::create(CSSValueLinear);
1116 } 1124 }
1117 } 1125 }
1118 1126
1119 static CSSValue* valueForAnimationTimingFunction(const CSSTimingData* timingData ) 1127 static CSSValue* valueForAnimationTimingFunction(const CSSTimingData* timingData )
1120 { 1128 {
1121 CSSValueList* list = CSSValueList::createCommaSeparated(); 1129 CSSValueList* list = CSSValueList::createCommaSeparated();
1122 if (timingData) { 1130 if (timingData) {
1123 for (size_t i = 0; i < timingData->timingFunctionList().size(); ++i) 1131 for (size_t i = 0; i < timingData->timingFunctionList().size(); ++i)
1124 list->append(*createTimingFunctionValue(timingData->timingFunctionLi st()[i].get())); 1132 list->append(*createTimingFunctionValue(timingData->timingFunctionLi st()[i].get()));
1125 } else { 1133 } else {
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
1185 transformValue->append(*zoomAdjustedNumberValue(transform.m43(), style)) ; 1193 transformValue->append(*zoomAdjustedNumberValue(transform.m43(), style)) ;
1186 transformValue->append(*CSSPrimitiveValue::create(transform.m44(), CSSPr imitiveValue::UnitType::Number)); 1194 transformValue->append(*CSSPrimitiveValue::create(transform.m44(), CSSPr imitiveValue::UnitType::Number));
1187 } 1195 }
1188 1196
1189 return transformValue; 1197 return transformValue;
1190 } 1198 }
1191 1199
1192 static CSSValue* computedTransform(const LayoutObject* layoutObject, const Compu tedStyle& style) 1200 static CSSValue* computedTransform(const LayoutObject* layoutObject, const Compu tedStyle& style)
1193 { 1201 {
1194 if (!layoutObject || !style.hasTransform()) 1202 if (!layoutObject || !style.hasTransform())
1195 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 1203 return CSSIdentifierValue::create(CSSValueNone);
1196 1204
1197 IntRect box; 1205 IntRect box;
1198 if (layoutObject->isBox()) 1206 if (layoutObject->isBox())
1199 box = pixelSnappedIntRect(toLayoutBox(layoutObject)->borderBoxRect()); 1207 box = pixelSnappedIntRect(toLayoutBox(layoutObject)->borderBoxRect());
1200 1208
1201 TransformationMatrix transform; 1209 TransformationMatrix transform;
1202 style.applyTransform(transform, LayoutSize(box.size()), ComputedStyle::Exclu deTransformOrigin, ComputedStyle::ExcludeMotionPath, ComputedStyle::ExcludeIndep endentTransformProperties); 1210 style.applyTransform(transform, LayoutSize(box.size()), ComputedStyle::Exclu deTransformOrigin, ComputedStyle::ExcludeMotionPath, ComputedStyle::ExcludeIndep endentTransformProperties);
1203 1211
1204 // FIXME: Need to print out individual functions (https://bugs.webkit.org/sh ow_bug.cgi?id=23924) 1212 // FIXME: Need to print out individual functions (https://bugs.webkit.org/sh ow_bug.cgi?id=23924)
1205 CSSValueList* list = CSSValueList::createSpaceSeparated(); 1213 CSSValueList* list = CSSValueList::createSpaceSeparated();
1206 list->append(*valueForMatrixTransform(transform, style)); 1214 list->append(*valueForMatrixTransform(transform, style));
1207 1215
1208 return list; 1216 return list;
1209 } 1217 }
1210 1218
1211 static CSSValue* createTransitionPropertyValue(const CSSTransitionData::Transiti onProperty& property) 1219 static CSSValue* createTransitionPropertyValue(const CSSTransitionData::Transiti onProperty& property)
1212 { 1220 {
1213 if (property.propertyType == CSSTransitionData::TransitionNone) 1221 if (property.propertyType == CSSTransitionData::TransitionNone)
1214 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 1222 return CSSIdentifierValue::create(CSSValueNone);
1215 if (property.propertyType == CSSTransitionData::TransitionUnknownProperty) 1223 if (property.propertyType == CSSTransitionData::TransitionUnknownProperty)
1216 return CSSCustomIdentValue::create(property.propertyString); 1224 return CSSCustomIdentValue::create(property.propertyString);
1217 ASSERT(property.propertyType == CSSTransitionData::TransitionKnownProperty); 1225 ASSERT(property.propertyType == CSSTransitionData::TransitionKnownProperty);
1218 return CSSCustomIdentValue::create(getPropertyNameAtomicString(property.unre solvedProperty)); 1226 return CSSCustomIdentValue::create(getPropertyNameAtomicString(property.unre solvedProperty));
1219 } 1227 }
1220 1228
1221 static CSSValue* valueForTransitionProperty(const CSSTransitionData* transitionD ata) 1229 static CSSValue* valueForTransitionProperty(const CSSTransitionData* transitionD ata)
1222 { 1230 {
1223 CSSValueList* list = CSSValueList::createCommaSeparated(); 1231 CSSValueList* list = CSSValueList::createCommaSeparated();
1224 if (transitionData) { 1232 if (transitionData) {
1225 for (size_t i = 0; i < transitionData->propertyList().size(); ++i) 1233 for (size_t i = 0; i < transitionData->propertyList().size(); ++i)
1226 list->append(*createTransitionPropertyValue(transitionData->property List()[i])); 1234 list->append(*createTransitionPropertyValue(transitionData->property List()[i]));
1227 } else { 1235 } else {
1228 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueAll)); 1236 list->append(*CSSIdentifierValue::create(CSSValueAll));
1229 } 1237 }
1230 return list; 1238 return list;
1231 } 1239 }
1232 1240
1233 CSSValueID valueForQuoteType(const QuoteType quoteType) 1241 CSSValueID valueForQuoteType(const QuoteType quoteType)
1234 { 1242 {
1235 switch (quoteType) { 1243 switch (quoteType) {
1236 case NO_OPEN_QUOTE: 1244 case NO_OPEN_QUOTE:
1237 return CSSValueNoOpenQuote; 1245 return CSSValueNoOpenQuote;
1238 case NO_CLOSE_QUOTE: 1246 case NO_CLOSE_QUOTE:
(...skipping 12 matching lines...) Expand all
1251 CSSValueList* list = CSSValueList::createSpaceSeparated(); 1259 CSSValueList* list = CSSValueList::createSpaceSeparated();
1252 for (const ContentData* contentData = style.contentData(); contentData; cont entData = contentData->next()) { 1260 for (const ContentData* contentData = style.contentData(); contentData; cont entData = contentData->next()) {
1253 if (contentData->isCounter()) { 1261 if (contentData->isCounter()) {
1254 const CounterContent* counter = toCounterContentData(contentData)->c ounter(); 1262 const CounterContent* counter = toCounterContentData(contentData)->c ounter();
1255 ASSERT(counter); 1263 ASSERT(counter);
1256 CSSCustomIdentValue* identifier = CSSCustomIdentValue::create(counte r->identifier()); 1264 CSSCustomIdentValue* identifier = CSSCustomIdentValue::create(counte r->identifier());
1257 CSSStringValue* separator = CSSStringValue::create(counter->separato r()); 1265 CSSStringValue* separator = CSSStringValue::create(counter->separato r());
1258 CSSValueID listStyleIdent = CSSValueNone; 1266 CSSValueID listStyleIdent = CSSValueNone;
1259 if (counter->listStyle() != NoneListStyle) 1267 if (counter->listStyle() != NoneListStyle)
1260 listStyleIdent = static_cast<CSSValueID>(CSSValueDisc + counter- >listStyle()); 1268 listStyleIdent = static_cast<CSSValueID>(CSSValueDisc + counter- >listStyle());
1261 CSSPrimitiveValue* listStyle = CSSPrimitiveValue::createIdentifier(l istStyleIdent); 1269 CSSIdentifierValue* listStyle = CSSIdentifierValue::create(listStyle Ident);
1262 list->append(*CSSCounterValue::create(identifier, listStyle, separat or)); 1270 list->append(*CSSCounterValue::create(identifier, listStyle, separat or));
1263 } else if (contentData->isImage()) { 1271 } else if (contentData->isImage()) {
1264 const StyleImage* image = toImageContentData(contentData)->image(); 1272 const StyleImage* image = toImageContentData(contentData)->image();
1265 ASSERT(image); 1273 ASSERT(image);
1266 list->append(*image->computedCSSValue()); 1274 list->append(*image->computedCSSValue());
1267 } else if (contentData->isText()) { 1275 } else if (contentData->isText()) {
1268 list->append(*CSSStringValue::create(toTextContentData(contentData)- >text())); 1276 list->append(*CSSStringValue::create(toTextContentData(contentData)- >text()));
1269 } else if (contentData->isQuote()) { 1277 } else if (contentData->isQuote()) {
1270 const QuoteType quoteType = toQuoteContentData(contentData)->quote() ; 1278 const QuoteType quoteType = toQuoteContentData(contentData)->quote() ;
1271 list->append(*CSSPrimitiveValue::createIdentifier(valueForQuoteType( quoteType))); 1279 list->append(*CSSIdentifierValue::create(valueForQuoteType(quoteType )));
1272 } else { 1280 } else {
1273 ASSERT_NOT_REACHED(); 1281 ASSERT_NOT_REACHED();
1274 } 1282 }
1275 } 1283 }
1276 return list; 1284 return list;
1277 } 1285 }
1278 1286
1279 static CSSValue* valueForCounterDirectives(const ComputedStyle& style, CSSProper tyID propertyID) 1287 static CSSValue* valueForCounterDirectives(const ComputedStyle& style, CSSProper tyID propertyID)
1280 { 1288 {
1281 const CounterDirectiveMap* map = style.counterDirectives(); 1289 const CounterDirectiveMap* map = style.counterDirectives();
1282 if (!map) 1290 if (!map)
1283 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 1291 return CSSIdentifierValue::create(CSSValueNone);
1284 1292
1285 CSSValueList* list = CSSValueList::createSpaceSeparated(); 1293 CSSValueList* list = CSSValueList::createSpaceSeparated();
1286 for (const auto& item : *map) { 1294 for (const auto& item : *map) {
1287 bool isValidCounterValue = propertyID == CSSPropertyCounterIncrement ? i tem.value.isIncrement() : item.value.isReset(); 1295 bool isValidCounterValue = propertyID == CSSPropertyCounterIncrement ? i tem.value.isIncrement() : item.value.isReset();
1288 if (!isValidCounterValue) 1296 if (!isValidCounterValue)
1289 continue; 1297 continue;
1290 1298
1291 list->append(*CSSCustomIdentValue::create(item.key)); 1299 list->append(*CSSCustomIdentValue::create(item.key));
1292 short number = propertyID == CSSPropertyCounterIncrement ? item.value.in crementValue() : item.value.resetValue(); 1300 short number = propertyID == CSSPropertyCounterIncrement ? item.value.in crementValue() : item.value.resetValue();
1293 list->append(*CSSPrimitiveValue::create((double)number, CSSPrimitiveValu e::UnitType::Integer)); 1301 list->append(*CSSPrimitiveValue::create((double)number, CSSPrimitiveValu e::UnitType::Integer));
1294 } 1302 }
1295 1303
1296 if (!list->length()) 1304 if (!list->length())
1297 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 1305 return CSSIdentifierValue::create(CSSValueNone);
1298 1306
1299 return list; 1307 return list;
1300 } 1308 }
1301 1309
1302 static CSSValue* valueForShape(const ComputedStyle& style, ShapeValue* shapeValu e) 1310 static CSSValue* valueForShape(const ComputedStyle& style, ShapeValue* shapeValu e)
1303 { 1311 {
1304 if (!shapeValue) 1312 if (!shapeValue)
1305 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 1313 return CSSIdentifierValue::create(CSSValueNone);
1306 if (shapeValue->type() == ShapeValue::Box) 1314 if (shapeValue->type() == ShapeValue::Box)
1307 return CSSPrimitiveValue::create(shapeValue->cssBox()); 1315 return CSSIdentifierValue::create(shapeValue->cssBox());
1308 if (shapeValue->type() == ShapeValue::Image) { 1316 if (shapeValue->type() == ShapeValue::Image) {
1309 if (shapeValue->image()) 1317 if (shapeValue->image())
1310 return shapeValue->image()->computedCSSValue(); 1318 return shapeValue->image()->computedCSSValue();
1311 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 1319 return CSSIdentifierValue::create(CSSValueNone);
1312 } 1320 }
1313 1321
1314 ASSERT(shapeValue->type() == ShapeValue::Shape); 1322 ASSERT(shapeValue->type() == ShapeValue::Shape);
1315 1323
1316 CSSValueList* list = CSSValueList::createSpaceSeparated(); 1324 CSSValueList* list = CSSValueList::createSpaceSeparated();
1317 list->append(*valueForBasicShape(style, shapeValue->shape())); 1325 list->append(*valueForBasicShape(style, shapeValue->shape()));
1318 if (shapeValue->cssBox() != BoxMissing) 1326 if (shapeValue->cssBox() != BoxMissing)
1319 list->append(*CSSPrimitiveValue::create(shapeValue->cssBox())); 1327 list->append(*CSSIdentifierValue::create(shapeValue->cssBox()));
1320 return list; 1328 return list;
1321 } 1329 }
1322 1330
1323 static CSSValueList* valuesForSidesShorthand(const StylePropertyShorthand& short hand, const ComputedStyle& style, const LayoutObject* layoutObject, Node* styled Node, bool allowVisitedStyle) 1331 static CSSValueList* valuesForSidesShorthand(const StylePropertyShorthand& short hand, const ComputedStyle& style, const LayoutObject* layoutObject, Node* styled Node, bool allowVisitedStyle)
1324 { 1332 {
1325 CSSValueList* list = CSSValueList::createSpaceSeparated(); 1333 CSSValueList* list = CSSValueList::createSpaceSeparated();
1326 // Assume the properties are in the usual order top, right, bottom, left. 1334 // Assume the properties are in the usual order top, right, bottom, left.
1327 const CSSValue* topValue = ComputedStyleCSSValueMapping::get(shorthand.prope rties()[0], style, layoutObject, styledNode, allowVisitedStyle); 1335 const CSSValue* topValue = ComputedStyleCSSValueMapping::get(shorthand.prope rties()[0], style, layoutObject, styledNode, allowVisitedStyle);
1328 const CSSValue* rightValue = ComputedStyleCSSValueMapping::get(shorthand.pro perties()[1], style, layoutObject, styledNode, allowVisitedStyle); 1336 const CSSValue* rightValue = ComputedStyleCSSValueMapping::get(shorthand.pro perties()[1], style, layoutObject, styledNode, allowVisitedStyle);
1329 const CSSValue* bottomValue = ComputedStyleCSSValueMapping::get(shorthand.pr operties()[2], style, layoutObject, styledNode, allowVisitedStyle); 1337 const CSSValue* bottomValue = ComputedStyleCSSValueMapping::get(shorthand.pr operties()[2], style, layoutObject, styledNode, allowVisitedStyle);
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
1387 1395
1388 if (!verticalRadii->equals(toCSSValueList(list->item(0)))) 1396 if (!verticalRadii->equals(toCSSValueList(list->item(0))))
1389 list->append(*verticalRadii); 1397 list->append(*verticalRadii);
1390 1398
1391 return list; 1399 return list;
1392 } 1400 }
1393 1401
1394 static CSSValue* strokeDashArrayToCSSValueList(const SVGDashArray& dashes, const ComputedStyle& style) 1402 static CSSValue* strokeDashArrayToCSSValueList(const SVGDashArray& dashes, const ComputedStyle& style)
1395 { 1403 {
1396 if (dashes.isEmpty()) 1404 if (dashes.isEmpty())
1397 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 1405 return CSSIdentifierValue::create(CSSValueNone);
1398 1406
1399 CSSValueList* list = CSSValueList::createCommaSeparated(); 1407 CSSValueList* list = CSSValueList::createCommaSeparated();
1400 for (const Length& dashLength : dashes.vector()) 1408 for (const Length& dashLength : dashes.vector())
1401 list->append(*zoomAdjustedPixelValueForLength(dashLength, style)); 1409 list->append(*zoomAdjustedPixelValueForLength(dashLength, style));
1402 1410
1403 return list; 1411 return list;
1404 } 1412 }
1405 1413
1406 static CSSValue* paintOrderToCSSValueList(const SVGComputedStyle& svgStyle) 1414 static CSSValue* paintOrderToCSSValueList(const SVGComputedStyle& svgStyle)
1407 { 1415 {
1408 CSSValueList* list = CSSValueList::createSpaceSeparated(); 1416 CSSValueList* list = CSSValueList::createSpaceSeparated();
1409 for (int i = 0; i < 3; i++) { 1417 for (int i = 0; i < 3; i++) {
1410 EPaintOrderType paintOrderType = svgStyle.paintOrderType(i); 1418 EPaintOrderType paintOrderType = svgStyle.paintOrderType(i);
1411 switch (paintOrderType) { 1419 switch (paintOrderType) {
1412 case PT_FILL: 1420 case PT_FILL:
1413 case PT_STROKE: 1421 case PT_STROKE:
1414 case PT_MARKERS: 1422 case PT_MARKERS:
1415 list->append(*CSSPrimitiveValue::create(paintOrderType)); 1423 list->append(*CSSIdentifierValue::create(paintOrderType));
1416 break; 1424 break;
1417 case PT_NONE: 1425 case PT_NONE:
1418 default: 1426 default:
1419 ASSERT_NOT_REACHED(); 1427 ASSERT_NOT_REACHED();
1420 break; 1428 break;
1421 } 1429 }
1422 } 1430 }
1423 1431
1424 return list; 1432 return list;
1425 } 1433 }
1426 1434
1427 static CSSValue* adjustSVGPaintForCurrentColor(SVGPaintType paintType, const Str ing& url, const Color& color, const Color& currentColor) 1435 static CSSValue* adjustSVGPaintForCurrentColor(SVGPaintType paintType, const Str ing& url, const Color& color, const Color& currentColor)
1428 { 1436 {
1429 if (paintType >= SVG_PAINTTYPE_URI_NONE) { 1437 if (paintType >= SVG_PAINTTYPE_URI_NONE) {
1430 CSSValueList* values = CSSValueList::createSpaceSeparated(); 1438 CSSValueList* values = CSSValueList::createSpaceSeparated();
1431 values->append(*CSSURIValue::create(url)); 1439 values->append(*CSSURIValue::create(url));
1432 if (paintType == SVG_PAINTTYPE_URI_NONE) 1440 if (paintType == SVG_PAINTTYPE_URI_NONE)
1433 values->append(*CSSPrimitiveValue::createIdentifier(CSSValueNone)); 1441 values->append(*CSSIdentifierValue::create(CSSValueNone));
1434 else if (paintType == SVG_PAINTTYPE_URI_CURRENTCOLOR) 1442 else if (paintType == SVG_PAINTTYPE_URI_CURRENTCOLOR)
1435 values->append(*CSSColorValue::create(currentColor.rgb())); 1443 values->append(*CSSColorValue::create(currentColor.rgb()));
1436 else if (paintType == SVG_PAINTTYPE_URI_RGBCOLOR) 1444 else if (paintType == SVG_PAINTTYPE_URI_RGBCOLOR)
1437 values->append(*CSSColorValue::create(color.rgb())); 1445 values->append(*CSSColorValue::create(color.rgb()));
1438 return values; 1446 return values;
1439 } 1447 }
1440 if (paintType == SVG_PAINTTYPE_NONE) 1448 if (paintType == SVG_PAINTTYPE_NONE)
1441 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 1449 return CSSIdentifierValue::create(CSSValueNone);
1442 if (paintType == SVG_PAINTTYPE_CURRENTCOLOR) 1450 if (paintType == SVG_PAINTTYPE_CURRENTCOLOR)
1443 return CSSColorValue::create(currentColor.rgb()); 1451 return CSSColorValue::create(currentColor.rgb());
1444 1452
1445 return CSSColorValue::create(color.rgb()); 1453 return CSSColorValue::create(color.rgb());
1446 } 1454 }
1447 1455
1448 static inline String serializeAsFragmentIdentifier(const AtomicString& resource) 1456 static inline String serializeAsFragmentIdentifier(const AtomicString& resource)
1449 { 1457 {
1450 return "#" + resource; 1458 return "#" + resource;
1451 } 1459 }
1452 1460
1453 CSSValue* ComputedStyleCSSValueMapping::valueForShadowData(const ShadowData& sha dow, const ComputedStyle& style, bool useSpread) 1461 CSSValue* ComputedStyleCSSValueMapping::valueForShadowData(const ShadowData& sha dow, const ComputedStyle& style, bool useSpread)
1454 { 1462 {
1455 CSSPrimitiveValue* x = zoomAdjustedPixelValue(shadow.x(), style); 1463 CSSPrimitiveValue* x = zoomAdjustedPixelValue(shadow.x(), style);
1456 CSSPrimitiveValue* y = zoomAdjustedPixelValue(shadow.y(), style); 1464 CSSPrimitiveValue* y = zoomAdjustedPixelValue(shadow.y(), style);
1457 CSSPrimitiveValue* blur = zoomAdjustedPixelValue(shadow.blur(), style); 1465 CSSPrimitiveValue* blur = zoomAdjustedPixelValue(shadow.blur(), style);
1458 CSSPrimitiveValue* spread = useSpread ? zoomAdjustedPixelValue(shadow.spread (), style) : nullptr; 1466 CSSPrimitiveValue* spread = useSpread ? zoomAdjustedPixelValue(shadow.spread (), style) : nullptr;
1459 CSSPrimitiveValue* shadowStyle = shadow.style() == Normal ? nullptr : CSSPri mitiveValue::createIdentifier(CSSValueInset); 1467 CSSIdentifierValue* shadowStyle = shadow.style() == Normal ? nullptr : CSSId entifierValue::create(CSSValueInset);
1460 CSSValue* color = currentColorOrValidColor(style, shadow.color()); 1468 CSSValue* color = currentColorOrValidColor(style, shadow.color());
1461 return CSSShadowValue::create(x, y, blur, spread, shadowStyle, color); 1469 return CSSShadowValue::create(x, y, blur, spread, shadowStyle, color);
1462 } 1470 }
1463 1471
1464 CSSValue* ComputedStyleCSSValueMapping::valueForShadowList(const ShadowList* sha dowList, const ComputedStyle& style, bool useSpread) 1472 CSSValue* ComputedStyleCSSValueMapping::valueForShadowList(const ShadowList* sha dowList, const ComputedStyle& style, bool useSpread)
1465 { 1473 {
1466 if (!shadowList) 1474 if (!shadowList)
1467 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 1475 return CSSIdentifierValue::create(CSSValueNone);
1468 1476
1469 CSSValueList* list = CSSValueList::createCommaSeparated(); 1477 CSSValueList* list = CSSValueList::createCommaSeparated();
1470 size_t shadowCount = shadowList->shadows().size(); 1478 size_t shadowCount = shadowList->shadows().size();
1471 for (size_t i = 0; i < shadowCount; ++i) 1479 for (size_t i = 0; i < shadowCount; ++i)
1472 list->append(*valueForShadowData(shadowList->shadows()[i], style, useSpr ead)); 1480 list->append(*valueForShadowData(shadowList->shadows()[i], style, useSpr ead));
1473 return list; 1481 return list;
1474 } 1482 }
1475 1483
1476 CSSValue* ComputedStyleCSSValueMapping::valueForFilter(const ComputedStyle& styl e, const FilterOperations& filterOperations) 1484 CSSValue* ComputedStyleCSSValueMapping::valueForFilter(const ComputedStyle& styl e, const FilterOperations& filterOperations)
1477 { 1485 {
1478 if (filterOperations.operations().isEmpty()) 1486 if (filterOperations.operations().isEmpty())
1479 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 1487 return CSSIdentifierValue::create(CSSValueNone);
1480 1488
1481 CSSValueList* list = CSSValueList::createSpaceSeparated(); 1489 CSSValueList* list = CSSValueList::createSpaceSeparated();
1482 1490
1483 CSSFunctionValue* filterValue = nullptr; 1491 CSSFunctionValue* filterValue = nullptr;
1484 1492
1485 for (const auto& operation : filterOperations.operations()) { 1493 for (const auto& operation : filterOperations.operations()) {
1486 FilterOperation* filterOperation = operation.get(); 1494 FilterOperation* filterOperation = operation.get();
1487 switch (filterOperation->type()) { 1495 switch (filterOperation->type()) {
1488 case FilterOperation::REFERENCE: 1496 case FilterOperation::REFERENCE:
1489 filterValue = CSSFunctionValue::create(CSSValueUrl); 1497 filterValue = CSSFunctionValue::create(CSSValueUrl);
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
1549 CSSValueList* sizeAndLineHeight = CSSValueList::createSlashSeparated(); 1557 CSSValueList* sizeAndLineHeight = CSSValueList::createSlashSeparated();
1550 sizeAndLineHeight->append(*valueForFontSize(style)); 1558 sizeAndLineHeight->append(*valueForFontSize(style));
1551 sizeAndLineHeight->append(*valueForLineHeight(style)); 1559 sizeAndLineHeight->append(*valueForLineHeight(style));
1552 1560
1553 CSSValueList* list = CSSValueList::createSpaceSeparated(); 1561 CSSValueList* list = CSSValueList::createSpaceSeparated();
1554 list->append(*valueForFontStyle(style)); 1562 list->append(*valueForFontStyle(style));
1555 1563
1556 // Check that non-initial font-variant subproperties are not conflicting wit h this serialization. 1564 // Check that non-initial font-variant subproperties are not conflicting wit h this serialization.
1557 CSSValue* ligaturesValue = valueForFontVariantLigatures(style); 1565 CSSValue* ligaturesValue = valueForFontVariantLigatures(style);
1558 CSSValue* numericValue = valueForFontVariantNumeric(style); 1566 CSSValue* numericValue = valueForFontVariantNumeric(style);
1559 if (!ligaturesValue->equals(*CSSPrimitiveValue::createIdentifier(CSSValueNor mal)) 1567 if (!ligaturesValue->equals(*CSSIdentifierValue::create(CSSValueNormal))
1560 || !numericValue->equals(*CSSPrimitiveValue::createIdentifier(CSSValueNo rmal))) 1568 || !numericValue->equals(*CSSIdentifierValue::create(CSSValueNormal)))
1561 return nullptr; 1569 return nullptr;
1562 1570
1563 CSSPrimitiveValue* capsValue = valueForFontVariantCaps(style); 1571 CSSIdentifierValue* capsValue = valueForFontVariantCaps(style);
1564 if (!capsValue->equals(*CSSPrimitiveValue::createIdentifier(CSSValueNormal)) 1572 if (capsValue->getValueID() != CSSValueNormal
1565 && !capsValue->equals(*CSSPrimitiveValue::createIdentifier(CSSValueSmall Caps))) 1573 && capsValue->getValueID() != CSSValueSmallCaps)
1566 return nullptr; 1574 return nullptr;
1567 list->append(*capsValue); 1575 list->append(*capsValue);
1568 1576
1569 list->append(*valueForFontWeight(style)); 1577 list->append(*valueForFontWeight(style));
1570 list->append(*valueForFontStretch(style)); 1578 list->append(*valueForFontStretch(style));
1571 list->append(*sizeAndLineHeight); 1579 list->append(*sizeAndLineHeight);
1572 list->append(*valueForFontFamily(style)); 1580 list->append(*valueForFontFamily(style));
1573 1581
1574 return list; 1582 return list;
1575 } 1583 }
1576 1584
1577 static CSSValue* valueForScrollSnapDestination(const LengthPoint& destination, c onst ComputedStyle& style) 1585 static CSSValue* valueForScrollSnapDestination(const LengthPoint& destination, c onst ComputedStyle& style)
1578 { 1586 {
1579 CSSValueList* list = CSSValueList::createSpaceSeparated(); 1587 CSSValueList* list = CSSValueList::createSpaceSeparated();
1580 list->append(*zoomAdjustedPixelValueForLength(destination.x(), style)); 1588 list->append(*zoomAdjustedPixelValueForLength(destination.x(), style));
1581 list->append(*zoomAdjustedPixelValueForLength(destination.y(), style)); 1589 list->append(*zoomAdjustedPixelValueForLength(destination.y(), style));
1582 return list; 1590 return list;
1583 } 1591 }
1584 1592
1585 static CSSValue* valueForScrollSnapPoints(const ScrollSnapPoints& points, const ComputedStyle& style) 1593 static CSSValue* valueForScrollSnapPoints(const ScrollSnapPoints& points, const ComputedStyle& style)
1586 { 1594 {
1587 if (points.hasRepeat) { 1595 if (points.hasRepeat) {
1588 CSSFunctionValue* repeat = CSSFunctionValue::create(CSSValueRepeat); 1596 CSSFunctionValue* repeat = CSSFunctionValue::create(CSSValueRepeat);
1589 repeat->append(*zoomAdjustedPixelValueForLength(points.repeatOffset, sty le)); 1597 repeat->append(*zoomAdjustedPixelValueForLength(points.repeatOffset, sty le));
1590 return repeat; 1598 return repeat;
1591 } 1599 }
1592 1600
1593 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 1601 return CSSIdentifierValue::create(CSSValueNone);
1594 } 1602 }
1595 1603
1596 static CSSValue* valueForScrollSnapCoordinate(const Vector<LengthPoint>& coordin ates, const ComputedStyle& style) 1604 static CSSValue* valueForScrollSnapCoordinate(const Vector<LengthPoint>& coordin ates, const ComputedStyle& style)
1597 { 1605 {
1598 if (coordinates.isEmpty()) 1606 if (coordinates.isEmpty())
1599 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 1607 return CSSIdentifierValue::create(CSSValueNone);
1600 1608
1601 CSSValueList* list = CSSValueList::createCommaSeparated(); 1609 CSSValueList* list = CSSValueList::createCommaSeparated();
1602 1610
1603 for (auto& coordinate : coordinates) { 1611 for (auto& coordinate : coordinates) {
1604 auto pair = CSSValueList::createSpaceSeparated(); 1612 auto pair = CSSValueList::createSpaceSeparated();
1605 pair->append(*zoomAdjustedPixelValueForLength(coordinate.x(), style)); 1613 pair->append(*zoomAdjustedPixelValueForLength(coordinate.x(), style));
1606 pair->append(*zoomAdjustedPixelValueForLength(coordinate.y(), style)); 1614 pair->append(*zoomAdjustedPixelValueForLength(coordinate.y(), style));
1607 list->append(*pair); 1615 list->append(*pair);
1608 } 1616 }
1609 1617
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
1690 case CSSPropertyBackgroundColor: 1698 case CSSPropertyBackgroundColor:
1691 return allowVisitedStyle ? CSSColorValue::create(style.visitedDependentC olor(CSSPropertyBackgroundColor).rgb()) : currentColorOrValidColor(style, style. backgroundColor()); 1699 return allowVisitedStyle ? CSSColorValue::create(style.visitedDependentC olor(CSSPropertyBackgroundColor).rgb()) : currentColorOrValidColor(style, style. backgroundColor());
1692 case CSSPropertyBackgroundImage: 1700 case CSSPropertyBackgroundImage:
1693 case CSSPropertyWebkitMaskImage: { 1701 case CSSPropertyWebkitMaskImage: {
1694 CSSValueList* list = CSSValueList::createCommaSeparated(); 1702 CSSValueList* list = CSSValueList::createCommaSeparated();
1695 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskImage ? &style.maskLayers() : &style.backgroundLayers(); 1703 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskImage ? &style.maskLayers() : &style.backgroundLayers();
1696 for (; currLayer; currLayer = currLayer->next()) { 1704 for (; currLayer; currLayer = currLayer->next()) {
1697 if (currLayer->image()) 1705 if (currLayer->image())
1698 list->append(*currLayer->image()->computedCSSValue()); 1706 list->append(*currLayer->image()->computedCSSValue());
1699 else 1707 else
1700 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueNone)) ; 1708 list->append(*CSSIdentifierValue::create(CSSValueNone));
1701 } 1709 }
1702 return list; 1710 return list;
1703 } 1711 }
1704 case CSSPropertyBackgroundSize: 1712 case CSSPropertyBackgroundSize:
1705 case CSSPropertyWebkitMaskSize: { 1713 case CSSPropertyWebkitMaskSize: {
1706 CSSValueList* list = CSSValueList::createCommaSeparated(); 1714 CSSValueList* list = CSSValueList::createCommaSeparated();
1707 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskSize ? & style.maskLayers() : &style.backgroundLayers(); 1715 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskSize ? & style.maskLayers() : &style.backgroundLayers();
1708 for (; currLayer; currLayer = currLayer->next()) 1716 for (; currLayer; currLayer = currLayer->next())
1709 list->append(*valueForFillSize(currLayer->size(), style)); 1717 list->append(*valueForFillSize(currLayer->size(), style));
1710 return list; 1718 return list;
1711 } 1719 }
1712 case CSSPropertyBackgroundRepeat: 1720 case CSSPropertyBackgroundRepeat:
1713 case CSSPropertyWebkitMaskRepeat: { 1721 case CSSPropertyWebkitMaskRepeat: {
1714 CSSValueList* list = CSSValueList::createCommaSeparated(); 1722 CSSValueList* list = CSSValueList::createCommaSeparated();
1715 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskRepeat ? &style.maskLayers() : &style.backgroundLayers(); 1723 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskRepeat ? &style.maskLayers() : &style.backgroundLayers();
1716 for (; currLayer; currLayer = currLayer->next()) 1724 for (; currLayer; currLayer = currLayer->next())
1717 list->append(*valueForFillRepeat(currLayer->repeatX(), currLayer->re peatY())); 1725 list->append(*valueForFillRepeat(currLayer->repeatX(), currLayer->re peatY()));
1718 return list; 1726 return list;
1719 } 1727 }
1720 case CSSPropertyMaskSourceType: { 1728 case CSSPropertyMaskSourceType: {
1721 CSSValueList* list = CSSValueList::createCommaSeparated(); 1729 CSSValueList* list = CSSValueList::createCommaSeparated();
1722 for (const FillLayer* currLayer = &style.maskLayers(); currLayer; currLa yer = currLayer->next()) 1730 for (const FillLayer* currLayer = &style.maskLayers(); currLayer; currLa yer = currLayer->next())
1723 list->append(*valueForFillSourceType(currLayer->maskSourceType())); 1731 list->append(*valueForFillSourceType(currLayer->maskSourceType()));
1724 return list; 1732 return list;
1725 } 1733 }
1726 case CSSPropertyWebkitMaskComposite: { 1734 case CSSPropertyWebkitMaskComposite: {
1727 CSSValueList* list = CSSValueList::createCommaSeparated(); 1735 CSSValueList* list = CSSValueList::createCommaSeparated();
1728 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskComposit e ? &style.maskLayers() : &style.backgroundLayers(); 1736 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskComposit e ? &style.maskLayers() : &style.backgroundLayers();
1729 for (; currLayer; currLayer = currLayer->next()) 1737 for (; currLayer; currLayer = currLayer->next())
1730 list->append(*CSSPrimitiveValue::create(currLayer->composite())); 1738 list->append(*CSSIdentifierValue::create(currLayer->composite()));
1731 return list; 1739 return list;
1732 } 1740 }
1733 case CSSPropertyBackgroundAttachment: { 1741 case CSSPropertyBackgroundAttachment: {
1734 CSSValueList* list = CSSValueList::createCommaSeparated(); 1742 CSSValueList* list = CSSValueList::createCommaSeparated();
1735 for (const FillLayer* currLayer = &style.backgroundLayers(); currLayer; currLayer = currLayer->next()) 1743 for (const FillLayer* currLayer = &style.backgroundLayers(); currLayer; currLayer = currLayer->next())
1736 list->append(*CSSPrimitiveValue::create(currLayer->attachment())); 1744 list->append(*CSSIdentifierValue::create(currLayer->attachment()));
1737 return list; 1745 return list;
1738 } 1746 }
1739 case CSSPropertyBackgroundClip: 1747 case CSSPropertyBackgroundClip:
1740 case CSSPropertyBackgroundOrigin: 1748 case CSSPropertyBackgroundOrigin:
1741 case CSSPropertyWebkitBackgroundClip: 1749 case CSSPropertyWebkitBackgroundClip:
1742 case CSSPropertyWebkitBackgroundOrigin: 1750 case CSSPropertyWebkitBackgroundOrigin:
1743 case CSSPropertyWebkitMaskClip: 1751 case CSSPropertyWebkitMaskClip:
1744 case CSSPropertyWebkitMaskOrigin: { 1752 case CSSPropertyWebkitMaskOrigin: {
1745 bool isClip = propertyID == CSSPropertyBackgroundClip || propertyID == C SSPropertyWebkitBackgroundClip || propertyID == CSSPropertyWebkitMaskClip; 1753 bool isClip = propertyID == CSSPropertyBackgroundClip || propertyID == C SSPropertyWebkitBackgroundClip || propertyID == CSSPropertyWebkitMaskClip;
1746 CSSValueList* list = CSSValueList::createCommaSeparated(); 1754 CSSValueList* list = CSSValueList::createCommaSeparated();
1747 const FillLayer* currLayer = (propertyID == CSSPropertyWebkitMaskClip || propertyID == CSSPropertyWebkitMaskOrigin) ? &style.maskLayers() : &style.backg roundLayers(); 1755 const FillLayer* currLayer = (propertyID == CSSPropertyWebkitMaskClip || propertyID == CSSPropertyWebkitMaskOrigin) ? &style.maskLayers() : &style.backg roundLayers();
1748 for (; currLayer; currLayer = currLayer->next()) { 1756 for (; currLayer; currLayer = currLayer->next()) {
1749 EFillBox box = isClip ? currLayer->clip() : currLayer->origin(); 1757 EFillBox box = isClip ? currLayer->clip() : currLayer->origin();
1750 list->append(*CSSPrimitiveValue::create(box)); 1758 list->append(*CSSIdentifierValue::create(box));
1751 } 1759 }
1752 return list; 1760 return list;
1753 } 1761 }
1754 case CSSPropertyBackgroundPosition: 1762 case CSSPropertyBackgroundPosition:
1755 case CSSPropertyWebkitMaskPosition: { 1763 case CSSPropertyWebkitMaskPosition: {
1756 CSSValueList* list = CSSValueList::createCommaSeparated(); 1764 CSSValueList* list = CSSValueList::createCommaSeparated();
1757 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskPosition ? &style.maskLayers() : &style.backgroundLayers(); 1765 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskPosition ? &style.maskLayers() : &style.backgroundLayers();
1758 for (; currLayer; currLayer = currLayer->next()) 1766 for (; currLayer; currLayer = currLayer->next())
1759 list->append(*createPositionListForLayer(propertyID, *currLayer, sty le)); 1767 list->append(*createPositionListForLayer(propertyID, *currLayer, sty le));
1760 return list; 1768 return list;
1761 } 1769 }
1762 case CSSPropertyBackgroundPositionX: 1770 case CSSPropertyBackgroundPositionX:
1763 case CSSPropertyWebkitMaskPositionX: { 1771 case CSSPropertyWebkitMaskPositionX: {
1764 CSSValueList* list = CSSValueList::createCommaSeparated(); 1772 CSSValueList* list = CSSValueList::createCommaSeparated();
1765 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskPosition X ? &style.maskLayers() : &style.backgroundLayers(); 1773 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskPosition X ? &style.maskLayers() : &style.backgroundLayers();
1766 for (; currLayer; currLayer = currLayer->next()) 1774 for (; currLayer; currLayer = currLayer->next())
1767 list->append(*zoomAdjustedPixelValueForLength(currLayer->xPosition() , style)); 1775 list->append(*zoomAdjustedPixelValueForLength(currLayer->xPosition() , style));
1768 return list; 1776 return list;
1769 } 1777 }
1770 case CSSPropertyBackgroundPositionY: 1778 case CSSPropertyBackgroundPositionY:
1771 case CSSPropertyWebkitMaskPositionY: { 1779 case CSSPropertyWebkitMaskPositionY: {
1772 CSSValueList* list = CSSValueList::createCommaSeparated(); 1780 CSSValueList* list = CSSValueList::createCommaSeparated();
1773 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskPosition Y ? &style.maskLayers() : &style.backgroundLayers(); 1781 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskPosition Y ? &style.maskLayers() : &style.backgroundLayers();
1774 for (; currLayer; currLayer = currLayer->next()) 1782 for (; currLayer; currLayer = currLayer->next())
1775 list->append(*zoomAdjustedPixelValueForLength(currLayer->yPosition() , style)); 1783 list->append(*zoomAdjustedPixelValueForLength(currLayer->yPosition() , style));
1776 return list; 1784 return list;
1777 } 1785 }
1778 case CSSPropertyBorderCollapse: 1786 case CSSPropertyBorderCollapse:
1779 if (style.borderCollapse()) 1787 if (style.borderCollapse())
1780 return CSSPrimitiveValue::createIdentifier(CSSValueCollapse); 1788 return CSSIdentifierValue::create(CSSValueCollapse);
1781 return CSSPrimitiveValue::createIdentifier(CSSValueSeparate); 1789 return CSSIdentifierValue::create(CSSValueSeparate);
1782 case CSSPropertyBorderSpacing: { 1790 case CSSPropertyBorderSpacing: {
1783 CSSValueList* list = CSSValueList::createSpaceSeparated(); 1791 CSSValueList* list = CSSValueList::createSpaceSeparated();
1784 list->append(*zoomAdjustedPixelValue(style.horizontalBorderSpacing(), st yle)); 1792 list->append(*zoomAdjustedPixelValue(style.horizontalBorderSpacing(), st yle));
1785 list->append(*zoomAdjustedPixelValue(style.verticalBorderSpacing(), styl e)); 1793 list->append(*zoomAdjustedPixelValue(style.verticalBorderSpacing(), styl e));
1786 return list; 1794 return list;
1787 } 1795 }
1788 case CSSPropertyWebkitBorderHorizontalSpacing: 1796 case CSSPropertyWebkitBorderHorizontalSpacing:
1789 return zoomAdjustedPixelValue(style.horizontalBorderSpacing(), style); 1797 return zoomAdjustedPixelValue(style.horizontalBorderSpacing(), style);
1790 case CSSPropertyWebkitBorderVerticalSpacing: 1798 case CSSPropertyWebkitBorderVerticalSpacing:
1791 return zoomAdjustedPixelValue(style.verticalBorderSpacing(), style); 1799 return zoomAdjustedPixelValue(style.verticalBorderSpacing(), style);
1792 case CSSPropertyBorderImageSource: 1800 case CSSPropertyBorderImageSource:
1793 if (style.borderImageSource()) 1801 if (style.borderImageSource())
1794 return style.borderImageSource()->computedCSSValue(); 1802 return style.borderImageSource()->computedCSSValue();
1795 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 1803 return CSSIdentifierValue::create(CSSValueNone);
1796 case CSSPropertyBorderTopColor: 1804 case CSSPropertyBorderTopColor:
1797 return allowVisitedStyle ? CSSColorValue::create(style.visitedDependentC olor(CSSPropertyBorderTopColor).rgb()) : currentColorOrValidColor(style, style.b orderTopColor()); 1805 return allowVisitedStyle ? CSSColorValue::create(style.visitedDependentC olor(CSSPropertyBorderTopColor).rgb()) : currentColorOrValidColor(style, style.b orderTopColor());
1798 case CSSPropertyBorderRightColor: 1806 case CSSPropertyBorderRightColor:
1799 return allowVisitedStyle ? CSSColorValue::create(style.visitedDependentC olor(CSSPropertyBorderRightColor).rgb()) : currentColorOrValidColor(style, style .borderRightColor()); 1807 return allowVisitedStyle ? CSSColorValue::create(style.visitedDependentC olor(CSSPropertyBorderRightColor).rgb()) : currentColorOrValidColor(style, style .borderRightColor());
1800 case CSSPropertyBorderBottomColor: 1808 case CSSPropertyBorderBottomColor:
1801 return allowVisitedStyle ? CSSColorValue::create(style.visitedDependentC olor(CSSPropertyBorderBottomColor).rgb()) : currentColorOrValidColor(style, styl e.borderBottomColor()); 1809 return allowVisitedStyle ? CSSColorValue::create(style.visitedDependentC olor(CSSPropertyBorderBottomColor).rgb()) : currentColorOrValidColor(style, styl e.borderBottomColor());
1802 case CSSPropertyBorderLeftColor: 1810 case CSSPropertyBorderLeftColor:
1803 return allowVisitedStyle ? CSSColorValue::create(style.visitedDependentC olor(CSSPropertyBorderLeftColor).rgb()) : currentColorOrValidColor(style, style. borderLeftColor()); 1811 return allowVisitedStyle ? CSSColorValue::create(style.visitedDependentC olor(CSSPropertyBorderLeftColor).rgb()) : currentColorOrValidColor(style, style. borderLeftColor());
1804 case CSSPropertyBorderTopStyle: 1812 case CSSPropertyBorderTopStyle:
1805 return CSSPrimitiveValue::create(style.borderTopStyle()); 1813 return CSSIdentifierValue::create(style.borderTopStyle());
1806 case CSSPropertyBorderRightStyle: 1814 case CSSPropertyBorderRightStyle:
1807 return CSSPrimitiveValue::create(style.borderRightStyle()); 1815 return CSSIdentifierValue::create(style.borderRightStyle());
1808 case CSSPropertyBorderBottomStyle: 1816 case CSSPropertyBorderBottomStyle:
1809 return CSSPrimitiveValue::create(style.borderBottomStyle()); 1817 return CSSIdentifierValue::create(style.borderBottomStyle());
1810 case CSSPropertyBorderLeftStyle: 1818 case CSSPropertyBorderLeftStyle:
1811 return CSSPrimitiveValue::create(style.borderLeftStyle()); 1819 return CSSIdentifierValue::create(style.borderLeftStyle());
1812 case CSSPropertyBorderTopWidth: 1820 case CSSPropertyBorderTopWidth:
1813 return zoomAdjustedPixelValue(style.borderTopWidth(), style); 1821 return zoomAdjustedPixelValue(style.borderTopWidth(), style);
1814 case CSSPropertyBorderRightWidth: 1822 case CSSPropertyBorderRightWidth:
1815 return zoomAdjustedPixelValue(style.borderRightWidth(), style); 1823 return zoomAdjustedPixelValue(style.borderRightWidth(), style);
1816 case CSSPropertyBorderBottomWidth: 1824 case CSSPropertyBorderBottomWidth:
1817 return zoomAdjustedPixelValue(style.borderBottomWidth(), style); 1825 return zoomAdjustedPixelValue(style.borderBottomWidth(), style);
1818 case CSSPropertyBorderLeftWidth: 1826 case CSSPropertyBorderLeftWidth:
1819 return zoomAdjustedPixelValue(style.borderLeftWidth(), style); 1827 return zoomAdjustedPixelValue(style.borderLeftWidth(), style);
1820 case CSSPropertyBottom: 1828 case CSSPropertyBottom:
1821 return valueForPositionOffset(style, CSSPropertyBottom, layoutObject); 1829 return valueForPositionOffset(style, CSSPropertyBottom, layoutObject);
1822 case CSSPropertyWebkitBoxAlign: 1830 case CSSPropertyWebkitBoxAlign:
1823 return CSSPrimitiveValue::create(style.boxAlign()); 1831 return CSSIdentifierValue::create(style.boxAlign());
1824 case CSSPropertyWebkitBoxDecorationBreak: 1832 case CSSPropertyWebkitBoxDecorationBreak:
1825 if (style.boxDecorationBreak() == BoxDecorationBreakSlice) 1833 if (style.boxDecorationBreak() == BoxDecorationBreakSlice)
1826 return CSSPrimitiveValue::createIdentifier(CSSValueSlice); 1834 return CSSIdentifierValue::create(CSSValueSlice);
1827 return CSSPrimitiveValue::createIdentifier(CSSValueClone); 1835 return CSSIdentifierValue::create(CSSValueClone);
1828 case CSSPropertyWebkitBoxDirection: 1836 case CSSPropertyWebkitBoxDirection:
1829 return CSSPrimitiveValue::create(style.boxDirection()); 1837 return CSSIdentifierValue::create(style.boxDirection());
1830 case CSSPropertyWebkitBoxFlex: 1838 case CSSPropertyWebkitBoxFlex:
1831 return CSSPrimitiveValue::create(style.boxFlex(), CSSPrimitiveValue::Uni tType::Number); 1839 return CSSPrimitiveValue::create(style.boxFlex(), CSSPrimitiveValue::Uni tType::Number);
1832 case CSSPropertyWebkitBoxFlexGroup: 1840 case CSSPropertyWebkitBoxFlexGroup:
1833 return CSSPrimitiveValue::create(style.boxFlexGroup(), CSSPrimitiveValue ::UnitType::Number); 1841 return CSSPrimitiveValue::create(style.boxFlexGroup(), CSSPrimitiveValue ::UnitType::Number);
1834 case CSSPropertyWebkitBoxLines: 1842 case CSSPropertyWebkitBoxLines:
1835 return CSSPrimitiveValue::create(style.boxLines()); 1843 return CSSIdentifierValue::create(style.boxLines());
1836 case CSSPropertyWebkitBoxOrdinalGroup: 1844 case CSSPropertyWebkitBoxOrdinalGroup:
1837 return CSSPrimitiveValue::create(style.boxOrdinalGroup(), CSSPrimitiveVa lue::UnitType::Number); 1845 return CSSPrimitiveValue::create(style.boxOrdinalGroup(), CSSPrimitiveVa lue::UnitType::Number);
1838 case CSSPropertyWebkitBoxOrient: 1846 case CSSPropertyWebkitBoxOrient:
1839 return CSSPrimitiveValue::create(style.boxOrient()); 1847 return CSSIdentifierValue::create(style.boxOrient());
1840 case CSSPropertyWebkitBoxPack: 1848 case CSSPropertyWebkitBoxPack:
1841 return CSSPrimitiveValue::create(style.boxPack()); 1849 return CSSIdentifierValue::create(style.boxPack());
1842 case CSSPropertyWebkitBoxReflect: 1850 case CSSPropertyWebkitBoxReflect:
1843 return valueForReflection(style.boxReflect(), style); 1851 return valueForReflection(style.boxReflect(), style);
1844 case CSSPropertyBoxShadow: 1852 case CSSPropertyBoxShadow:
1845 return valueForShadowList(style.boxShadow(), style, true); 1853 return valueForShadowList(style.boxShadow(), style, true);
1846 case CSSPropertyCaptionSide: 1854 case CSSPropertyCaptionSide:
1847 return CSSPrimitiveValue::create(style.captionSide()); 1855 return CSSIdentifierValue::create(style.captionSide());
1848 case CSSPropertyClear: 1856 case CSSPropertyClear:
1849 return CSSPrimitiveValue::create(style.clear()); 1857 return CSSIdentifierValue::create(style.clear());
1850 case CSSPropertyColor: 1858 case CSSPropertyColor:
1851 return CSSColorValue::create(allowVisitedStyle ? style.visitedDependentC olor(CSSPropertyColor).rgb() : style.color().rgb()); 1859 return CSSColorValue::create(allowVisitedStyle ? style.visitedDependentC olor(CSSPropertyColor).rgb() : style.color().rgb());
1852 case CSSPropertyWebkitPrintColorAdjust: 1860 case CSSPropertyWebkitPrintColorAdjust:
1853 return CSSPrimitiveValue::create(style.getPrintColorAdjust()); 1861 return CSSIdentifierValue::create(style.getPrintColorAdjust());
1854 case CSSPropertyColumnCount: 1862 case CSSPropertyColumnCount:
1855 if (style.hasAutoColumnCount()) 1863 if (style.hasAutoColumnCount())
1856 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); 1864 return CSSIdentifierValue::create(CSSValueAuto);
1857 return CSSPrimitiveValue::create(style.columnCount(), CSSPrimitiveValue: :UnitType::Number); 1865 return CSSPrimitiveValue::create(style.columnCount(), CSSPrimitiveValue: :UnitType::Number);
1858 case CSSPropertyColumnFill: 1866 case CSSPropertyColumnFill:
1859 return CSSPrimitiveValue::create(style.getColumnFill()); 1867 return CSSIdentifierValue::create(style.getColumnFill());
1860 case CSSPropertyColumnGap: 1868 case CSSPropertyColumnGap:
1861 if (style.hasNormalColumnGap()) 1869 if (style.hasNormalColumnGap())
1862 return CSSPrimitiveValue::createIdentifier(CSSValueNormal); 1870 return CSSIdentifierValue::create(CSSValueNormal);
1863 return zoomAdjustedPixelValue(style.columnGap(), style); 1871 return zoomAdjustedPixelValue(style.columnGap(), style);
1864 case CSSPropertyColumnRuleColor: 1872 case CSSPropertyColumnRuleColor:
1865 return allowVisitedStyle ? CSSColorValue::create(style.visitedDependentC olor(CSSPropertyOutlineColor).rgb()) : currentColorOrValidColor(style, style.col umnRuleColor()); 1873 return allowVisitedStyle ? CSSColorValue::create(style.visitedDependentC olor(CSSPropertyOutlineColor).rgb()) : currentColorOrValidColor(style, style.col umnRuleColor());
1866 case CSSPropertyColumnRuleStyle: 1874 case CSSPropertyColumnRuleStyle:
1867 return CSSPrimitiveValue::create(style.columnRuleStyle()); 1875 return CSSIdentifierValue::create(style.columnRuleStyle());
1868 case CSSPropertyColumnRuleWidth: 1876 case CSSPropertyColumnRuleWidth:
1869 return zoomAdjustedPixelValue(style.columnRuleWidth(), style); 1877 return zoomAdjustedPixelValue(style.columnRuleWidth(), style);
1870 case CSSPropertyColumnSpan: 1878 case CSSPropertyColumnSpan:
1871 return CSSPrimitiveValue::createIdentifier(style.getColumnSpan() ? CSSVa lueAll : CSSValueNone); 1879 return CSSIdentifierValue::create(style.getColumnSpan() ? CSSValueAll : CSSValueNone);
1872 case CSSPropertyWebkitColumnBreakAfter: 1880 case CSSPropertyWebkitColumnBreakAfter:
1873 return CSSPrimitiveValue::create(mapToColumnBreakValue(style.breakAfter( ))); 1881 return CSSIdentifierValue::create(mapToColumnBreakValue(style.breakAfter ()));
1874 case CSSPropertyWebkitColumnBreakBefore: 1882 case CSSPropertyWebkitColumnBreakBefore:
1875 return CSSPrimitiveValue::create(mapToColumnBreakValue(style.breakBefore ())); 1883 return CSSIdentifierValue::create(mapToColumnBreakValue(style.breakBefor e()));
1876 case CSSPropertyWebkitColumnBreakInside: 1884 case CSSPropertyWebkitColumnBreakInside:
1877 return CSSPrimitiveValue::create(mapToColumnBreakValue(style.breakInside ())); 1885 return CSSIdentifierValue::create(mapToColumnBreakValue(style.breakInsid e()));
1878 case CSSPropertyColumnWidth: 1886 case CSSPropertyColumnWidth:
1879 if (style.hasAutoColumnWidth()) 1887 if (style.hasAutoColumnWidth())
1880 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); 1888 return CSSIdentifierValue::create(CSSValueAuto);
1881 return zoomAdjustedPixelValue(style.columnWidth(), style); 1889 return zoomAdjustedPixelValue(style.columnWidth(), style);
1882 case CSSPropertyTabSize: 1890 case CSSPropertyTabSize:
1883 return CSSPrimitiveValue::create( 1891 return CSSPrimitiveValue::create(
1884 style.getTabSize().getPixelSize(1.0), style.getTabSize().isSpaces() ? CSSPrimitiveValue::UnitType::Number : CSSPrimitiveValue::UnitType::Pixels); 1892 style.getTabSize().getPixelSize(1.0), style.getTabSize().isSpaces() ? CSSPrimitiveValue::UnitType::Number : CSSPrimitiveValue::UnitType::Pixels);
1885 case CSSPropertyTextSizeAdjust: 1893 case CSSPropertyTextSizeAdjust:
1886 if (style.getTextSizeAdjust().isAuto()) 1894 if (style.getTextSizeAdjust().isAuto())
1887 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); 1895 return CSSIdentifierValue::create(CSSValueAuto);
1888 return CSSPrimitiveValue::create(style.getTextSizeAdjust().multiplier() * 100, CSSPrimitiveValue::UnitType::Percentage); 1896 return CSSPrimitiveValue::create(style.getTextSizeAdjust().multiplier() * 100, CSSPrimitiveValue::UnitType::Percentage);
1889 case CSSPropertyCursor: { 1897 case CSSPropertyCursor: {
1890 CSSValueList* list = nullptr; 1898 CSSValueList* list = nullptr;
1891 CursorList* cursors = style.cursors(); 1899 CursorList* cursors = style.cursors();
1892 if (cursors && cursors->size() > 0) { 1900 if (cursors && cursors->size() > 0) {
1893 list = CSSValueList::createCommaSeparated(); 1901 list = CSSValueList::createCommaSeparated();
1894 for (unsigned i = 0; i < cursors->size(); ++i) { 1902 for (unsigned i = 0; i < cursors->size(); ++i) {
1895 if (StyleImage* image = cursors->at(i).image()) 1903 if (StyleImage* image = cursors->at(i).image())
1896 list->append(*CSSCursorImageValue::create(image->computedCSS Value(), cursors->at(i).hotSpotSpecified(), cursors->at(i).hotSpot())); 1904 list->append(*CSSCursorImageValue::create(image->computedCSS Value(), cursors->at(i).hotSpotSpecified(), cursors->at(i).hotSpot()));
1897 } 1905 }
1898 } 1906 }
1899 CSSValue* value = CSSPrimitiveValue::create(style.cursor()); 1907 CSSValue* value = CSSIdentifierValue::create(style.cursor());
1900 if (list) { 1908 if (list) {
1901 list->append(*value); 1909 list->append(*value);
1902 return list; 1910 return list;
1903 } 1911 }
1904 return value; 1912 return value;
1905 } 1913 }
1906 case CSSPropertyDirection: 1914 case CSSPropertyDirection:
1907 return CSSPrimitiveValue::create(style.direction()); 1915 return CSSIdentifierValue::create(style.direction());
1908 case CSSPropertyDisplay: 1916 case CSSPropertyDisplay:
1909 return CSSPrimitiveValue::create(style.display()); 1917 return CSSIdentifierValue::create(style.display());
1910 case CSSPropertyEmptyCells: 1918 case CSSPropertyEmptyCells:
1911 return CSSPrimitiveValue::create(style.emptyCells()); 1919 return CSSIdentifierValue::create(style.emptyCells());
1912 case CSSPropertyAlignContent: 1920 case CSSPropertyAlignContent:
1913 return valueForContentPositionAndDistributionWithOverflowAlignment(style .alignContent(), CSSValueStretch); 1921 return valueForContentPositionAndDistributionWithOverflowAlignment(style .alignContent(), CSSValueStretch);
1914 case CSSPropertyAlignItems: 1922 case CSSPropertyAlignItems:
1915 return valueForItemPositionWithOverflowAlignment(style.alignItems()); 1923 return valueForItemPositionWithOverflowAlignment(style.alignItems());
1916 case CSSPropertyAlignSelf: 1924 case CSSPropertyAlignSelf:
1917 return valueForItemPositionWithOverflowAlignment(style.alignSelf()); 1925 return valueForItemPositionWithOverflowAlignment(style.alignSelf());
1918 case CSSPropertyFlex: 1926 case CSSPropertyFlex:
1919 return valuesForShorthandProperty(flexShorthand(), style, layoutObject, styledNode, allowVisitedStyle); 1927 return valuesForShorthandProperty(flexShorthand(), style, layoutObject, styledNode, allowVisitedStyle);
1920 case CSSPropertyFlexBasis: 1928 case CSSPropertyFlexBasis:
1921 return zoomAdjustedPixelValueForLength(style.flexBasis(), style); 1929 return zoomAdjustedPixelValueForLength(style.flexBasis(), style);
1922 case CSSPropertyFlexDirection: 1930 case CSSPropertyFlexDirection:
1923 return CSSPrimitiveValue::create(style.flexDirection()); 1931 return CSSIdentifierValue::create(style.flexDirection());
1924 case CSSPropertyFlexFlow: 1932 case CSSPropertyFlexFlow:
1925 return valuesForShorthandProperty(flexFlowShorthand(), style, layoutObje ct, styledNode, allowVisitedStyle); 1933 return valuesForShorthandProperty(flexFlowShorthand(), style, layoutObje ct, styledNode, allowVisitedStyle);
1926 case CSSPropertyFlexGrow: 1934 case CSSPropertyFlexGrow:
1927 return CSSPrimitiveValue::create(style.flexGrow(), CSSPrimitiveValue::Un itType::Number); 1935 return CSSPrimitiveValue::create(style.flexGrow(), CSSPrimitiveValue::Un itType::Number);
1928 case CSSPropertyFlexShrink: 1936 case CSSPropertyFlexShrink:
1929 return CSSPrimitiveValue::create(style.flexShrink(), CSSPrimitiveValue:: UnitType::Number); 1937 return CSSPrimitiveValue::create(style.flexShrink(), CSSPrimitiveValue:: UnitType::Number);
1930 case CSSPropertyFlexWrap: 1938 case CSSPropertyFlexWrap:
1931 return CSSPrimitiveValue::create(style.flexWrap()); 1939 return CSSIdentifierValue::create(style.flexWrap());
1932 case CSSPropertyJustifyContent: 1940 case CSSPropertyJustifyContent:
1933 return valueForContentPositionAndDistributionWithOverflowAlignment(style .justifyContent(), CSSValueFlexStart); 1941 return valueForContentPositionAndDistributionWithOverflowAlignment(style .justifyContent(), CSSValueFlexStart);
1934 case CSSPropertyOrder: 1942 case CSSPropertyOrder:
1935 return CSSPrimitiveValue::create(style.order(), CSSPrimitiveValue::UnitT ype::Number); 1943 return CSSPrimitiveValue::create(style.order(), CSSPrimitiveValue::UnitT ype::Number);
1936 case CSSPropertyFloat: 1944 case CSSPropertyFloat:
1937 if (style.display() != NONE && style.hasOutOfFlowPosition()) 1945 if (style.display() != NONE && style.hasOutOfFlowPosition())
1938 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 1946 return CSSIdentifierValue::create(CSSValueNone);
1939 return CSSPrimitiveValue::create(style.floating()); 1947 return CSSIdentifierValue::create(style.floating());
1940 case CSSPropertyFont: 1948 case CSSPropertyFont:
1941 return valueForFont(style); 1949 return valueForFont(style);
1942 case CSSPropertyFontFamily: 1950 case CSSPropertyFontFamily:
1943 return valueForFontFamily(style); 1951 return valueForFontFamily(style);
1944 case CSSPropertyFontSize: 1952 case CSSPropertyFontSize:
1945 return valueForFontSize(style); 1953 return valueForFontSize(style);
1946 case CSSPropertyFontSizeAdjust: 1954 case CSSPropertyFontSizeAdjust:
1947 if (style.hasFontSizeAdjust()) 1955 if (style.hasFontSizeAdjust())
1948 return CSSPrimitiveValue::create(style.fontSizeAdjust(), CSSPrimitiv eValue::UnitType::Number); 1956 return CSSPrimitiveValue::create(style.fontSizeAdjust(), CSSPrimitiv eValue::UnitType::Number);
1949 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 1957 return CSSIdentifierValue::create(CSSValueNone);
1950 case CSSPropertyFontStretch: 1958 case CSSPropertyFontStretch:
1951 return valueForFontStretch(style); 1959 return valueForFontStretch(style);
1952 case CSSPropertyFontStyle: 1960 case CSSPropertyFontStyle:
1953 return valueForFontStyle(style); 1961 return valueForFontStyle(style);
1954 case CSSPropertyFontVariant: 1962 case CSSPropertyFontVariant:
1955 return valuesForFontVariantProperty(style, layoutObject, styledNode, all owVisitedStyle); 1963 return valuesForFontVariantProperty(style, layoutObject, styledNode, all owVisitedStyle);
1956 case CSSPropertyFontWeight: 1964 case CSSPropertyFontWeight:
1957 return valueForFontWeight(style); 1965 return valueForFontWeight(style);
1958 case CSSPropertyFontFeatureSettings: { 1966 case CSSPropertyFontFeatureSettings: {
1959 const FontFeatureSettings* featureSettings = style.getFontDescription(). featureSettings(); 1967 const FontFeatureSettings* featureSettings = style.getFontDescription(). featureSettings();
1960 if (!featureSettings || !featureSettings->size()) 1968 if (!featureSettings || !featureSettings->size())
1961 return CSSPrimitiveValue::createIdentifier(CSSValueNormal); 1969 return CSSIdentifierValue::create(CSSValueNormal);
1962 CSSValueList* list = CSSValueList::createCommaSeparated(); 1970 CSSValueList* list = CSSValueList::createCommaSeparated();
1963 for (unsigned i = 0; i < featureSettings->size(); ++i) { 1971 for (unsigned i = 0; i < featureSettings->size(); ++i) {
1964 const FontFeature& feature = featureSettings->at(i); 1972 const FontFeature& feature = featureSettings->at(i);
1965 CSSFontFeatureValue* featureValue = CSSFontFeatureValue::create(feat ure.tag(), feature.value()); 1973 CSSFontFeatureValue* featureValue = CSSFontFeatureValue::create(feat ure.tag(), feature.value());
1966 list->append(*featureValue); 1974 list->append(*featureValue);
1967 } 1975 }
1968 return list; 1976 return list;
1969 } 1977 }
1970 case CSSPropertyGridAutoFlow: { 1978 case CSSPropertyGridAutoFlow: {
1971 CSSValueList* list = CSSValueList::createSpaceSeparated(); 1979 CSSValueList* list = CSSValueList::createSpaceSeparated();
1972 switch (style.getGridAutoFlow()) { 1980 switch (style.getGridAutoFlow()) {
1973 case AutoFlowRow: 1981 case AutoFlowRow:
1974 case AutoFlowRowDense: 1982 case AutoFlowRowDense:
1975 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueRow)); 1983 list->append(*CSSIdentifierValue::create(CSSValueRow));
1976 break; 1984 break;
1977 case AutoFlowColumn: 1985 case AutoFlowColumn:
1978 case AutoFlowColumnDense: 1986 case AutoFlowColumnDense:
1979 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueColumn)); 1987 list->append(*CSSIdentifierValue::create(CSSValueColumn));
1980 break; 1988 break;
1981 default: 1989 default:
1982 ASSERT_NOT_REACHED(); 1990 ASSERT_NOT_REACHED();
1983 } 1991 }
1984 1992
1985 switch (style.getGridAutoFlow()) { 1993 switch (style.getGridAutoFlow()) {
1986 case AutoFlowRowDense: 1994 case AutoFlowRowDense:
1987 case AutoFlowColumnDense: 1995 case AutoFlowColumnDense:
1988 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueDense)); 1996 list->append(*CSSIdentifierValue::create(CSSValueDense));
1989 break; 1997 break;
1990 default: 1998 default:
1991 // Do nothing. 1999 // Do nothing.
1992 break; 2000 break;
1993 } 2001 }
1994 2002
1995 return list; 2003 return list;
1996 } 2004 }
1997 // Specs mention that getComputedStyle() should return the used value of the property instead of the computed 2005 // Specs mention that getComputedStyle() should return the used value of the property instead of the computed
1998 // one for grid-template-{rows|columns} but not for the grid-auto-{rows|colu mns} as things like 2006 // one for grid-template-{rows|columns} but not for the grid-auto-{rows|colu mns} as things like
(...skipping 24 matching lines...) Expand all
2023 return valuesForGridShorthand(gridRowShorthand(), style, layoutObject, s tyledNode, allowVisitedStyle); 2031 return valuesForGridShorthand(gridRowShorthand(), style, layoutObject, s tyledNode, allowVisitedStyle);
2024 case CSSPropertyGridArea: 2032 case CSSPropertyGridArea:
2025 return valuesForGridShorthand(gridAreaShorthand(), style, layoutObject, styledNode, allowVisitedStyle); 2033 return valuesForGridShorthand(gridAreaShorthand(), style, layoutObject, styledNode, allowVisitedStyle);
2026 case CSSPropertyGridTemplate: 2034 case CSSPropertyGridTemplate:
2027 return valuesForGridShorthand(gridTemplateShorthand(), style, layoutObje ct, styledNode, allowVisitedStyle); 2035 return valuesForGridShorthand(gridTemplateShorthand(), style, layoutObje ct, styledNode, allowVisitedStyle);
2028 case CSSPropertyGrid: 2036 case CSSPropertyGrid:
2029 return valuesForGridShorthand(gridShorthand(), style, layoutObject, styl edNode, allowVisitedStyle); 2037 return valuesForGridShorthand(gridShorthand(), style, layoutObject, styl edNode, allowVisitedStyle);
2030 case CSSPropertyGridTemplateAreas: 2038 case CSSPropertyGridTemplateAreas:
2031 if (!style.namedGridAreaRowCount()) { 2039 if (!style.namedGridAreaRowCount()) {
2032 ASSERT(!style.namedGridAreaColumnCount()); 2040 ASSERT(!style.namedGridAreaColumnCount());
2033 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 2041 return CSSIdentifierValue::create(CSSValueNone);
2034 } 2042 }
2035 2043
2036 return CSSGridTemplateAreasValue::create(style.namedGridArea(), style.na medGridAreaRowCount(), style.namedGridAreaColumnCount()); 2044 return CSSGridTemplateAreasValue::create(style.namedGridArea(), style.na medGridAreaRowCount(), style.namedGridAreaColumnCount());
2037 case CSSPropertyGridColumnGap: 2045 case CSSPropertyGridColumnGap:
2038 return zoomAdjustedPixelValueForLength(style.gridColumnGap(), style); 2046 return zoomAdjustedPixelValueForLength(style.gridColumnGap(), style);
2039 case CSSPropertyGridRowGap: 2047 case CSSPropertyGridRowGap:
2040 return zoomAdjustedPixelValueForLength(style.gridRowGap(), style); 2048 return zoomAdjustedPixelValueForLength(style.gridRowGap(), style);
2041 case CSSPropertyGridGap: 2049 case CSSPropertyGridGap:
2042 return valuesForShorthandProperty(gridGapShorthand(), style, layoutObjec t, styledNode, allowVisitedStyle); 2050 return valuesForShorthandProperty(gridGapShorthand(), style, layoutObjec t, styledNode, allowVisitedStyle);
2043 2051
2044 case CSSPropertyHeight: 2052 case CSSPropertyHeight:
2045 if (layoutObject) { 2053 if (layoutObject) {
2046 // According to http://www.w3.org/TR/CSS2/visudet.html#the-height-pr operty, 2054 // According to http://www.w3.org/TR/CSS2/visudet.html#the-height-pr operty,
2047 // the "height" property does not apply for non-atomic inline elemen ts. 2055 // the "height" property does not apply for non-atomic inline elemen ts.
2048 if (!layoutObject->isAtomicInlineLevel() && layoutObject->isInline() ) 2056 if (!layoutObject->isAtomicInlineLevel() && layoutObject->isInline() )
2049 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); 2057 return CSSIdentifierValue::create(CSSValueAuto);
2050 return zoomAdjustedPixelValue(sizingBox(layoutObject).height(), styl e); 2058 return zoomAdjustedPixelValue(sizingBox(layoutObject).height(), styl e);
2051 } 2059 }
2052 return zoomAdjustedPixelValueForLength(style.height(), style); 2060 return zoomAdjustedPixelValueForLength(style.height(), style);
2053 case CSSPropertyWebkitHighlight: 2061 case CSSPropertyWebkitHighlight:
2054 if (style.highlight() == nullAtom) 2062 if (style.highlight() == nullAtom)
2055 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 2063 return CSSIdentifierValue::create(CSSValueNone);
2056 return CSSStringValue::create(style.highlight()); 2064 return CSSStringValue::create(style.highlight());
2057 case CSSPropertyHyphens: 2065 case CSSPropertyHyphens:
2058 return CSSPrimitiveValue::create(style.getHyphens()); 2066 return CSSIdentifierValue::create(style.getHyphens());
2059 case CSSPropertyWebkitHyphenateCharacter: 2067 case CSSPropertyWebkitHyphenateCharacter:
2060 if (style.hyphenationString().isNull()) 2068 if (style.hyphenationString().isNull())
2061 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); 2069 return CSSIdentifierValue::create(CSSValueAuto);
2062 return CSSStringValue::create(style.hyphenationString()); 2070 return CSSStringValue::create(style.hyphenationString());
2063 case CSSPropertyImageRendering: 2071 case CSSPropertyImageRendering:
2064 return CSSPrimitiveValue::create(style.imageRendering()); 2072 return CSSIdentifierValue::create(style.imageRendering());
2065 case CSSPropertyImageOrientation: 2073 case CSSPropertyImageOrientation:
2066 if (style.respectImageOrientation() == RespectImageOrientation) 2074 if (style.respectImageOrientation() == RespectImageOrientation)
2067 return CSSPrimitiveValue::createIdentifier(CSSValueFromImage); 2075 return CSSIdentifierValue::create(CSSValueFromImage);
2068 return CSSPrimitiveValue::create(0, CSSPrimitiveValue::UnitType::Degrees ); 2076 return CSSPrimitiveValue::create(0, CSSPrimitiveValue::UnitType::Degrees );
2069 case CSSPropertyIsolation: 2077 case CSSPropertyIsolation:
2070 return CSSPrimitiveValue::create(style.isolation()); 2078 return CSSIdentifierValue::create(style.isolation());
2071 case CSSPropertyJustifyItems: 2079 case CSSPropertyJustifyItems:
2072 return valueForItemPositionWithOverflowAlignment(style.justifyItems()); 2080 return valueForItemPositionWithOverflowAlignment(style.justifyItems());
2073 case CSSPropertyJustifySelf: 2081 case CSSPropertyJustifySelf:
2074 return valueForItemPositionWithOverflowAlignment(style.justifySelf()); 2082 return valueForItemPositionWithOverflowAlignment(style.justifySelf());
2075 case CSSPropertyLeft: 2083 case CSSPropertyLeft:
2076 return valueForPositionOffset(style, CSSPropertyLeft, layoutObject); 2084 return valueForPositionOffset(style, CSSPropertyLeft, layoutObject);
2077 case CSSPropertyLetterSpacing: 2085 case CSSPropertyLetterSpacing:
2078 if (!style.letterSpacing()) 2086 if (!style.letterSpacing())
2079 return CSSPrimitiveValue::createIdentifier(CSSValueNormal); 2087 return CSSIdentifierValue::create(CSSValueNormal);
2080 return zoomAdjustedPixelValue(style.letterSpacing(), style); 2088 return zoomAdjustedPixelValue(style.letterSpacing(), style);
2081 case CSSPropertyWebkitLineClamp: 2089 case CSSPropertyWebkitLineClamp:
2082 if (style.lineClamp().isNone()) 2090 if (style.lineClamp().isNone())
2083 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 2091 return CSSIdentifierValue::create(CSSValueNone);
2084 return CSSPrimitiveValue::create(style.lineClamp().value(), style.lineCl amp().isPercentage() ? CSSPrimitiveValue::UnitType::Percentage : CSSPrimitiveVal ue::UnitType::Number); 2092 return CSSPrimitiveValue::create(style.lineClamp().value(), style.lineCl amp().isPercentage() ? CSSPrimitiveValue::UnitType::Percentage : CSSPrimitiveVal ue::UnitType::Number);
2085 case CSSPropertyLineHeight: 2093 case CSSPropertyLineHeight:
2086 return valueForLineHeight(style); 2094 return valueForLineHeight(style);
2087 case CSSPropertyListStyleImage: 2095 case CSSPropertyListStyleImage:
2088 if (style.listStyleImage()) 2096 if (style.listStyleImage())
2089 return style.listStyleImage()->computedCSSValue(); 2097 return style.listStyleImage()->computedCSSValue();
2090 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 2098 return CSSIdentifierValue::create(CSSValueNone);
2091 case CSSPropertyListStylePosition: 2099 case CSSPropertyListStylePosition:
2092 return CSSPrimitiveValue::create(style.listStylePosition()); 2100 return CSSIdentifierValue::create(style.listStylePosition());
2093 case CSSPropertyListStyleType: 2101 case CSSPropertyListStyleType:
2094 return CSSPrimitiveValue::create(style.listStyleType()); 2102 return CSSIdentifierValue::create(style.listStyleType());
2095 case CSSPropertyWebkitLocale: 2103 case CSSPropertyWebkitLocale:
2096 if (style.locale().isNull()) 2104 if (style.locale().isNull())
2097 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); 2105 return CSSIdentifierValue::create(CSSValueAuto);
2098 return CSSStringValue::create(style.locale()); 2106 return CSSStringValue::create(style.locale());
2099 case CSSPropertyMarginTop: { 2107 case CSSPropertyMarginTop: {
2100 Length marginTop = style.marginTop(); 2108 Length marginTop = style.marginTop();
2101 if (marginTop.isFixed() || !layoutObject || !layoutObject->isBox()) 2109 if (marginTop.isFixed() || !layoutObject || !layoutObject->isBox())
2102 return zoomAdjustedPixelValueForLength(marginTop, style); 2110 return zoomAdjustedPixelValueForLength(marginTop, style);
2103 return zoomAdjustedPixelValue(toLayoutBox(layoutObject)->marginTop(), st yle); 2111 return zoomAdjustedPixelValue(toLayoutBox(layoutObject)->marginTop(), st yle);
2104 } 2112 }
2105 case CSSPropertyMarginRight: { 2113 case CSSPropertyMarginRight: {
2106 Length marginRight = style.marginRight(); 2114 Length marginRight = style.marginRight();
2107 if (marginRight.isFixed() || !layoutObject || !layoutObject->isBox()) 2115 if (marginRight.isFixed() || !layoutObject || !layoutObject->isBox())
(...skipping 15 matching lines...) Expand all
2123 return zoomAdjustedPixelValueForLength(marginBottom, style); 2131 return zoomAdjustedPixelValueForLength(marginBottom, style);
2124 return zoomAdjustedPixelValue(toLayoutBox(layoutObject)->marginBottom(), style); 2132 return zoomAdjustedPixelValue(toLayoutBox(layoutObject)->marginBottom(), style);
2125 } 2133 }
2126 case CSSPropertyMarginLeft: { 2134 case CSSPropertyMarginLeft: {
2127 Length marginLeft = style.marginLeft(); 2135 Length marginLeft = style.marginLeft();
2128 if (marginLeft.isFixed() || !layoutObject || !layoutObject->isBox()) 2136 if (marginLeft.isFixed() || !layoutObject || !layoutObject->isBox())
2129 return zoomAdjustedPixelValueForLength(marginLeft, style); 2137 return zoomAdjustedPixelValueForLength(marginLeft, style);
2130 return zoomAdjustedPixelValue(toLayoutBox(layoutObject)->marginLeft(), s tyle); 2138 return zoomAdjustedPixelValue(toLayoutBox(layoutObject)->marginLeft(), s tyle);
2131 } 2139 }
2132 case CSSPropertyWebkitUserModify: 2140 case CSSPropertyWebkitUserModify:
2133 return CSSPrimitiveValue::create(style.userModify()); 2141 return CSSIdentifierValue::create(style.userModify());
2134 case CSSPropertyMaxHeight: { 2142 case CSSPropertyMaxHeight: {
2135 const Length& maxHeight = style.maxHeight(); 2143 const Length& maxHeight = style.maxHeight();
2136 if (maxHeight.isMaxSizeNone()) 2144 if (maxHeight.isMaxSizeNone())
2137 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 2145 return CSSIdentifierValue::create(CSSValueNone);
2138 return zoomAdjustedPixelValueForLength(maxHeight, style); 2146 return zoomAdjustedPixelValueForLength(maxHeight, style);
2139 } 2147 }
2140 case CSSPropertyMaxWidth: { 2148 case CSSPropertyMaxWidth: {
2141 const Length& maxWidth = style.maxWidth(); 2149 const Length& maxWidth = style.maxWidth();
2142 if (maxWidth.isMaxSizeNone()) 2150 if (maxWidth.isMaxSizeNone())
2143 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 2151 return CSSIdentifierValue::create(CSSValueNone);
2144 return zoomAdjustedPixelValueForLength(maxWidth, style); 2152 return zoomAdjustedPixelValueForLength(maxWidth, style);
2145 } 2153 }
2146 case CSSPropertyMinHeight: 2154 case CSSPropertyMinHeight:
2147 if (style.minHeight().isAuto()) { 2155 if (style.minHeight().isAuto()) {
2148 Node* parent = styledNode->parentNode(); 2156 Node* parent = styledNode->parentNode();
2149 if (isFlexOrGrid(parent ? parent->ensureComputedStyle() : nullptr)) 2157 if (isFlexOrGrid(parent ? parent->ensureComputedStyle() : nullptr))
2150 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); 2158 return CSSIdentifierValue::create(CSSValueAuto);
2151 return zoomAdjustedPixelValue(0, style); 2159 return zoomAdjustedPixelValue(0, style);
2152 } 2160 }
2153 return zoomAdjustedPixelValueForLength(style.minHeight(), style); 2161 return zoomAdjustedPixelValueForLength(style.minHeight(), style);
2154 case CSSPropertyMinWidth: 2162 case CSSPropertyMinWidth:
2155 if (style.minWidth().isAuto()) { 2163 if (style.minWidth().isAuto()) {
2156 Node* parent = styledNode->parentNode(); 2164 Node* parent = styledNode->parentNode();
2157 if (isFlexOrGrid(parent ? parent->ensureComputedStyle() : nullptr)) 2165 if (isFlexOrGrid(parent ? parent->ensureComputedStyle() : nullptr))
2158 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); 2166 return CSSIdentifierValue::create(CSSValueAuto);
2159 return zoomAdjustedPixelValue(0, style); 2167 return zoomAdjustedPixelValue(0, style);
2160 } 2168 }
2161 return zoomAdjustedPixelValueForLength(style.minWidth(), style); 2169 return zoomAdjustedPixelValueForLength(style.minWidth(), style);
2162 case CSSPropertyObjectFit: 2170 case CSSPropertyObjectFit:
2163 return CSSPrimitiveValue::create(style.getObjectFit()); 2171 return CSSIdentifierValue::create(style.getObjectFit());
2164 case CSSPropertyObjectPosition: 2172 case CSSPropertyObjectPosition:
2165 return CSSValuePair::create( 2173 return CSSValuePair::create(
2166 zoomAdjustedPixelValueForLength(style.objectPosition().x(), style), 2174 zoomAdjustedPixelValueForLength(style.objectPosition().x(), style),
2167 zoomAdjustedPixelValueForLength(style.objectPosition().y(), style), 2175 zoomAdjustedPixelValueForLength(style.objectPosition().y(), style),
2168 CSSValuePair::KeepIdenticalValues); 2176 CSSValuePair::KeepIdenticalValues);
2169 case CSSPropertyOpacity: 2177 case CSSPropertyOpacity:
2170 return CSSPrimitiveValue::create(style.opacity(), CSSPrimitiveValue::Uni tType::Number); 2178 return CSSPrimitiveValue::create(style.opacity(), CSSPrimitiveValue::Uni tType::Number);
2171 case CSSPropertyOrphans: 2179 case CSSPropertyOrphans:
2172 return CSSPrimitiveValue::create(style.orphans(), CSSPrimitiveValue::Uni tType::Number); 2180 return CSSPrimitiveValue::create(style.orphans(), CSSPrimitiveValue::Uni tType::Number);
2173 case CSSPropertyOutlineColor: 2181 case CSSPropertyOutlineColor:
2174 return allowVisitedStyle ? CSSColorValue::create(style.visitedDependentC olor(CSSPropertyOutlineColor).rgb()) : currentColorOrValidColor(style, style.out lineColor()); 2182 return allowVisitedStyle ? CSSColorValue::create(style.visitedDependentC olor(CSSPropertyOutlineColor).rgb()) : currentColorOrValidColor(style, style.out lineColor());
2175 case CSSPropertyOutlineOffset: 2183 case CSSPropertyOutlineOffset:
2176 return zoomAdjustedPixelValue(style.outlineOffset(), style); 2184 return zoomAdjustedPixelValue(style.outlineOffset(), style);
2177 case CSSPropertyOutlineStyle: 2185 case CSSPropertyOutlineStyle:
2178 if (style.outlineStyleIsAuto()) 2186 if (style.outlineStyleIsAuto())
2179 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); 2187 return CSSIdentifierValue::create(CSSValueAuto);
2180 return CSSPrimitiveValue::create(style.outlineStyle()); 2188 return CSSIdentifierValue::create(style.outlineStyle());
2181 case CSSPropertyOutlineWidth: 2189 case CSSPropertyOutlineWidth:
2182 return zoomAdjustedPixelValue(style.outlineWidth(), style); 2190 return zoomAdjustedPixelValue(style.outlineWidth(), style);
2183 case CSSPropertyOverflow: 2191 case CSSPropertyOverflow:
2184 return CSSPrimitiveValue::create(max(style.overflowX(), style.overflowY( ))); 2192 return CSSIdentifierValue::create(max(style.overflowX(), style.overflowY ()));
2185 case CSSPropertyOverflowAnchor: 2193 case CSSPropertyOverflowAnchor:
2186 return CSSPrimitiveValue::create(style.overflowAnchor()); 2194 return CSSIdentifierValue::create(style.overflowAnchor());
2187 case CSSPropertyOverflowWrap: 2195 case CSSPropertyOverflowWrap:
2188 return CSSPrimitiveValue::create(style.overflowWrap()); 2196 return CSSIdentifierValue::create(style.overflowWrap());
2189 case CSSPropertyOverflowX: 2197 case CSSPropertyOverflowX:
2190 return CSSPrimitiveValue::create(style.overflowX()); 2198 return CSSIdentifierValue::create(style.overflowX());
2191 case CSSPropertyOverflowY: 2199 case CSSPropertyOverflowY:
2192 return CSSPrimitiveValue::create(style.overflowY()); 2200 return CSSIdentifierValue::create(style.overflowY());
2193 case CSSPropertyPaddingTop: { 2201 case CSSPropertyPaddingTop: {
2194 Length paddingTop = style.paddingTop(); 2202 Length paddingTop = style.paddingTop();
2195 if (paddingTop.isFixed() || !layoutObject || !layoutObject->isBox()) 2203 if (paddingTop.isFixed() || !layoutObject || !layoutObject->isBox())
2196 return zoomAdjustedPixelValueForLength(paddingTop, style); 2204 return zoomAdjustedPixelValueForLength(paddingTop, style);
2197 return zoomAdjustedPixelValue(toLayoutBox(layoutObject)->computedCSSPadd ingTop(), style); 2205 return zoomAdjustedPixelValue(toLayoutBox(layoutObject)->computedCSSPadd ingTop(), style);
2198 } 2206 }
2199 case CSSPropertyPaddingRight: { 2207 case CSSPropertyPaddingRight: {
2200 Length paddingRight = style.paddingRight(); 2208 Length paddingRight = style.paddingRight();
2201 if (paddingRight.isFixed() || !layoutObject || !layoutObject->isBox()) 2209 if (paddingRight.isFixed() || !layoutObject || !layoutObject->isBox())
2202 return zoomAdjustedPixelValueForLength(paddingRight, style); 2210 return zoomAdjustedPixelValueForLength(paddingRight, style);
2203 return zoomAdjustedPixelValue(toLayoutBox(layoutObject)->computedCSSPadd ingRight(), style); 2211 return zoomAdjustedPixelValue(toLayoutBox(layoutObject)->computedCSSPadd ingRight(), style);
2204 } 2212 }
2205 case CSSPropertyPaddingBottom: { 2213 case CSSPropertyPaddingBottom: {
2206 Length paddingBottom = style.paddingBottom(); 2214 Length paddingBottom = style.paddingBottom();
2207 if (paddingBottom.isFixed() || !layoutObject || !layoutObject->isBox()) 2215 if (paddingBottom.isFixed() || !layoutObject || !layoutObject->isBox())
2208 return zoomAdjustedPixelValueForLength(paddingBottom, style); 2216 return zoomAdjustedPixelValueForLength(paddingBottom, style);
2209 return zoomAdjustedPixelValue(toLayoutBox(layoutObject)->computedCSSPadd ingBottom(), style); 2217 return zoomAdjustedPixelValue(toLayoutBox(layoutObject)->computedCSSPadd ingBottom(), style);
2210 } 2218 }
2211 case CSSPropertyPaddingLeft: { 2219 case CSSPropertyPaddingLeft: {
2212 Length paddingLeft = style.paddingLeft(); 2220 Length paddingLeft = style.paddingLeft();
2213 if (paddingLeft.isFixed() || !layoutObject || !layoutObject->isBox()) 2221 if (paddingLeft.isFixed() || !layoutObject || !layoutObject->isBox())
2214 return zoomAdjustedPixelValueForLength(paddingLeft, style); 2222 return zoomAdjustedPixelValueForLength(paddingLeft, style);
2215 return zoomAdjustedPixelValue(toLayoutBox(layoutObject)->computedCSSPadd ingLeft(), style); 2223 return zoomAdjustedPixelValue(toLayoutBox(layoutObject)->computedCSSPadd ingLeft(), style);
2216 } 2224 }
2217 case CSSPropertyBreakAfter: 2225 case CSSPropertyBreakAfter:
2218 return CSSPrimitiveValue::create(style.breakAfter()); 2226 return CSSIdentifierValue::create(style.breakAfter());
2219 case CSSPropertyBreakBefore: 2227 case CSSPropertyBreakBefore:
2220 return CSSPrimitiveValue::create(style.breakBefore()); 2228 return CSSIdentifierValue::create(style.breakBefore());
2221 case CSSPropertyBreakInside: 2229 case CSSPropertyBreakInside:
2222 return CSSPrimitiveValue::create(style.breakInside()); 2230 return CSSIdentifierValue::create(style.breakInside());
2223 case CSSPropertyPageBreakAfter: 2231 case CSSPropertyPageBreakAfter:
2224 return CSSPrimitiveValue::create(mapToPageBreakValue(style.breakAfter()) ); 2232 return CSSIdentifierValue::create(mapToPageBreakValue(style.breakAfter() ));
2225 case CSSPropertyPageBreakBefore: 2233 case CSSPropertyPageBreakBefore:
2226 return CSSPrimitiveValue::create(mapToPageBreakValue(style.breakBefore() )); 2234 return CSSIdentifierValue::create(mapToPageBreakValue(style.breakBefore( )));
2227 case CSSPropertyPageBreakInside: 2235 case CSSPropertyPageBreakInside:
2228 return CSSPrimitiveValue::create(mapToPageBreakValue(style.breakInside() )); 2236 return CSSIdentifierValue::create(mapToPageBreakValue(style.breakInside( )));
2229 case CSSPropertyPosition: 2237 case CSSPropertyPosition:
2230 return CSSPrimitiveValue::create(style.position()); 2238 return CSSIdentifierValue::create(style.position());
2231 case CSSPropertyQuotes: 2239 case CSSPropertyQuotes:
2232 if (!style.quotes()) { 2240 if (!style.quotes()) {
2233 // TODO(ramya.v): We should return the quote values that we're actua lly using. 2241 // TODO(ramya.v): We should return the quote values that we're actua lly using.
2234 return nullptr; 2242 return nullptr;
2235 } 2243 }
2236 if (style.quotes()->size()) { 2244 if (style.quotes()->size()) {
2237 CSSValueList* list = CSSValueList::createSpaceSeparated(); 2245 CSSValueList* list = CSSValueList::createSpaceSeparated();
2238 for (int i = 0; i < style.quotes()->size(); i++) { 2246 for (int i = 0; i < style.quotes()->size(); i++) {
2239 list->append(*CSSStringValue::create(style.quotes()->getOpenQuot e(i))); 2247 list->append(*CSSStringValue::create(style.quotes()->getOpenQuot e(i)));
2240 list->append(*CSSStringValue::create(style.quotes()->getCloseQuo te(i))); 2248 list->append(*CSSStringValue::create(style.quotes()->getCloseQuo te(i)));
2241 } 2249 }
2242 return list; 2250 return list;
2243 } 2251 }
2244 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 2252 return CSSIdentifierValue::create(CSSValueNone);
2245 case CSSPropertyRight: 2253 case CSSPropertyRight:
2246 return valueForPositionOffset(style, CSSPropertyRight, layoutObject); 2254 return valueForPositionOffset(style, CSSPropertyRight, layoutObject);
2247 case CSSPropertyWebkitRubyPosition: 2255 case CSSPropertyWebkitRubyPosition:
2248 return CSSPrimitiveValue::create(style.getRubyPosition()); 2256 return CSSIdentifierValue::create(style.getRubyPosition());
2249 case CSSPropertyScrollBehavior: 2257 case CSSPropertyScrollBehavior:
2250 return CSSPrimitiveValue::create(style.getScrollBehavior()); 2258 return CSSIdentifierValue::create(style.getScrollBehavior());
2251 case CSSPropertyTableLayout: 2259 case CSSPropertyTableLayout:
2252 return CSSPrimitiveValue::create(style.tableLayout()); 2260 return CSSIdentifierValue::create(style.tableLayout());
2253 case CSSPropertyTextAlign: 2261 case CSSPropertyTextAlign:
2254 return CSSPrimitiveValue::create(style.textAlign()); 2262 return CSSIdentifierValue::create(style.textAlign());
2255 case CSSPropertyTextAlignLast: 2263 case CSSPropertyTextAlignLast:
2256 return CSSPrimitiveValue::create(style.getTextAlignLast()); 2264 return CSSIdentifierValue::create(style.getTextAlignLast());
2257 case CSSPropertyTextDecoration: 2265 case CSSPropertyTextDecoration:
2258 if (RuntimeEnabledFeatures::css3TextDecorationsEnabled()) 2266 if (RuntimeEnabledFeatures::css3TextDecorationsEnabled())
2259 return valuesForShorthandProperty(textDecorationShorthand(), style, layoutObject, styledNode, allowVisitedStyle); 2267 return valuesForShorthandProperty(textDecorationShorthand(), style, layoutObject, styledNode, allowVisitedStyle);
2260 // Fall through. 2268 // Fall through.
2261 case CSSPropertyTextDecorationLine: 2269 case CSSPropertyTextDecorationLine:
2262 return renderTextDecorationFlagsToCSSValue(style.getTextDecoration()); 2270 return renderTextDecorationFlagsToCSSValue(style.getTextDecoration());
2263 case CSSPropertyTextDecorationStyle: 2271 case CSSPropertyTextDecorationStyle:
2264 return valueForTextDecorationStyle(style.getTextDecorationStyle()); 2272 return valueForTextDecorationStyle(style.getTextDecorationStyle());
2265 case CSSPropertyTextDecorationColor: 2273 case CSSPropertyTextDecorationColor:
2266 return currentColorOrValidColor(style, style.textDecorationColor()); 2274 return currentColorOrValidColor(style, style.textDecorationColor());
2267 case CSSPropertyTextJustify: 2275 case CSSPropertyTextJustify:
2268 return CSSPrimitiveValue::create(style.getTextJustify()); 2276 return CSSIdentifierValue::create(style.getTextJustify());
2269 case CSSPropertyTextUnderlinePosition: 2277 case CSSPropertyTextUnderlinePosition:
2270 return CSSPrimitiveValue::create(style.getTextUnderlinePosition()); 2278 return CSSIdentifierValue::create(style.getTextUnderlinePosition());
2271 case CSSPropertyWebkitTextDecorationsInEffect: 2279 case CSSPropertyWebkitTextDecorationsInEffect:
2272 return renderTextDecorationFlagsToCSSValue(style.textDecorationsInEffect ()); 2280 return renderTextDecorationFlagsToCSSValue(style.textDecorationsInEffect ());
2273 case CSSPropertyWebkitTextFillColor: 2281 case CSSPropertyWebkitTextFillColor:
2274 return currentColorOrValidColor(style, style.textFillColor()); 2282 return currentColorOrValidColor(style, style.textFillColor());
2275 case CSSPropertyWebkitTextEmphasisColor: 2283 case CSSPropertyWebkitTextEmphasisColor:
2276 return currentColorOrValidColor(style, style.textEmphasisColor()); 2284 return currentColorOrValidColor(style, style.textEmphasisColor());
2277 case CSSPropertyWebkitTextEmphasisPosition: 2285 case CSSPropertyWebkitTextEmphasisPosition:
2278 return CSSPrimitiveValue::create(style.getTextEmphasisPosition()); 2286 return CSSIdentifierValue::create(style.getTextEmphasisPosition());
2279 case CSSPropertyWebkitTextEmphasisStyle: 2287 case CSSPropertyWebkitTextEmphasisStyle:
2280 switch (style.getTextEmphasisMark()) { 2288 switch (style.getTextEmphasisMark()) {
2281 case TextEmphasisMarkNone: 2289 case TextEmphasisMarkNone:
2282 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 2290 return CSSIdentifierValue::create(CSSValueNone);
2283 case TextEmphasisMarkCustom: 2291 case TextEmphasisMarkCustom:
2284 return CSSStringValue::create(style.textEmphasisCustomMark()); 2292 return CSSStringValue::create(style.textEmphasisCustomMark());
2285 case TextEmphasisMarkAuto: 2293 case TextEmphasisMarkAuto:
2286 ASSERT_NOT_REACHED(); 2294 ASSERT_NOT_REACHED();
2287 // Fall through 2295 // Fall through
2288 case TextEmphasisMarkDot: 2296 case TextEmphasisMarkDot:
2289 case TextEmphasisMarkCircle: 2297 case TextEmphasisMarkCircle:
2290 case TextEmphasisMarkDoubleCircle: 2298 case TextEmphasisMarkDoubleCircle:
2291 case TextEmphasisMarkTriangle: 2299 case TextEmphasisMarkTriangle:
2292 case TextEmphasisMarkSesame: { 2300 case TextEmphasisMarkSesame: {
2293 CSSValueList* list = CSSValueList::createSpaceSeparated(); 2301 CSSValueList* list = CSSValueList::createSpaceSeparated();
2294 list->append(*CSSPrimitiveValue::create(style.getTextEmphasisFill()) ); 2302 list->append(*CSSIdentifierValue::create(style.getTextEmphasisFill() ));
2295 list->append(*CSSPrimitiveValue::create(style.getTextEmphasisMark()) ); 2303 list->append(*CSSIdentifierValue::create(style.getTextEmphasisMark() ));
2296 return list; 2304 return list;
2297 } 2305 }
2298 } 2306 }
2299 case CSSPropertyTextIndent: { 2307 case CSSPropertyTextIndent: {
2300 CSSValueList* list = CSSValueList::createSpaceSeparated(); 2308 CSSValueList* list = CSSValueList::createSpaceSeparated();
2301 list->append(*zoomAdjustedPixelValueForLength(style.textIndent(), style) ); 2309 list->append(*zoomAdjustedPixelValueForLength(style.textIndent(), style) );
2302 if (RuntimeEnabledFeatures::css3TextEnabled() && (style.getTextIndentLin e() == TextIndentEachLine || style.getTextIndentType() == TextIndentHanging)) { 2310 if (RuntimeEnabledFeatures::css3TextEnabled() && (style.getTextIndentLin e() == TextIndentEachLine || style.getTextIndentType() == TextIndentHanging)) {
2303 if (style.getTextIndentLine() == TextIndentEachLine) 2311 if (style.getTextIndentLine() == TextIndentEachLine)
2304 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueEachLi ne)); 2312 list->append(*CSSIdentifierValue::create(CSSValueEachLine));
2305 if (style.getTextIndentType() == TextIndentHanging) 2313 if (style.getTextIndentType() == TextIndentHanging)
2306 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueHangin g)); 2314 list->append(*CSSIdentifierValue::create(CSSValueHanging));
2307 } 2315 }
2308 return list; 2316 return list;
2309 } 2317 }
2310 case CSSPropertyTextShadow: 2318 case CSSPropertyTextShadow:
2311 return valueForShadowList(style.textShadow(), style, false); 2319 return valueForShadowList(style.textShadow(), style, false);
2312 case CSSPropertyTextRendering: 2320 case CSSPropertyTextRendering:
2313 return CSSPrimitiveValue::create(style.getFontDescription().textRenderin g()); 2321 return CSSIdentifierValue::create(style.getFontDescription().textRenderi ng());
2314 case CSSPropertyTextOverflow: 2322 case CSSPropertyTextOverflow:
2315 if (style.getTextOverflow()) 2323 if (style.getTextOverflow())
2316 return CSSPrimitiveValue::createIdentifier(CSSValueEllipsis); 2324 return CSSIdentifierValue::create(CSSValueEllipsis);
2317 return CSSPrimitiveValue::createIdentifier(CSSValueClip); 2325 return CSSIdentifierValue::create(CSSValueClip);
2318 case CSSPropertyWebkitTextSecurity: 2326 case CSSPropertyWebkitTextSecurity:
2319 return CSSPrimitiveValue::create(style.textSecurity()); 2327 return CSSIdentifierValue::create(style.textSecurity());
2320 case CSSPropertyWebkitTextStrokeColor: 2328 case CSSPropertyWebkitTextStrokeColor:
2321 return currentColorOrValidColor(style, style.textStrokeColor()); 2329 return currentColorOrValidColor(style, style.textStrokeColor());
2322 case CSSPropertyWebkitTextStrokeWidth: 2330 case CSSPropertyWebkitTextStrokeWidth:
2323 return zoomAdjustedPixelValue(style.textStrokeWidth(), style); 2331 return zoomAdjustedPixelValue(style.textStrokeWidth(), style);
2324 case CSSPropertyTextTransform: 2332 case CSSPropertyTextTransform:
2325 return CSSPrimitiveValue::create(style.textTransform()); 2333 return CSSIdentifierValue::create(style.textTransform());
2326 case CSSPropertyTop: 2334 case CSSPropertyTop:
2327 return valueForPositionOffset(style, CSSPropertyTop, layoutObject); 2335 return valueForPositionOffset(style, CSSPropertyTop, layoutObject);
2328 case CSSPropertyTouchAction: 2336 case CSSPropertyTouchAction:
2329 return touchActionFlagsToCSSValue(style.getTouchAction()); 2337 return touchActionFlagsToCSSValue(style.getTouchAction());
2330 case CSSPropertyUnicodeBidi: 2338 case CSSPropertyUnicodeBidi:
2331 return CSSPrimitiveValue::create(style.unicodeBidi()); 2339 return CSSIdentifierValue::create(style.unicodeBidi());
2332 case CSSPropertyVerticalAlign: 2340 case CSSPropertyVerticalAlign:
2333 switch (style.verticalAlign()) { 2341 switch (style.verticalAlign()) {
2334 case VerticalAlignBaseline: 2342 case VerticalAlignBaseline:
2335 return CSSPrimitiveValue::createIdentifier(CSSValueBaseline); 2343 return CSSIdentifierValue::create(CSSValueBaseline);
2336 case VerticalAlignMiddle: 2344 case VerticalAlignMiddle:
2337 return CSSPrimitiveValue::createIdentifier(CSSValueMiddle); 2345 return CSSIdentifierValue::create(CSSValueMiddle);
2338 case VerticalAlignSub: 2346 case VerticalAlignSub:
2339 return CSSPrimitiveValue::createIdentifier(CSSValueSub); 2347 return CSSIdentifierValue::create(CSSValueSub);
2340 case VerticalAlignSuper: 2348 case VerticalAlignSuper:
2341 return CSSPrimitiveValue::createIdentifier(CSSValueSuper); 2349 return CSSIdentifierValue::create(CSSValueSuper);
2342 case VerticalAlignTextTop: 2350 case VerticalAlignTextTop:
2343 return CSSPrimitiveValue::createIdentifier(CSSValueTextTop); 2351 return CSSIdentifierValue::create(CSSValueTextTop);
2344 case VerticalAlignTextBottom: 2352 case VerticalAlignTextBottom:
2345 return CSSPrimitiveValue::createIdentifier(CSSValueTextBottom); 2353 return CSSIdentifierValue::create(CSSValueTextBottom);
2346 case VerticalAlignTop: 2354 case VerticalAlignTop:
2347 return CSSPrimitiveValue::createIdentifier(CSSValueTop); 2355 return CSSIdentifierValue::create(CSSValueTop);
2348 case VerticalAlignBottom: 2356 case VerticalAlignBottom:
2349 return CSSPrimitiveValue::createIdentifier(CSSValueBottom); 2357 return CSSIdentifierValue::create(CSSValueBottom);
2350 case VerticalAlignBaselineMiddle: 2358 case VerticalAlignBaselineMiddle:
2351 return CSSPrimitiveValue::createIdentifier(CSSValueWebkitBaselineMid dle); 2359 return CSSIdentifierValue::create(CSSValueWebkitBaselineMiddle);
2352 case VerticalAlignLength: 2360 case VerticalAlignLength:
2353 return zoomAdjustedPixelValueForLength(style.getVerticalAlignLength( ), style); 2361 return zoomAdjustedPixelValueForLength(style.getVerticalAlignLength( ), style);
2354 } 2362 }
2355 ASSERT_NOT_REACHED(); 2363 ASSERT_NOT_REACHED();
2356 return nullptr; 2364 return nullptr;
2357 case CSSPropertyVisibility: 2365 case CSSPropertyVisibility:
2358 return CSSPrimitiveValue::create(style.visibility()); 2366 return CSSIdentifierValue::create(style.visibility());
2359 case CSSPropertyWhiteSpace: 2367 case CSSPropertyWhiteSpace:
2360 return CSSPrimitiveValue::create(style.whiteSpace()); 2368 return CSSIdentifierValue::create(style.whiteSpace());
2361 case CSSPropertyWidows: 2369 case CSSPropertyWidows:
2362 return CSSPrimitiveValue::create(style.widows(), CSSPrimitiveValue::Unit Type::Number); 2370 return CSSPrimitiveValue::create(style.widows(), CSSPrimitiveValue::Unit Type::Number);
2363 case CSSPropertyWidth: 2371 case CSSPropertyWidth:
2364 if (layoutObject) { 2372 if (layoutObject) {
2365 // According to http://www.w3.org/TR/CSS2/visudet.html#the-width-pro perty, 2373 // According to http://www.w3.org/TR/CSS2/visudet.html#the-width-pro perty,
2366 // the "width" property does not apply for non-atomic inline element s. 2374 // the "width" property does not apply for non-atomic inline element s.
2367 if (!layoutObject->isAtomicInlineLevel() && layoutObject->isInline() ) 2375 if (!layoutObject->isAtomicInlineLevel() && layoutObject->isInline() )
2368 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); 2376 return CSSIdentifierValue::create(CSSValueAuto);
2369 return zoomAdjustedPixelValue(sizingBox(layoutObject).width(), style ); 2377 return zoomAdjustedPixelValue(sizingBox(layoutObject).width(), style );
2370 } 2378 }
2371 return zoomAdjustedPixelValueForLength(style.width(), style); 2379 return zoomAdjustedPixelValueForLength(style.width(), style);
2372 case CSSPropertyWillChange: 2380 case CSSPropertyWillChange:
2373 return valueForWillChange(style.willChangeProperties(), style.willChange Contents(), style.willChangeScrollPosition()); 2381 return valueForWillChange(style.willChangeProperties(), style.willChange Contents(), style.willChangeScrollPosition());
2374 case CSSPropertyWordBreak: 2382 case CSSPropertyWordBreak:
2375 return CSSPrimitiveValue::create(style.wordBreak()); 2383 return CSSIdentifierValue::create(style.wordBreak());
2376 case CSSPropertyWordSpacing: 2384 case CSSPropertyWordSpacing:
2377 return zoomAdjustedPixelValue(style.wordSpacing(), style); 2385 return zoomAdjustedPixelValue(style.wordSpacing(), style);
2378 case CSSPropertyWordWrap: 2386 case CSSPropertyWordWrap:
2379 return CSSPrimitiveValue::create(style.overflowWrap()); 2387 return CSSIdentifierValue::create(style.overflowWrap());
2380 case CSSPropertyWebkitLineBreak: 2388 case CSSPropertyWebkitLineBreak:
2381 return CSSPrimitiveValue::create(style.getLineBreak()); 2389 return CSSIdentifierValue::create(style.getLineBreak());
2382 case CSSPropertyResize: 2390 case CSSPropertyResize:
2383 return CSSPrimitiveValue::create(style.resize()); 2391 return CSSIdentifierValue::create(style.resize());
2384 case CSSPropertyFontKerning: 2392 case CSSPropertyFontKerning:
2385 return CSSPrimitiveValue::create(style.getFontDescription().getKerning() ); 2393 return CSSIdentifierValue::create(style.getFontDescription().getKerning( ));
2386 case CSSPropertyWebkitFontSmoothing: 2394 case CSSPropertyWebkitFontSmoothing:
2387 return CSSPrimitiveValue::create(style.getFontDescription().fontSmoothin g()); 2395 return CSSIdentifierValue::create(style.getFontDescription().fontSmoothi ng());
2388 case CSSPropertyFontVariantLigatures: 2396 case CSSPropertyFontVariantLigatures:
2389 return valueForFontVariantLigatures(style); 2397 return valueForFontVariantLigatures(style);
2390 case CSSPropertyFontVariantCaps: 2398 case CSSPropertyFontVariantCaps:
2391 return valueForFontVariantCaps(style); 2399 return valueForFontVariantCaps(style);
2392 case CSSPropertyFontVariantNumeric: 2400 case CSSPropertyFontVariantNumeric:
2393 return valueForFontVariantNumeric(style); 2401 return valueForFontVariantNumeric(style);
2394 case CSSPropertyZIndex: 2402 case CSSPropertyZIndex:
2395 if (style.hasAutoZIndex()) 2403 if (style.hasAutoZIndex())
2396 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); 2404 return CSSIdentifierValue::create(CSSValueAuto);
2397 return CSSPrimitiveValue::create(style.zIndex(), CSSPrimitiveValue::Unit Type::Integer); 2405 return CSSPrimitiveValue::create(style.zIndex(), CSSPrimitiveValue::Unit Type::Integer);
2398 case CSSPropertyZoom: 2406 case CSSPropertyZoom:
2399 return CSSPrimitiveValue::create(style.zoom(), CSSPrimitiveValue::UnitTy pe::Number); 2407 return CSSPrimitiveValue::create(style.zoom(), CSSPrimitiveValue::UnitTy pe::Number);
2400 case CSSPropertyBoxSizing: 2408 case CSSPropertyBoxSizing:
2401 if (style.boxSizing() == BoxSizingContentBox) 2409 if (style.boxSizing() == BoxSizingContentBox)
2402 return CSSPrimitiveValue::createIdentifier(CSSValueContentBox); 2410 return CSSIdentifierValue::create(CSSValueContentBox);
2403 return CSSPrimitiveValue::createIdentifier(CSSValueBorderBox); 2411 return CSSIdentifierValue::create(CSSValueBorderBox);
2404 case CSSPropertyWebkitAppRegion: 2412 case CSSPropertyWebkitAppRegion:
2405 return CSSPrimitiveValue::createIdentifier(style.getDraggableRegionMode( ) == DraggableRegionDrag ? CSSValueDrag : CSSValueNoDrag); 2413 return CSSIdentifierValue::create(style.getDraggableRegionMode() == Drag gableRegionDrag ? CSSValueDrag : CSSValueNoDrag);
2406 case CSSPropertyAnimationDelay: 2414 case CSSPropertyAnimationDelay:
2407 return valueForAnimationDelay(style.animations()); 2415 return valueForAnimationDelay(style.animations());
2408 case CSSPropertyAnimationDirection: { 2416 case CSSPropertyAnimationDirection: {
2409 CSSValueList* list = CSSValueList::createCommaSeparated(); 2417 CSSValueList* list = CSSValueList::createCommaSeparated();
2410 const CSSAnimationData* animationData = style.animations(); 2418 const CSSAnimationData* animationData = style.animations();
2411 if (animationData) { 2419 if (animationData) {
2412 for (size_t i = 0; i < animationData->directionList().size(); ++i) 2420 for (size_t i = 0; i < animationData->directionList().size(); ++i)
2413 list->append(*valueForAnimationDirection(animationData->directio nList()[i])); 2421 list->append(*valueForAnimationDirection(animationData->directio nList()[i]));
2414 } else { 2422 } else {
2415 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueNormal)); 2423 list->append(*CSSIdentifierValue::create(CSSValueNormal));
2416 } 2424 }
2417 return list; 2425 return list;
2418 } 2426 }
2419 case CSSPropertyAnimationDuration: 2427 case CSSPropertyAnimationDuration:
2420 return valueForAnimationDuration(style.animations()); 2428 return valueForAnimationDuration(style.animations());
2421 case CSSPropertyAnimationFillMode: { 2429 case CSSPropertyAnimationFillMode: {
2422 CSSValueList* list = CSSValueList::createCommaSeparated(); 2430 CSSValueList* list = CSSValueList::createCommaSeparated();
2423 const CSSAnimationData* animationData = style.animations(); 2431 const CSSAnimationData* animationData = style.animations();
2424 if (animationData) { 2432 if (animationData) {
2425 for (size_t i = 0; i < animationData->fillModeList().size(); ++i) 2433 for (size_t i = 0; i < animationData->fillModeList().size(); ++i)
2426 list->append(*valueForAnimationFillMode(animationData->fillModeL ist()[i])); 2434 list->append(*valueForAnimationFillMode(animationData->fillModeL ist()[i]));
2427 } else { 2435 } else {
2428 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueNone)); 2436 list->append(*CSSIdentifierValue::create(CSSValueNone));
2429 } 2437 }
2430 return list; 2438 return list;
2431 } 2439 }
2432 case CSSPropertyAnimationIterationCount: { 2440 case CSSPropertyAnimationIterationCount: {
2433 CSSValueList* list = CSSValueList::createCommaSeparated(); 2441 CSSValueList* list = CSSValueList::createCommaSeparated();
2434 const CSSAnimationData* animationData = style.animations(); 2442 const CSSAnimationData* animationData = style.animations();
2435 if (animationData) { 2443 if (animationData) {
2436 for (size_t i = 0; i < animationData->iterationCountList().size(); + +i) 2444 for (size_t i = 0; i < animationData->iterationCountList().size(); + +i)
2437 list->append(*valueForAnimationIterationCount(animationData->ite rationCountList()[i])); 2445 list->append(*valueForAnimationIterationCount(animationData->ite rationCountList()[i]));
2438 } else { 2446 } else {
2439 list->append(*CSSPrimitiveValue::create(CSSAnimationData::initialIte rationCount(), CSSPrimitiveValue::UnitType::Number)); 2447 list->append(*CSSPrimitiveValue::create(CSSAnimationData::initialIte rationCount(), CSSPrimitiveValue::UnitType::Number));
2440 } 2448 }
2441 return list; 2449 return list;
2442 } 2450 }
2443 case CSSPropertyAnimationName: { 2451 case CSSPropertyAnimationName: {
2444 CSSValueList* list = CSSValueList::createCommaSeparated(); 2452 CSSValueList* list = CSSValueList::createCommaSeparated();
2445 const CSSAnimationData* animationData = style.animations(); 2453 const CSSAnimationData* animationData = style.animations();
2446 if (animationData) { 2454 if (animationData) {
2447 for (size_t i = 0; i < animationData->nameList().size(); ++i) 2455 for (size_t i = 0; i < animationData->nameList().size(); ++i)
2448 list->append(*CSSCustomIdentValue::create(animationData->nameLis t()[i])); 2456 list->append(*CSSCustomIdentValue::create(animationData->nameLis t()[i]));
2449 } else { 2457 } else {
2450 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueNone)); 2458 list->append(*CSSIdentifierValue::create(CSSValueNone));
2451 } 2459 }
2452 return list; 2460 return list;
2453 } 2461 }
2454 case CSSPropertyAnimationPlayState: { 2462 case CSSPropertyAnimationPlayState: {
2455 CSSValueList* list = CSSValueList::createCommaSeparated(); 2463 CSSValueList* list = CSSValueList::createCommaSeparated();
2456 const CSSAnimationData* animationData = style.animations(); 2464 const CSSAnimationData* animationData = style.animations();
2457 if (animationData) { 2465 if (animationData) {
2458 for (size_t i = 0; i < animationData->playStateList().size(); ++i) 2466 for (size_t i = 0; i < animationData->playStateList().size(); ++i)
2459 list->append(*valueForAnimationPlayState(animationData->playStat eList()[i])); 2467 list->append(*valueForAnimationPlayState(animationData->playStat eList()[i]));
2460 } else { 2468 } else {
2461 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueRunning)); 2469 list->append(*CSSIdentifierValue::create(CSSValueRunning));
2462 } 2470 }
2463 return list; 2471 return list;
2464 } 2472 }
2465 case CSSPropertyAnimationTimingFunction: 2473 case CSSPropertyAnimationTimingFunction:
2466 return valueForAnimationTimingFunction(style.animations()); 2474 return valueForAnimationTimingFunction(style.animations());
2467 case CSSPropertyAnimation: { 2475 case CSSPropertyAnimation: {
2468 const CSSAnimationData* animationData = style.animations(); 2476 const CSSAnimationData* animationData = style.animations();
2469 if (animationData) { 2477 if (animationData) {
2470 CSSValueList* animationsList = CSSValueList::createCommaSeparated(); 2478 CSSValueList* animationsList = CSSValueList::createCommaSeparated();
2471 for (size_t i = 0; i < animationData->nameList().size(); ++i) { 2479 for (size_t i = 0; i < animationData->nameList().size(); ++i) {
2472 CSSValueList* list = CSSValueList::createSpaceSeparated(); 2480 CSSValueList* list = CSSValueList::createSpaceSeparated();
2473 list->append(*CSSCustomIdentValue::create(animationData->nameLis t()[i])); 2481 list->append(*CSSCustomIdentValue::create(animationData->nameLis t()[i]));
2474 list->append(*CSSPrimitiveValue::create(CSSTimingData::getRepeat ed(animationData->durationList(), i), CSSPrimitiveValue::UnitType::Seconds)); 2482 list->append(*CSSPrimitiveValue::create(CSSTimingData::getRepeat ed(animationData->durationList(), i), CSSPrimitiveValue::UnitType::Seconds));
2475 list->append(*createTimingFunctionValue(CSSTimingData::getRepeat ed(animationData->timingFunctionList(), i).get())); 2483 list->append(*createTimingFunctionValue(CSSTimingData::getRepeat ed(animationData->timingFunctionList(), i).get()));
2476 list->append(*CSSPrimitiveValue::create(CSSTimingData::getRepeat ed(animationData->delayList(), i), CSSPrimitiveValue::UnitType::Seconds)); 2484 list->append(*CSSPrimitiveValue::create(CSSTimingData::getRepeat ed(animationData->delayList(), i), CSSPrimitiveValue::UnitType::Seconds));
2477 list->append(*valueForAnimationIterationCount(CSSTimingData::get Repeated(animationData->iterationCountList(), i))); 2485 list->append(*valueForAnimationIterationCount(CSSTimingData::get Repeated(animationData->iterationCountList(), i)));
2478 list->append(*valueForAnimationDirection(CSSTimingData::getRepea ted(animationData->directionList(), i))); 2486 list->append(*valueForAnimationDirection(CSSTimingData::getRepea ted(animationData->directionList(), i)));
2479 list->append(*valueForAnimationFillMode(CSSTimingData::getRepeat ed(animationData->fillModeList(), i))); 2487 list->append(*valueForAnimationFillMode(CSSTimingData::getRepeat ed(animationData->fillModeList(), i)));
2480 list->append(*valueForAnimationPlayState(CSSTimingData::getRepea ted(animationData->playStateList(), i))); 2488 list->append(*valueForAnimationPlayState(CSSTimingData::getRepea ted(animationData->playStateList(), i)));
2481 animationsList->append(*list); 2489 animationsList->append(*list);
2482 } 2490 }
2483 return animationsList; 2491 return animationsList;
2484 } 2492 }
2485 2493
2486 CSSValueList* list = CSSValueList::createSpaceSeparated(); 2494 CSSValueList* list = CSSValueList::createSpaceSeparated();
2487 // animation-name default value. 2495 // animation-name default value.
2488 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueNone)); 2496 list->append(*CSSIdentifierValue::create(CSSValueNone));
2489 list->append(*CSSPrimitiveValue::create(CSSAnimationData::initialDuratio n(), CSSPrimitiveValue::UnitType::Seconds)); 2497 list->append(*CSSPrimitiveValue::create(CSSAnimationData::initialDuratio n(), CSSPrimitiveValue::UnitType::Seconds));
2490 list->append(*createTimingFunctionValue(CSSAnimationData::initialTimingF unction().get())); 2498 list->append(*createTimingFunctionValue(CSSAnimationData::initialTimingF unction().get()));
2491 list->append(*CSSPrimitiveValue::create(CSSAnimationData::initialDelay() , CSSPrimitiveValue::UnitType::Seconds)); 2499 list->append(*CSSPrimitiveValue::create(CSSAnimationData::initialDelay() , CSSPrimitiveValue::UnitType::Seconds));
2492 list->append(*CSSPrimitiveValue::create(CSSAnimationData::initialIterati onCount(), CSSPrimitiveValue::UnitType::Number)); 2500 list->append(*CSSPrimitiveValue::create(CSSAnimationData::initialIterati onCount(), CSSPrimitiveValue::UnitType::Number));
2493 list->append(*valueForAnimationDirection(CSSAnimationData::initialDirect ion())); 2501 list->append(*valueForAnimationDirection(CSSAnimationData::initialDirect ion()));
2494 list->append(*valueForAnimationFillMode(CSSAnimationData::initialFillMod e())); 2502 list->append(*valueForAnimationFillMode(CSSAnimationData::initialFillMod e()));
2495 // Initial animation-play-state. 2503 // Initial animation-play-state.
2496 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueRunning)); 2504 list->append(*CSSIdentifierValue::create(CSSValueRunning));
2497 return list; 2505 return list;
2498 } 2506 }
2499 case CSSPropertyWebkitAppearance: 2507 case CSSPropertyWebkitAppearance:
2500 return CSSPrimitiveValue::create(style.appearance()); 2508 return CSSIdentifierValue::create(style.appearance());
2501 case CSSPropertyBackfaceVisibility: 2509 case CSSPropertyBackfaceVisibility:
2502 return CSSPrimitiveValue::createIdentifier((style.backfaceVisibility() = = BackfaceVisibilityHidden) ? CSSValueHidden : CSSValueVisible); 2510 return CSSIdentifierValue::create((style.backfaceVisibility() == Backfac eVisibilityHidden) ? CSSValueHidden : CSSValueVisible);
2503 case CSSPropertyWebkitBorderImage: 2511 case CSSPropertyWebkitBorderImage:
2504 return valueForNinePieceImage(style.borderImage(), style); 2512 return valueForNinePieceImage(style.borderImage(), style);
2505 case CSSPropertyBorderImageOutset: 2513 case CSSPropertyBorderImageOutset:
2506 return valueForNinePieceImageQuad(style.borderImage().outset(), style); 2514 return valueForNinePieceImageQuad(style.borderImage().outset(), style);
2507 case CSSPropertyBorderImageRepeat: 2515 case CSSPropertyBorderImageRepeat:
2508 return valueForNinePieceImageRepeat(style.borderImage()); 2516 return valueForNinePieceImageRepeat(style.borderImage());
2509 case CSSPropertyBorderImageSlice: 2517 case CSSPropertyBorderImageSlice:
2510 return valueForNinePieceImageSlice(style.borderImage()); 2518 return valueForNinePieceImageSlice(style.borderImage());
2511 case CSSPropertyBorderImageWidth: 2519 case CSSPropertyBorderImageWidth:
2512 return valueForNinePieceImageQuad(style.borderImage().borderSlices(), st yle); 2520 return valueForNinePieceImageQuad(style.borderImage().borderSlices(), st yle);
2513 case CSSPropertyWebkitMaskBoxImage: 2521 case CSSPropertyWebkitMaskBoxImage:
2514 return valueForNinePieceImage(style.maskBoxImage(), style); 2522 return valueForNinePieceImage(style.maskBoxImage(), style);
2515 case CSSPropertyWebkitMaskBoxImageOutset: 2523 case CSSPropertyWebkitMaskBoxImageOutset:
2516 return valueForNinePieceImageQuad(style.maskBoxImage().outset(), style); 2524 return valueForNinePieceImageQuad(style.maskBoxImage().outset(), style);
2517 case CSSPropertyWebkitMaskBoxImageRepeat: 2525 case CSSPropertyWebkitMaskBoxImageRepeat:
2518 return valueForNinePieceImageRepeat(style.maskBoxImage()); 2526 return valueForNinePieceImageRepeat(style.maskBoxImage());
2519 case CSSPropertyWebkitMaskBoxImageSlice: 2527 case CSSPropertyWebkitMaskBoxImageSlice:
2520 return valueForNinePieceImageSlice(style.maskBoxImage()); 2528 return valueForNinePieceImageSlice(style.maskBoxImage());
2521 case CSSPropertyWebkitMaskBoxImageWidth: 2529 case CSSPropertyWebkitMaskBoxImageWidth:
2522 return valueForNinePieceImageQuad(style.maskBoxImage().borderSlices(), s tyle); 2530 return valueForNinePieceImageQuad(style.maskBoxImage().borderSlices(), s tyle);
2523 case CSSPropertyWebkitMaskBoxImageSource: 2531 case CSSPropertyWebkitMaskBoxImageSource:
2524 if (style.maskBoxImageSource()) 2532 if (style.maskBoxImageSource())
2525 return style.maskBoxImageSource()->computedCSSValue(); 2533 return style.maskBoxImageSource()->computedCSSValue();
2526 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 2534 return CSSIdentifierValue::create(CSSValueNone);
2527 case CSSPropertyWebkitFontSizeDelta: 2535 case CSSPropertyWebkitFontSizeDelta:
2528 // Not a real style property -- used by the editing engine -- so has no computed value. 2536 // Not a real style property -- used by the editing engine -- so has no computed value.
2529 return nullptr; 2537 return nullptr;
2530 case CSSPropertyWebkitMarginBottomCollapse: 2538 case CSSPropertyWebkitMarginBottomCollapse:
2531 case CSSPropertyWebkitMarginAfterCollapse: 2539 case CSSPropertyWebkitMarginAfterCollapse:
2532 return CSSPrimitiveValue::create(style.marginAfterCollapse()); 2540 return CSSIdentifierValue::create(style.marginAfterCollapse());
2533 case CSSPropertyWebkitMarginTopCollapse: 2541 case CSSPropertyWebkitMarginTopCollapse:
2534 case CSSPropertyWebkitMarginBeforeCollapse: 2542 case CSSPropertyWebkitMarginBeforeCollapse:
2535 return CSSPrimitiveValue::create(style.marginBeforeCollapse()); 2543 return CSSIdentifierValue::create(style.marginBeforeCollapse());
2536 case CSSPropertyPerspective: 2544 case CSSPropertyPerspective:
2537 if (!style.hasPerspective()) 2545 if (!style.hasPerspective())
2538 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 2546 return CSSIdentifierValue::create(CSSValueNone);
2539 return zoomAdjustedPixelValue(style.perspective(), style); 2547 return zoomAdjustedPixelValue(style.perspective(), style);
2540 case CSSPropertyPerspectiveOrigin: { 2548 case CSSPropertyPerspectiveOrigin: {
2541 CSSValueList* list = CSSValueList::createSpaceSeparated(); 2549 CSSValueList* list = CSSValueList::createSpaceSeparated();
2542 if (layoutObject) { 2550 if (layoutObject) {
2543 LayoutRect box; 2551 LayoutRect box;
2544 if (layoutObject->isBox()) 2552 if (layoutObject->isBox())
2545 box = toLayoutBox(layoutObject)->borderBoxRect(); 2553 box = toLayoutBox(layoutObject)->borderBoxRect();
2546 2554
2547 list->append(*zoomAdjustedPixelValue(minimumValueForLength(style.per spectiveOriginX(), box.width()), style)); 2555 list->append(*zoomAdjustedPixelValue(minimumValueForLength(style.per spectiveOriginX(), box.width()), style));
2548 list->append(*zoomAdjustedPixelValue(minimumValueForLength(style.per spectiveOriginY(), box.height()), style)); 2556 list->append(*zoomAdjustedPixelValue(minimumValueForLength(style.per spectiveOriginY(), box.height()), style));
2549 } else { 2557 } else {
2550 list->append(*zoomAdjustedPixelValueForLength(style.perspectiveOrigi nX(), style)); 2558 list->append(*zoomAdjustedPixelValueForLength(style.perspectiveOrigi nX(), style));
2551 list->append(*zoomAdjustedPixelValueForLength(style.perspectiveOrigi nY(), style)); 2559 list->append(*zoomAdjustedPixelValueForLength(style.perspectiveOrigi nY(), style));
2552 } 2560 }
2553 return list; 2561 return list;
2554 } 2562 }
2555 case CSSPropertyWebkitRtlOrdering: 2563 case CSSPropertyWebkitRtlOrdering:
2556 return CSSPrimitiveValue::createIdentifier(style.rtlOrdering() ? CSSValu eVisual : CSSValueLogical); 2564 return CSSIdentifierValue::create(style.rtlOrdering() ? CSSValueVisual : CSSValueLogical);
2557 case CSSPropertyWebkitTapHighlightColor: 2565 case CSSPropertyWebkitTapHighlightColor:
2558 return currentColorOrValidColor(style, style.tapHighlightColor()); 2566 return currentColorOrValidColor(style, style.tapHighlightColor());
2559 case CSSPropertyWebkitUserDrag: 2567 case CSSPropertyWebkitUserDrag:
2560 return CSSPrimitiveValue::create(style.userDrag()); 2568 return CSSIdentifierValue::create(style.userDrag());
2561 case CSSPropertyUserSelect: 2569 case CSSPropertyUserSelect:
2562 return CSSPrimitiveValue::create(style.userSelect()); 2570 return CSSIdentifierValue::create(style.userSelect());
2563 case CSSPropertyBorderBottomLeftRadius: 2571 case CSSPropertyBorderBottomLeftRadius:
2564 return &valueForBorderRadiusCorner(style.borderBottomLeftRadius(), style ); 2572 return &valueForBorderRadiusCorner(style.borderBottomLeftRadius(), style );
2565 case CSSPropertyBorderBottomRightRadius: 2573 case CSSPropertyBorderBottomRightRadius:
2566 return &valueForBorderRadiusCorner(style.borderBottomRightRadius(), styl e); 2574 return &valueForBorderRadiusCorner(style.borderBottomRightRadius(), styl e);
2567 case CSSPropertyBorderTopLeftRadius: 2575 case CSSPropertyBorderTopLeftRadius:
2568 return &valueForBorderRadiusCorner(style.borderTopLeftRadius(), style); 2576 return &valueForBorderRadiusCorner(style.borderTopLeftRadius(), style);
2569 case CSSPropertyBorderTopRightRadius: 2577 case CSSPropertyBorderTopRightRadius:
2570 return &valueForBorderRadiusCorner(style.borderTopRightRadius(), style); 2578 return &valueForBorderRadiusCorner(style.borderTopRightRadius(), style);
2571 case CSSPropertyClip: { 2579 case CSSPropertyClip: {
2572 if (style.hasAutoClip()) 2580 if (style.hasAutoClip())
2573 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); 2581 return CSSIdentifierValue::create(CSSValueAuto);
2574 CSSPrimitiveValue* top = style.clip().top().isAuto() 2582 CSSValue* top = zoomAdjustedPixelValueOrAuto(style.clip().top(), style);
2575 ? CSSPrimitiveValue::createIdentifier(CSSValueAuto) 2583 CSSValue* right = zoomAdjustedPixelValueOrAuto(style.clip().right(), sty le);
2576 : zoomAdjustedPixelValue(style.clip().top().value(), style); 2584 CSSValue* bottom = zoomAdjustedPixelValueOrAuto(style.clip().bottom(), s tyle);
2577 CSSPrimitiveValue* right = style.clip().right().isAuto() 2585 CSSValue* left = zoomAdjustedPixelValueOrAuto(style.clip().left(), style );
2578 ? CSSPrimitiveValue::createIdentifier(CSSValueAuto)
2579 : zoomAdjustedPixelValue(style.clip().right().value(), style);
2580 CSSPrimitiveValue* bottom = style.clip().bottom().isAuto()
2581 ? CSSPrimitiveValue::createIdentifier(CSSValueAuto)
2582 : zoomAdjustedPixelValue(style.clip().bottom().value(), style);
2583 CSSPrimitiveValue* left = style.clip().left().isAuto()
2584 ? CSSPrimitiveValue::createIdentifier(CSSValueAuto)
2585 : zoomAdjustedPixelValue(style.clip().left().value(), style);
2586 return CSSQuadValue::create(top, right, bottom, left, CSSQuadValue::Seri alizeAsRect); 2586 return CSSQuadValue::create(top, right, bottom, left, CSSQuadValue::Seri alizeAsRect);
2587 } 2587 }
2588 case CSSPropertySpeak: 2588 case CSSPropertySpeak:
2589 return CSSPrimitiveValue::create(style.speak()); 2589 return CSSIdentifierValue::create(style.speak());
2590 case CSSPropertyTransform: 2590 case CSSPropertyTransform:
2591 return computedTransform(layoutObject, style); 2591 return computedTransform(layoutObject, style);
2592 case CSSPropertyTransformOrigin: { 2592 case CSSPropertyTransformOrigin: {
2593 CSSValueList* list = CSSValueList::createSpaceSeparated(); 2593 CSSValueList* list = CSSValueList::createSpaceSeparated();
2594 if (layoutObject) { 2594 if (layoutObject) {
2595 LayoutRect box; 2595 LayoutRect box;
2596 if (layoutObject->isBox()) 2596 if (layoutObject->isBox())
2597 box = toLayoutBox(layoutObject)->borderBoxRect(); 2597 box = toLayoutBox(layoutObject)->borderBoxRect();
2598 2598
2599 list->append(*zoomAdjustedPixelValue(minimumValueForLength(style.tra nsformOriginX(), box.width()), style)); 2599 list->append(*zoomAdjustedPixelValue(minimumValueForLength(style.tra nsformOriginX(), box.width()), style));
2600 list->append(*zoomAdjustedPixelValue(minimumValueForLength(style.tra nsformOriginY(), box.height()), style)); 2600 list->append(*zoomAdjustedPixelValue(minimumValueForLength(style.tra nsformOriginY(), box.height()), style));
2601 if (style.transformOriginZ() != 0) 2601 if (style.transformOriginZ() != 0)
2602 list->append(*zoomAdjustedPixelValue(style.transformOriginZ(), s tyle)); 2602 list->append(*zoomAdjustedPixelValue(style.transformOriginZ(), s tyle));
2603 } else { 2603 } else {
2604 list->append(*zoomAdjustedPixelValueForLength(style.transformOriginX (), style)); 2604 list->append(*zoomAdjustedPixelValueForLength(style.transformOriginX (), style));
2605 list->append(*zoomAdjustedPixelValueForLength(style.transformOriginY (), style)); 2605 list->append(*zoomAdjustedPixelValueForLength(style.transformOriginY (), style));
2606 if (style.transformOriginZ() != 0) 2606 if (style.transformOriginZ() != 0)
2607 list->append(*zoomAdjustedPixelValue(style.transformOriginZ(), s tyle)); 2607 list->append(*zoomAdjustedPixelValue(style.transformOriginZ(), s tyle));
2608 } 2608 }
2609 return list; 2609 return list;
2610 } 2610 }
2611 case CSSPropertyTransformStyle: 2611 case CSSPropertyTransformStyle:
2612 return CSSPrimitiveValue::createIdentifier((style.transformStyle3D() == TransformStyle3DPreserve3D) ? CSSValuePreserve3d : CSSValueFlat); 2612 return CSSIdentifierValue::create((style.transformStyle3D() == Transform Style3DPreserve3D) ? CSSValuePreserve3d : CSSValueFlat);
2613 case CSSPropertyTransitionDelay: 2613 case CSSPropertyTransitionDelay:
2614 return valueForAnimationDelay(style.transitions()); 2614 return valueForAnimationDelay(style.transitions());
2615 case CSSPropertyTransitionDuration: 2615 case CSSPropertyTransitionDuration:
2616 return valueForAnimationDuration(style.transitions()); 2616 return valueForAnimationDuration(style.transitions());
2617 case CSSPropertyTransitionProperty: 2617 case CSSPropertyTransitionProperty:
2618 return valueForTransitionProperty(style.transitions()); 2618 return valueForTransitionProperty(style.transitions());
2619 case CSSPropertyTransitionTimingFunction: 2619 case CSSPropertyTransitionTimingFunction:
2620 return valueForAnimationTimingFunction(style.transitions()); 2620 return valueForAnimationTimingFunction(style.transitions());
2621 case CSSPropertyTransition: { 2621 case CSSPropertyTransition: {
2622 const CSSTransitionData* transitionData = style.transitions(); 2622 const CSSTransitionData* transitionData = style.transitions();
2623 if (transitionData) { 2623 if (transitionData) {
2624 CSSValueList* transitionsList = CSSValueList::createCommaSeparated() ; 2624 CSSValueList* transitionsList = CSSValueList::createCommaSeparated() ;
2625 for (size_t i = 0; i < transitionData->propertyList().size(); ++i) { 2625 for (size_t i = 0; i < transitionData->propertyList().size(); ++i) {
2626 CSSValueList* list = CSSValueList::createSpaceSeparated(); 2626 CSSValueList* list = CSSValueList::createSpaceSeparated();
2627 list->append(*createTransitionPropertyValue(transitionData->prop ertyList()[i])); 2627 list->append(*createTransitionPropertyValue(transitionData->prop ertyList()[i]));
2628 list->append(*CSSPrimitiveValue::create(CSSTimingData::getRepeat ed(transitionData->durationList(), i), CSSPrimitiveValue::UnitType::Seconds)); 2628 list->append(*CSSPrimitiveValue::create(CSSTimingData::getRepeat ed(transitionData->durationList(), i), CSSPrimitiveValue::UnitType::Seconds));
2629 list->append(*createTimingFunctionValue(CSSTimingData::getRepeat ed(transitionData->timingFunctionList(), i).get())); 2629 list->append(*createTimingFunctionValue(CSSTimingData::getRepeat ed(transitionData->timingFunctionList(), i).get()));
2630 list->append(*CSSPrimitiveValue::create(CSSTimingData::getRepeat ed(transitionData->delayList(), i), CSSPrimitiveValue::UnitType::Seconds)); 2630 list->append(*CSSPrimitiveValue::create(CSSTimingData::getRepeat ed(transitionData->delayList(), i), CSSPrimitiveValue::UnitType::Seconds));
2631 transitionsList->append(*list); 2631 transitionsList->append(*list);
2632 } 2632 }
2633 return transitionsList; 2633 return transitionsList;
2634 } 2634 }
2635 2635
2636 CSSValueList* list = CSSValueList::createSpaceSeparated(); 2636 CSSValueList* list = CSSValueList::createSpaceSeparated();
2637 // transition-property default value. 2637 // transition-property default value.
2638 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueAll)); 2638 list->append(*CSSIdentifierValue::create(CSSValueAll));
2639 list->append(*CSSPrimitiveValue::create(CSSTransitionData::initialDurati on(), CSSPrimitiveValue::UnitType::Seconds)); 2639 list->append(*CSSPrimitiveValue::create(CSSTransitionData::initialDurati on(), CSSPrimitiveValue::UnitType::Seconds));
2640 list->append(*createTimingFunctionValue(CSSTransitionData::initialTiming Function().get())); 2640 list->append(*createTimingFunctionValue(CSSTransitionData::initialTiming Function().get()));
2641 list->append(*CSSPrimitiveValue::create(CSSTransitionData::initialDelay( ), CSSPrimitiveValue::UnitType::Seconds)); 2641 list->append(*CSSPrimitiveValue::create(CSSTransitionData::initialDelay( ), CSSPrimitiveValue::UnitType::Seconds));
2642 return list; 2642 return list;
2643 } 2643 }
2644 case CSSPropertyPointerEvents: 2644 case CSSPropertyPointerEvents:
2645 return CSSPrimitiveValue::create(style.pointerEvents()); 2645 return CSSIdentifierValue::create(style.pointerEvents());
2646 case CSSPropertyWritingMode: 2646 case CSSPropertyWritingMode:
2647 case CSSPropertyWebkitWritingMode: 2647 case CSSPropertyWebkitWritingMode:
2648 return CSSPrimitiveValue::create(style.getWritingMode()); 2648 return CSSIdentifierValue::create(style.getWritingMode());
2649 case CSSPropertyWebkitTextCombine: 2649 case CSSPropertyWebkitTextCombine:
2650 if (style.getTextCombine() == TextCombineAll) 2650 if (style.getTextCombine() == TextCombineAll)
2651 return CSSPrimitiveValue::createIdentifier(CSSValueHorizontal); 2651 return CSSIdentifierValue::create(CSSValueHorizontal);
2652 case CSSPropertyTextCombineUpright: 2652 case CSSPropertyTextCombineUpright:
2653 return CSSPrimitiveValue::create(style.getTextCombine()); 2653 return CSSIdentifierValue::create(style.getTextCombine());
2654 case CSSPropertyWebkitTextOrientation: 2654 case CSSPropertyWebkitTextOrientation:
2655 if (style.getTextOrientation() == TextOrientationMixed) 2655 if (style.getTextOrientation() == TextOrientationMixed)
2656 return CSSPrimitiveValue::createIdentifier(CSSValueVerticalRight); 2656 return CSSIdentifierValue::create(CSSValueVerticalRight);
2657 case CSSPropertyTextOrientation: 2657 case CSSPropertyTextOrientation:
2658 return CSSPrimitiveValue::create(style.getTextOrientation()); 2658 return CSSIdentifierValue::create(style.getTextOrientation());
2659 case CSSPropertyContent: 2659 case CSSPropertyContent:
2660 return valueForContentData(style); 2660 return valueForContentData(style);
2661 case CSSPropertyCounterIncrement: 2661 case CSSPropertyCounterIncrement:
2662 return valueForCounterDirectives(style, propertyID); 2662 return valueForCounterDirectives(style, propertyID);
2663 case CSSPropertyCounterReset: 2663 case CSSPropertyCounterReset:
2664 return valueForCounterDirectives(style, propertyID); 2664 return valueForCounterDirectives(style, propertyID);
2665 case CSSPropertyClipPath: 2665 case CSSPropertyClipPath:
2666 if (ClipPathOperation* operation = style.clipPath()) { 2666 if (ClipPathOperation* operation = style.clipPath()) {
2667 if (operation->type() == ClipPathOperation::SHAPE) 2667 if (operation->type() == ClipPathOperation::SHAPE)
2668 return valueForBasicShape(style, toShapeClipPathOperation(operat ion)->basicShape()); 2668 return valueForBasicShape(style, toShapeClipPathOperation(operat ion)->basicShape());
2669 if (operation->type() == ClipPathOperation::REFERENCE) 2669 if (operation->type() == ClipPathOperation::REFERENCE)
2670 return CSSURIValue::create(toReferenceClipPathOperation(operatio n)->url()); 2670 return CSSURIValue::create(toReferenceClipPathOperation(operatio n)->url());
2671 } 2671 }
2672 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 2672 return CSSIdentifierValue::create(CSSValueNone);
2673 case CSSPropertyShapeMargin: 2673 case CSSPropertyShapeMargin:
2674 return CSSPrimitiveValue::create(style.shapeMargin(), style.effectiveZoo m()); 2674 return CSSValue::create(style.shapeMargin(), style.effectiveZoom());
2675 case CSSPropertyShapeImageThreshold: 2675 case CSSPropertyShapeImageThreshold:
2676 return CSSPrimitiveValue::create(style.shapeImageThreshold(), CSSPrimiti veValue::UnitType::Number); 2676 return CSSPrimitiveValue::create(style.shapeImageThreshold(), CSSPrimiti veValue::UnitType::Number);
2677 case CSSPropertyShapeOutside: 2677 case CSSPropertyShapeOutside:
2678 return valueForShape(style, style.shapeOutside()); 2678 return valueForShape(style, style.shapeOutside());
2679 case CSSPropertyFilter: 2679 case CSSPropertyFilter:
2680 return valueForFilter(style, style.filter()); 2680 return valueForFilter(style, style.filter());
2681 case CSSPropertyBackdropFilter: 2681 case CSSPropertyBackdropFilter:
2682 return valueForFilter(style, style.backdropFilter()); 2682 return valueForFilter(style, style.backdropFilter());
2683 case CSSPropertyMixBlendMode: 2683 case CSSPropertyMixBlendMode:
2684 return CSSPrimitiveValue::create(style.blendMode()); 2684 return CSSIdentifierValue::create(style.blendMode());
2685 2685
2686 case CSSPropertyBackgroundBlendMode: { 2686 case CSSPropertyBackgroundBlendMode: {
2687 CSSValueList* list = CSSValueList::createCommaSeparated(); 2687 CSSValueList* list = CSSValueList::createCommaSeparated();
2688 for (const FillLayer* currLayer = &style.backgroundLayers(); currLayer; currLayer = currLayer->next()) 2688 for (const FillLayer* currLayer = &style.backgroundLayers(); currLayer; currLayer = currLayer->next())
2689 list->append(*CSSPrimitiveValue::create(currLayer->blendMode())); 2689 list->append(*CSSIdentifierValue::create(currLayer->blendMode()));
2690 return list; 2690 return list;
2691 } 2691 }
2692 case CSSPropertyBackground: 2692 case CSSPropertyBackground:
2693 return valuesForBackgroundShorthand(style, layoutObject, styledNode, all owVisitedStyle); 2693 return valuesForBackgroundShorthand(style, layoutObject, styledNode, all owVisitedStyle);
2694 case CSSPropertyBorder: { 2694 case CSSPropertyBorder: {
2695 const CSSValue* value = get(CSSPropertyBorderTop, style, layoutObject, s tyledNode, allowVisitedStyle); 2695 const CSSValue* value = get(CSSPropertyBorderTop, style, layoutObject, s tyledNode, allowVisitedStyle);
2696 const CSSPropertyID properties[] = { 2696 const CSSPropertyID properties[] = {
2697 CSSPropertyBorderRight, 2697 CSSPropertyBorderRight,
2698 CSSPropertyBorderBottom, 2698 CSSPropertyBorderBottom,
2699 CSSPropertyBorderLeft 2699 CSSPropertyBorderLeft
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
2747 2747
2748 case CSSPropertyOffsetAnchor: 2748 case CSSPropertyOffsetAnchor:
2749 return valueForPosition(style.offsetAnchor(), style); 2749 return valueForPosition(style.offsetAnchor(), style);
2750 2750
2751 case CSSPropertyOffsetPosition: 2751 case CSSPropertyOffsetPosition:
2752 return valueForPosition(style.offsetPosition(), style); 2752 return valueForPosition(style.offsetPosition(), style);
2753 2753
2754 case CSSPropertyOffsetPath: 2754 case CSSPropertyOffsetPath:
2755 if (const StylePath* styleMotionPath = style.offsetPath()) 2755 if (const StylePath* styleMotionPath = style.offsetPath())
2756 return styleMotionPath->computedCSSValue(); 2756 return styleMotionPath->computedCSSValue();
2757 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 2757 return CSSIdentifierValue::create(CSSValueNone);
2758 2758
2759 case CSSPropertyOffsetDistance: 2759 case CSSPropertyOffsetDistance:
2760 return zoomAdjustedPixelValueForLength(style.offsetDistance(), style); 2760 return zoomAdjustedPixelValueForLength(style.offsetDistance(), style);
2761 2761
2762 case CSSPropertyOffsetRotation: { 2762 case CSSPropertyOffsetRotation: {
2763 CSSValueList* list = CSSValueList::createSpaceSeparated(); 2763 CSSValueList* list = CSSValueList::createSpaceSeparated();
2764 if (style.offsetRotation().type == OffsetRotationAuto) 2764 if (style.offsetRotation().type == OffsetRotationAuto)
2765 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueAuto)); 2765 list->append(*CSSIdentifierValue::create(CSSValueAuto));
2766 list->append(*CSSPrimitiveValue::create(style.offsetRotation().angle, CS SPrimitiveValue::UnitType::Degrees)); 2766 list->append(*CSSPrimitiveValue::create(style.offsetRotation().angle, CS SPrimitiveValue::UnitType::Degrees));
2767 return list; 2767 return list;
2768 } 2768 }
2769 2769
2770 // Unimplemented CSS 3 properties (including CSS3 shorthand properties). 2770 // Unimplemented CSS 3 properties (including CSS3 shorthand properties).
2771 case CSSPropertyWebkitTextEmphasis: 2771 case CSSPropertyWebkitTextEmphasis:
2772 return nullptr; 2772 return nullptr;
2773 2773
2774 // Directional properties are resolved by resolveDirectionAwareProperty() be fore the switch. 2774 // Directional properties are resolved by resolveDirectionAwareProperty() be fore the switch.
2775 case CSSPropertyWebkitBorderEnd: 2775 case CSSPropertyWebkitBorderEnd:
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
2830 2830
2831 // @viewport rule properties. 2831 // @viewport rule properties.
2832 case CSSPropertyMaxZoom: 2832 case CSSPropertyMaxZoom:
2833 case CSSPropertyMinZoom: 2833 case CSSPropertyMinZoom:
2834 case CSSPropertyOrientation: 2834 case CSSPropertyOrientation:
2835 case CSSPropertyUserZoom: 2835 case CSSPropertyUserZoom:
2836 return nullptr; 2836 return nullptr;
2837 2837
2838 // SVG properties. 2838 // SVG properties.
2839 case CSSPropertyClipRule: 2839 case CSSPropertyClipRule:
2840 return CSSPrimitiveValue::create(svgStyle.clipRule()); 2840 return CSSIdentifierValue::create(svgStyle.clipRule());
2841 case CSSPropertyFloodOpacity: 2841 case CSSPropertyFloodOpacity:
2842 return CSSPrimitiveValue::create(svgStyle.floodOpacity(), CSSPrimitiveVa lue::UnitType::Number); 2842 return CSSPrimitiveValue::create(svgStyle.floodOpacity(), CSSPrimitiveVa lue::UnitType::Number);
2843 case CSSPropertyStopOpacity: 2843 case CSSPropertyStopOpacity:
2844 return CSSPrimitiveValue::create(svgStyle.stopOpacity(), CSSPrimitiveVal ue::UnitType::Number); 2844 return CSSPrimitiveValue::create(svgStyle.stopOpacity(), CSSPrimitiveVal ue::UnitType::Number);
2845 case CSSPropertyColorInterpolation: 2845 case CSSPropertyColorInterpolation:
2846 return CSSPrimitiveValue::create(svgStyle.colorInterpolation()); 2846 return CSSIdentifierValue::create(svgStyle.colorInterpolation());
2847 case CSSPropertyColorInterpolationFilters: 2847 case CSSPropertyColorInterpolationFilters:
2848 return CSSPrimitiveValue::create(svgStyle.colorInterpolationFilters()); 2848 return CSSIdentifierValue::create(svgStyle.colorInterpolationFilters());
2849 case CSSPropertyFillOpacity: 2849 case CSSPropertyFillOpacity:
2850 return CSSPrimitiveValue::create(svgStyle.fillOpacity(), CSSPrimitiveVal ue::UnitType::Number); 2850 return CSSPrimitiveValue::create(svgStyle.fillOpacity(), CSSPrimitiveVal ue::UnitType::Number);
2851 case CSSPropertyFillRule: 2851 case CSSPropertyFillRule:
2852 return CSSPrimitiveValue::create(svgStyle.fillRule()); 2852 return CSSIdentifierValue::create(svgStyle.fillRule());
2853 case CSSPropertyColorRendering: 2853 case CSSPropertyColorRendering:
2854 return CSSPrimitiveValue::create(svgStyle.colorRendering()); 2854 return CSSIdentifierValue::create(svgStyle.colorRendering());
2855 case CSSPropertyShapeRendering: 2855 case CSSPropertyShapeRendering:
2856 return CSSPrimitiveValue::create(svgStyle.shapeRendering()); 2856 return CSSIdentifierValue::create(svgStyle.shapeRendering());
2857 case CSSPropertyStrokeLinecap: 2857 case CSSPropertyStrokeLinecap:
2858 return CSSPrimitiveValue::create(svgStyle.capStyle()); 2858 return CSSIdentifierValue::create(svgStyle.capStyle());
2859 case CSSPropertyStrokeLinejoin: 2859 case CSSPropertyStrokeLinejoin:
2860 return CSSPrimitiveValue::create(svgStyle.joinStyle()); 2860 return CSSIdentifierValue::create(svgStyle.joinStyle());
2861 case CSSPropertyStrokeMiterlimit: 2861 case CSSPropertyStrokeMiterlimit:
2862 return CSSPrimitiveValue::create(svgStyle.strokeMiterLimit(), CSSPrimiti veValue::UnitType::Number); 2862 return CSSPrimitiveValue::create(svgStyle.strokeMiterLimit(), CSSPrimiti veValue::UnitType::Number);
2863 case CSSPropertyStrokeOpacity: 2863 case CSSPropertyStrokeOpacity:
2864 return CSSPrimitiveValue::create(svgStyle.strokeOpacity(), CSSPrimitiveV alue::UnitType::Number); 2864 return CSSPrimitiveValue::create(svgStyle.strokeOpacity(), CSSPrimitiveV alue::UnitType::Number);
2865 case CSSPropertyAlignmentBaseline: 2865 case CSSPropertyAlignmentBaseline:
2866 return CSSPrimitiveValue::create(svgStyle.alignmentBaseline()); 2866 return CSSIdentifierValue::create(svgStyle.alignmentBaseline());
2867 case CSSPropertyDominantBaseline: 2867 case CSSPropertyDominantBaseline:
2868 return CSSPrimitiveValue::create(svgStyle.dominantBaseline()); 2868 return CSSIdentifierValue::create(svgStyle.dominantBaseline());
2869 case CSSPropertyTextAnchor: 2869 case CSSPropertyTextAnchor:
2870 return CSSPrimitiveValue::create(svgStyle.textAnchor()); 2870 return CSSIdentifierValue::create(svgStyle.textAnchor());
2871 case CSSPropertyMask: 2871 case CSSPropertyMask:
2872 if (!svgStyle.maskerResource().isEmpty()) 2872 if (!svgStyle.maskerResource().isEmpty())
2873 return CSSURIValue::create(serializeAsFragmentIdentifier(svgStyle.ma skerResource())); 2873 return CSSURIValue::create(serializeAsFragmentIdentifier(svgStyle.ma skerResource()));
2874 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 2874 return CSSIdentifierValue::create(CSSValueNone);
2875 case CSSPropertyFloodColor: 2875 case CSSPropertyFloodColor:
2876 return currentColorOrValidColor(style, svgStyle.floodColor()); 2876 return currentColorOrValidColor(style, svgStyle.floodColor());
2877 case CSSPropertyLightingColor: 2877 case CSSPropertyLightingColor:
2878 return currentColorOrValidColor(style, svgStyle.lightingColor()); 2878 return currentColorOrValidColor(style, svgStyle.lightingColor());
2879 case CSSPropertyStopColor: 2879 case CSSPropertyStopColor:
2880 return currentColorOrValidColor(style, svgStyle.stopColor()); 2880 return currentColorOrValidColor(style, svgStyle.stopColor());
2881 case CSSPropertyFill: 2881 case CSSPropertyFill:
2882 return adjustSVGPaintForCurrentColor(svgStyle.fillPaintType(), svgStyle. fillPaintUri(), svgStyle.fillPaintColor(), style.color()); 2882 return adjustSVGPaintForCurrentColor(svgStyle.fillPaintType(), svgStyle. fillPaintUri(), svgStyle.fillPaintColor(), style.color());
2883 case CSSPropertyMarkerEnd: 2883 case CSSPropertyMarkerEnd:
2884 if (!svgStyle.markerEndResource().isEmpty()) 2884 if (!svgStyle.markerEndResource().isEmpty())
2885 return CSSURIValue::create(serializeAsFragmentIdentifier(svgStyle.ma rkerEndResource())); 2885 return CSSURIValue::create(serializeAsFragmentIdentifier(svgStyle.ma rkerEndResource()));
2886 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 2886 return CSSIdentifierValue::create(CSSValueNone);
2887 case CSSPropertyMarkerMid: 2887 case CSSPropertyMarkerMid:
2888 if (!svgStyle.markerMidResource().isEmpty()) 2888 if (!svgStyle.markerMidResource().isEmpty())
2889 return CSSURIValue::create(serializeAsFragmentIdentifier(svgStyle.ma rkerMidResource())); 2889 return CSSURIValue::create(serializeAsFragmentIdentifier(svgStyle.ma rkerMidResource()));
2890 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 2890 return CSSIdentifierValue::create(CSSValueNone);
2891 case CSSPropertyMarkerStart: 2891 case CSSPropertyMarkerStart:
2892 if (!svgStyle.markerStartResource().isEmpty()) 2892 if (!svgStyle.markerStartResource().isEmpty())
2893 return CSSURIValue::create(serializeAsFragmentIdentifier(svgStyle.ma rkerStartResource())); 2893 return CSSURIValue::create(serializeAsFragmentIdentifier(svgStyle.ma rkerStartResource()));
2894 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 2894 return CSSIdentifierValue::create(CSSValueNone);
2895 case CSSPropertyStroke: 2895 case CSSPropertyStroke:
2896 return adjustSVGPaintForCurrentColor(svgStyle.strokePaintType(), svgStyl e.strokePaintUri(), svgStyle.strokePaintColor(), style.color()); 2896 return adjustSVGPaintForCurrentColor(svgStyle.strokePaintType(), svgStyl e.strokePaintUri(), svgStyle.strokePaintColor(), style.color());
2897 case CSSPropertyStrokeDasharray: 2897 case CSSPropertyStrokeDasharray:
2898 return strokeDashArrayToCSSValueList(*svgStyle.strokeDashArray(), style) ; 2898 return strokeDashArrayToCSSValueList(*svgStyle.strokeDashArray(), style) ;
2899 case CSSPropertyStrokeDashoffset: 2899 case CSSPropertyStrokeDashoffset:
2900 return zoomAdjustedPixelValueForLength(svgStyle.strokeDashOffset(), styl e); 2900 return zoomAdjustedPixelValueForLength(svgStyle.strokeDashOffset(), styl e);
2901 case CSSPropertyStrokeWidth: 2901 case CSSPropertyStrokeWidth:
2902 return pixelValueForUnzoomedLength(svgStyle.strokeWidth(), style); 2902 return pixelValueForUnzoomedLength(svgStyle.strokeWidth(), style);
2903 case CSSPropertyBaselineShift: { 2903 case CSSPropertyBaselineShift: {
2904 switch (svgStyle.baselineShift()) { 2904 switch (svgStyle.baselineShift()) {
2905 case BS_SUPER: 2905 case BS_SUPER:
2906 return CSSPrimitiveValue::createIdentifier(CSSValueSuper); 2906 return CSSIdentifierValue::create(CSSValueSuper);
2907 case BS_SUB: 2907 case BS_SUB:
2908 return CSSPrimitiveValue::createIdentifier(CSSValueSub); 2908 return CSSIdentifierValue::create(CSSValueSub);
2909 case BS_LENGTH: 2909 case BS_LENGTH:
2910 return zoomAdjustedPixelValueForLength(svgStyle.baselineShiftValue() , style); 2910 return zoomAdjustedPixelValueForLength(svgStyle.baselineShiftValue() , style);
2911 } 2911 }
2912 ASSERT_NOT_REACHED(); 2912 ASSERT_NOT_REACHED();
2913 return nullptr; 2913 return nullptr;
2914 } 2914 }
2915 case CSSPropertyBufferedRendering: 2915 case CSSPropertyBufferedRendering:
2916 return CSSPrimitiveValue::create(svgStyle.bufferedRendering()); 2916 return CSSIdentifierValue::create(svgStyle.bufferedRendering());
2917 case CSSPropertyPaintOrder: 2917 case CSSPropertyPaintOrder:
2918 return paintOrderToCSSValueList(svgStyle); 2918 return paintOrderToCSSValueList(svgStyle);
2919 case CSSPropertyVectorEffect: 2919 case CSSPropertyVectorEffect:
2920 return CSSPrimitiveValue::create(svgStyle.vectorEffect()); 2920 return CSSIdentifierValue::create(svgStyle.vectorEffect());
2921 case CSSPropertyMaskType: 2921 case CSSPropertyMaskType:
2922 return CSSPrimitiveValue::create(svgStyle.maskType()); 2922 return CSSIdentifierValue::create(svgStyle.maskType());
2923 case CSSPropertyMarker: 2923 case CSSPropertyMarker:
2924 // the above properties are not yet implemented in the engine 2924 // the above properties are not yet implemented in the engine
2925 return nullptr; 2925 return nullptr;
2926 case CSSPropertyD: 2926 case CSSPropertyD:
2927 if (const StylePath* stylePath = svgStyle.d()) 2927 if (const StylePath* stylePath = svgStyle.d())
2928 return stylePath->computedCSSValue(); 2928 return stylePath->computedCSSValue();
2929 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 2929 return CSSIdentifierValue::create(CSSValueNone);
2930 case CSSPropertyCx: 2930 case CSSPropertyCx:
2931 return zoomAdjustedPixelValueForLength(svgStyle.cx(), style); 2931 return zoomAdjustedPixelValueForLength(svgStyle.cx(), style);
2932 case CSSPropertyCy: 2932 case CSSPropertyCy:
2933 return zoomAdjustedPixelValueForLength(svgStyle.cy(), style); 2933 return zoomAdjustedPixelValueForLength(svgStyle.cy(), style);
2934 case CSSPropertyX: 2934 case CSSPropertyX:
2935 return zoomAdjustedPixelValueForLength(svgStyle.x(), style); 2935 return zoomAdjustedPixelValueForLength(svgStyle.x(), style);
2936 case CSSPropertyY: 2936 case CSSPropertyY:
2937 return zoomAdjustedPixelValueForLength(svgStyle.y(), style); 2937 return zoomAdjustedPixelValueForLength(svgStyle.y(), style);
2938 case CSSPropertyR: 2938 case CSSPropertyR:
2939 return zoomAdjustedPixelValueForLength(svgStyle.r(), style); 2939 return zoomAdjustedPixelValueForLength(svgStyle.r(), style);
2940 case CSSPropertyRx: 2940 case CSSPropertyRx:
2941 return zoomAdjustedPixelValueForLength(svgStyle.rx(), style); 2941 return zoomAdjustedPixelValueForLength(svgStyle.rx(), style);
2942 case CSSPropertyRy: 2942 case CSSPropertyRy:
2943 return zoomAdjustedPixelValueForLength(svgStyle.ry(), style); 2943 return zoomAdjustedPixelValueForLength(svgStyle.ry(), style);
2944 case CSSPropertyScrollSnapType: 2944 case CSSPropertyScrollSnapType:
2945 return CSSPrimitiveValue::create(style.getScrollSnapType()); 2945 return CSSIdentifierValue::create(style.getScrollSnapType());
2946 case CSSPropertyScrollSnapPointsX: 2946 case CSSPropertyScrollSnapPointsX:
2947 return valueForScrollSnapPoints(style.scrollSnapPointsX(), style); 2947 return valueForScrollSnapPoints(style.scrollSnapPointsX(), style);
2948 case CSSPropertyScrollSnapPointsY: 2948 case CSSPropertyScrollSnapPointsY:
2949 return valueForScrollSnapPoints(style.scrollSnapPointsY(), style); 2949 return valueForScrollSnapPoints(style.scrollSnapPointsY(), style);
2950 case CSSPropertyScrollSnapCoordinate: 2950 case CSSPropertyScrollSnapCoordinate:
2951 return valueForScrollSnapCoordinate(style.scrollSnapCoordinate(), style) ; 2951 return valueForScrollSnapCoordinate(style.scrollSnapCoordinate(), style) ;
2952 case CSSPropertyScrollSnapDestination: 2952 case CSSPropertyScrollSnapDestination:
2953 return valueForScrollSnapDestination(style.scrollSnapDestination(), styl e); 2953 return valueForScrollSnapDestination(style.scrollSnapDestination(), styl e);
2954 case CSSPropertyTranslate: { 2954 case CSSPropertyTranslate: {
2955 if (!style.translate()) 2955 if (!style.translate())
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
2996 list->append(*CSSPrimitiveValue::create(style.scale()->x(), CSSPrimitive Value::UnitType::Number)); 2996 list->append(*CSSPrimitiveValue::create(style.scale()->x(), CSSPrimitive Value::UnitType::Number));
2997 if (style.scale()->y() == 1 && style.scale()->z() == 1) 2997 if (style.scale()->y() == 1 && style.scale()->z() == 1)
2998 return list; 2998 return list;
2999 list->append(*CSSPrimitiveValue::create(style.scale()->y(), CSSPrimitive Value::UnitType::Number)); 2999 list->append(*CSSPrimitiveValue::create(style.scale()->y(), CSSPrimitive Value::UnitType::Number));
3000 if (style.scale()->z() != 1) 3000 if (style.scale()->z() != 1)
3001 list->append(*CSSPrimitiveValue::create(style.scale()->z(), CSSPrimi tiveValue::UnitType::Number)); 3001 list->append(*CSSPrimitiveValue::create(style.scale()->z(), CSSPrimi tiveValue::UnitType::Number));
3002 return list; 3002 return list;
3003 } 3003 }
3004 case CSSPropertyContain: { 3004 case CSSPropertyContain: {
3005 if (!style.contain()) 3005 if (!style.contain())
3006 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 3006 return CSSIdentifierValue::create(CSSValueNone);
3007 if (style.contain() == ContainsStrict) 3007 if (style.contain() == ContainsStrict)
3008 return CSSPrimitiveValue::createIdentifier(CSSValueStrict); 3008 return CSSIdentifierValue::create(CSSValueStrict);
3009 if (style.contain() == ContainsContent) 3009 if (style.contain() == ContainsContent)
3010 return CSSPrimitiveValue::createIdentifier(CSSValueContent); 3010 return CSSIdentifierValue::create(CSSValueContent);
3011 3011
3012 CSSValueList* list = CSSValueList::createSpaceSeparated(); 3012 CSSValueList* list = CSSValueList::createSpaceSeparated();
3013 if (style.containsStyle()) 3013 if (style.containsStyle())
3014 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueStyle)); 3014 list->append(*CSSIdentifierValue::create(CSSValueStyle));
3015 if (style.contain() & ContainsLayout) 3015 if (style.contain() & ContainsLayout)
3016 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueLayout)); 3016 list->append(*CSSIdentifierValue::create(CSSValueLayout));
3017 if (style.containsPaint()) 3017 if (style.containsPaint())
3018 list->append(*CSSPrimitiveValue::createIdentifier(CSSValuePaint)); 3018 list->append(*CSSIdentifierValue::create(CSSValuePaint));
3019 if (style.containsSize()) 3019 if (style.containsSize())
3020 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueSize)); 3020 list->append(*CSSIdentifierValue::create(CSSValueSize));
3021 ASSERT(list->length()); 3021 ASSERT(list->length());
3022 return list; 3022 return list;
3023 } 3023 }
3024 case CSSPropertySnapHeight: { 3024 case CSSPropertySnapHeight: {
3025 if (!style.snapHeightUnit()) 3025 if (!style.snapHeightUnit())
3026 return CSSPrimitiveValue::create(0, CSSPrimitiveValue::UnitType::Pix els); 3026 return CSSPrimitiveValue::create(0, CSSPrimitiveValue::UnitType::Pix els);
3027 CSSValueList* list = CSSValueList::createSpaceSeparated(); 3027 CSSValueList* list = CSSValueList::createSpaceSeparated();
3028 list->append(*CSSPrimitiveValue::create(style.snapHeightUnit(), CSSPrimi tiveValue::UnitType::Pixels)); 3028 list->append(*CSSPrimitiveValue::create(style.snapHeightUnit(), CSSPrimi tiveValue::UnitType::Pixels));
3029 if (style.snapHeightPosition()) 3029 if (style.snapHeightPosition())
3030 list->append(*CSSPrimitiveValue::create(style.snapHeightPosition(), CSSPrimitiveValue::UnitType::Integer)); 3030 list->append(*CSSPrimitiveValue::create(style.snapHeightPosition(), CSSPrimitiveValue::UnitType::Integer));
3031 return list; 3031 return list;
3032 } 3032 }
3033 case CSSPropertyVariable: 3033 case CSSPropertyVariable:
3034 // Variables are retrieved via get(AtomicString). 3034 // Variables are retrieved via get(AtomicString).
3035 ASSERT_NOT_REACHED(); 3035 ASSERT_NOT_REACHED();
3036 return nullptr; 3036 return nullptr;
3037 case CSSPropertyAll: 3037 case CSSPropertyAll:
3038 return nullptr; 3038 return nullptr;
3039 default: 3039 default:
3040 break; 3040 break;
3041 } 3041 }
3042 ASSERT_NOT_REACHED(); 3042 ASSERT_NOT_REACHED();
3043 return nullptr; 3043 return nullptr;
3044 } 3044 }
3045 3045
3046 } // namespace blink 3046 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698