OLD | NEW |
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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 #include "core/style/StyleVariableData.h" | 58 #include "core/style/StyleVariableData.h" |
59 #include "platform/LengthFunctions.h" | 59 #include "platform/LengthFunctions.h" |
60 | 60 |
61 namespace blink { | 61 namespace blink { |
62 | 62 |
63 inline static bool isFlexOrGrid(const ComputedStyle* style) | 63 inline static bool isFlexOrGrid(const ComputedStyle* style) |
64 { | 64 { |
65 return style && style->isDisplayFlexibleOrGridBox(); | 65 return style && style->isDisplayFlexibleOrGridBox(); |
66 } | 66 } |
67 | 67 |
68 inline static RawPtr<CSSPrimitiveValue> zoomAdjustedPixelValue(double value, con
st ComputedStyle& style) | 68 inline static CSSPrimitiveValue* zoomAdjustedPixelValue(double value, const Comp
utedStyle& style) |
69 { | 69 { |
70 return cssValuePool().createValue(adjustFloatForAbsoluteZoom(value, style),
CSSPrimitiveValue::UnitType::Pixels); | 70 return cssValuePool().createValue(adjustFloatForAbsoluteZoom(value, style),
CSSPrimitiveValue::UnitType::Pixels); |
71 } | 71 } |
72 | 72 |
73 inline static RawPtr<CSSPrimitiveValue> zoomAdjustedNumberValue(double value, co
nst ComputedStyle& style) | 73 inline static CSSPrimitiveValue* zoomAdjustedNumberValue(double value, const Com
putedStyle& style) |
74 { | 74 { |
75 return cssValuePool().createValue(value / style.effectiveZoom(), CSSPrimitiv
eValue::UnitType::Number); | 75 return cssValuePool().createValue(value / style.effectiveZoom(), CSSPrimitiv
eValue::UnitType::Number); |
76 } | 76 } |
77 | 77 |
78 static RawPtr<CSSPrimitiveValue> zoomAdjustedPixelValueForLength(const Length& l
ength, const ComputedStyle& style) | 78 static CSSPrimitiveValue* zoomAdjustedPixelValueForLength(const Length& length,
const ComputedStyle& style) |
79 { | 79 { |
80 if (length.isFixed()) | 80 if (length.isFixed()) |
81 return zoomAdjustedPixelValue(length.value(), style); | 81 return zoomAdjustedPixelValue(length.value(), style); |
82 return cssValuePool().createValue(length, style); | 82 return cssValuePool().createValue(length, style); |
83 } | 83 } |
84 | 84 |
85 static RawPtr<CSSPrimitiveValue> pixelValueForUnzoomedLength(const UnzoomedLengt
h& unzoomedLength, const ComputedStyle& style) | 85 static CSSPrimitiveValue* pixelValueForUnzoomedLength(const UnzoomedLength& unzo
omedLength, const ComputedStyle& style) |
86 { | 86 { |
87 const Length& length = unzoomedLength.length(); | 87 const Length& length = unzoomedLength.length(); |
88 if (length.isFixed()) | 88 if (length.isFixed()) |
89 return cssValuePool().createValue(length.value(), CSSPrimitiveValue::Uni
tType::Pixels); | 89 return cssValuePool().createValue(length.value(), CSSPrimitiveValue::Uni
tType::Pixels); |
90 return cssValuePool().createValue(length, style); | 90 return cssValuePool().createValue(length, style); |
91 } | 91 } |
92 | 92 |
93 static RawPtr<CSSValueList> createPositionListForLayer(CSSPropertyID propertyID,
const FillLayer& layer, const ComputedStyle& style) | 93 static CSSValueList* createPositionListForLayer(CSSPropertyID propertyID, const
FillLayer& layer, const ComputedStyle& style) |
94 { | 94 { |
95 RawPtr<CSSValueList> positionList = CSSValueList::createSpaceSeparated(); | 95 CSSValueList* positionList = CSSValueList::createSpaceSeparated(); |
96 if (layer.isBackgroundXOriginSet()) { | 96 if (layer.isBackgroundXOriginSet()) { |
97 ASSERT_UNUSED(propertyID, propertyID == CSSPropertyBackgroundPosition ||
propertyID == CSSPropertyWebkitMaskPosition); | 97 ASSERT_UNUSED(propertyID, propertyID == CSSPropertyBackgroundPosition ||
propertyID == CSSPropertyWebkitMaskPosition); |
98 positionList->append(cssValuePool().createValue(layer.backgroundXOrigin(
))); | 98 positionList->append(cssValuePool().createValue(layer.backgroundXOrigin(
))); |
99 } | 99 } |
100 positionList->append(zoomAdjustedPixelValueForLength(layer.xPosition(), styl
e)); | 100 positionList->append(zoomAdjustedPixelValueForLength(layer.xPosition(), styl
e)); |
101 if (layer.isBackgroundYOriginSet()) { | 101 if (layer.isBackgroundYOriginSet()) { |
102 ASSERT(propertyID == CSSPropertyBackgroundPosition || propertyID == CSSP
ropertyWebkitMaskPosition); | 102 ASSERT(propertyID == CSSPropertyBackgroundPosition || propertyID == CSSP
ropertyWebkitMaskPosition); |
103 positionList->append(cssValuePool().createValue(layer.backgroundYOrigin(
))); | 103 positionList->append(cssValuePool().createValue(layer.backgroundYOrigin(
))); |
104 } | 104 } |
105 positionList->append(zoomAdjustedPixelValueForLength(layer.yPosition(), styl
e)); | 105 positionList->append(zoomAdjustedPixelValueForLength(layer.yPosition(), styl
e)); |
106 return positionList.release(); | 106 return positionList; |
107 } | 107 } |
108 | 108 |
109 RawPtr<CSSValue> ComputedStyleCSSValueMapping::currentColorOrValidColor(const Co
mputedStyle& style, const StyleColor& color) | 109 CSSValue* ComputedStyleCSSValueMapping::currentColorOrValidColor(const ComputedS
tyle& style, const StyleColor& color) |
110 { | 110 { |
111 // This function does NOT look at visited information, so that computed styl
e doesn't expose that. | 111 // This function does NOT look at visited information, so that computed styl
e doesn't expose that. |
112 return cssValuePool().createColorValue(color.resolve(style.color()).rgb()); | 112 return cssValuePool().createColorValue(color.resolve(style.color()).rgb()); |
113 } | 113 } |
114 | 114 |
115 static RawPtr<CSSValue> valueForFillSize(const FillSize& fillSize, const Compute
dStyle& style) | 115 static CSSValue* valueForFillSize(const FillSize& fillSize, const ComputedStyle&
style) |
116 { | 116 { |
117 if (fillSize.type == Contain) | 117 if (fillSize.type == Contain) |
118 return cssValuePool().createIdentifierValue(CSSValueContain); | 118 return cssValuePool().createIdentifierValue(CSSValueContain); |
119 | 119 |
120 if (fillSize.type == Cover) | 120 if (fillSize.type == Cover) |
121 return cssValuePool().createIdentifierValue(CSSValueCover); | 121 return cssValuePool().createIdentifierValue(CSSValueCover); |
122 | 122 |
123 if (fillSize.size.height().isAuto()) | 123 if (fillSize.size.height().isAuto()) |
124 return zoomAdjustedPixelValueForLength(fillSize.size.width(), style); | 124 return zoomAdjustedPixelValueForLength(fillSize.size.width(), style); |
125 | 125 |
126 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | 126 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
127 list->append(zoomAdjustedPixelValueForLength(fillSize.size.width(), style)); | 127 list->append(zoomAdjustedPixelValueForLength(fillSize.size.width(), style)); |
128 list->append(zoomAdjustedPixelValueForLength(fillSize.size.height(), style))
; | 128 list->append(zoomAdjustedPixelValueForLength(fillSize.size.height(), style))
; |
129 return list.release(); | 129 return list; |
130 } | 130 } |
131 | 131 |
132 static RawPtr<CSSValue> valueForFillRepeat(EFillRepeat xRepeat, EFillRepeat yRep
eat) | 132 static CSSValue* valueForFillRepeat(EFillRepeat xRepeat, EFillRepeat yRepeat) |
133 { | 133 { |
134 // For backwards compatibility, if both values are equal, just return one of
them. And | 134 // For backwards compatibility, if both values are equal, just return one of
them. And |
135 // if the two values are equivalent to repeat-x or repeat-y, just return the
shorthand. | 135 // if the two values are equivalent to repeat-x or repeat-y, just return the
shorthand. |
136 if (xRepeat == yRepeat) | 136 if (xRepeat == yRepeat) |
137 return cssValuePool().createValue(xRepeat); | 137 return cssValuePool().createValue(xRepeat); |
138 if (xRepeat == RepeatFill && yRepeat == NoRepeatFill) | 138 if (xRepeat == RepeatFill && yRepeat == NoRepeatFill) |
139 return cssValuePool().createIdentifierValue(CSSValueRepeatX); | 139 return cssValuePool().createIdentifierValue(CSSValueRepeatX); |
140 if (xRepeat == NoRepeatFill && yRepeat == RepeatFill) | 140 if (xRepeat == NoRepeatFill && yRepeat == RepeatFill) |
141 return cssValuePool().createIdentifierValue(CSSValueRepeatY); | 141 return cssValuePool().createIdentifierValue(CSSValueRepeatY); |
142 | 142 |
143 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | 143 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
144 list->append(cssValuePool().createValue(xRepeat)); | 144 list->append(cssValuePool().createValue(xRepeat)); |
145 list->append(cssValuePool().createValue(yRepeat)); | 145 list->append(cssValuePool().createValue(yRepeat)); |
146 return list.release(); | 146 return list; |
147 } | 147 } |
148 | 148 |
149 static RawPtr<CSSValue> valueForFillSourceType(EMaskSourceType type) | 149 static CSSValue* valueForFillSourceType(EMaskSourceType type) |
150 { | 150 { |
151 switch (type) { | 151 switch (type) { |
152 case MaskAlpha: | 152 case MaskAlpha: |
153 return cssValuePool().createIdentifierValue(CSSValueAlpha); | 153 return cssValuePool().createIdentifierValue(CSSValueAlpha); |
154 case MaskLuminance: | 154 case MaskLuminance: |
155 return cssValuePool().createIdentifierValue(CSSValueLuminance); | 155 return cssValuePool().createIdentifierValue(CSSValueLuminance); |
156 } | 156 } |
157 | 157 |
158 ASSERT_NOT_REACHED(); | 158 ASSERT_NOT_REACHED(); |
159 | 159 |
160 return nullptr; | 160 return nullptr; |
161 } | 161 } |
162 | 162 |
163 static RawPtr<CSSValue> valueForPositionOffset(const ComputedStyle& style, CSSPr
opertyID propertyID, const LayoutObject* layoutObject) | 163 static CSSValue* valueForPositionOffset(const ComputedStyle& style, CSSPropertyI
D propertyID, const LayoutObject* layoutObject) |
164 { | 164 { |
165 Length offset; | 165 Length offset; |
166 switch (propertyID) { | 166 switch (propertyID) { |
167 case CSSPropertyLeft: | 167 case CSSPropertyLeft: |
168 offset = style.left(); | 168 offset = style.left(); |
169 break; | 169 break; |
170 case CSSPropertyRight: | 170 case CSSPropertyRight: |
171 offset = style.right(); | 171 offset = style.right(); |
172 break; | 172 break; |
173 case CSSPropertyTop: | 173 case CSSPropertyTop: |
(...skipping 15 matching lines...) Expand all Loading... |
189 if (offset.isAuto()) { | 189 if (offset.isAuto()) { |
190 // FIXME: It's not enough to simply return "auto" values for one offset
if the other side is defined. | 190 // FIXME: It's not enough to simply return "auto" values for one offset
if the other side is defined. |
191 // In other words if left is auto and right is not auto, then left's com
puted value is negative right(). | 191 // In other words if left is auto and right is not auto, then left's com
puted value is negative right(). |
192 // So we should get the opposite length unit and see if it is auto. | 192 // So we should get the opposite length unit and see if it is auto. |
193 return cssValuePool().createIdentifierValue(CSSValueAuto); | 193 return cssValuePool().createIdentifierValue(CSSValueAuto); |
194 } | 194 } |
195 | 195 |
196 return zoomAdjustedPixelValueForLength(offset, style); | 196 return zoomAdjustedPixelValueForLength(offset, style); |
197 } | 197 } |
198 | 198 |
199 static RawPtr<CSSBorderImageSliceValue> valueForNinePieceImageSlice(const NinePi
eceImage& image) | 199 static CSSBorderImageSliceValue* valueForNinePieceImageSlice(const NinePieceImag
e& image) |
200 { | 200 { |
201 // Create the slices. | 201 // Create the slices. |
202 RawPtr<CSSPrimitiveValue> top = nullptr; | 202 CSSPrimitiveValue* top = nullptr; |
203 RawPtr<CSSPrimitiveValue> right = nullptr; | 203 CSSPrimitiveValue* right = nullptr; |
204 RawPtr<CSSPrimitiveValue> bottom = nullptr; | 204 CSSPrimitiveValue* bottom = nullptr; |
205 RawPtr<CSSPrimitiveValue> left = nullptr; | 205 CSSPrimitiveValue* left = nullptr; |
206 | 206 |
207 // TODO(alancutter): Make this code aware of calc lengths. | 207 // TODO(alancutter): Make this code aware of calc lengths. |
208 if (image.imageSlices().top().hasPercent()) | 208 if (image.imageSlices().top().hasPercent()) |
209 top = cssValuePool().createValue(image.imageSlices().top().value(), CSSP
rimitiveValue::UnitType::Percentage); | 209 top = cssValuePool().createValue(image.imageSlices().top().value(), CSSP
rimitiveValue::UnitType::Percentage); |
210 else | 210 else |
211 top = cssValuePool().createValue(image.imageSlices().top().value(), CSSP
rimitiveValue::UnitType::Number); | 211 top = cssValuePool().createValue(image.imageSlices().top().value(), CSSP
rimitiveValue::UnitType::Number); |
212 | 212 |
213 if (image.imageSlices().right() == image.imageSlices().top() && image.imageS
lices().bottom() == image.imageSlices().top() | 213 if (image.imageSlices().right() == image.imageSlices().top() && image.imageS
lices().bottom() == image.imageSlices().top() |
214 && image.imageSlices().left() == image.imageSlices().top()) { | 214 && image.imageSlices().left() == image.imageSlices().top()) { |
215 right = top; | 215 right = top; |
(...skipping 18 matching lines...) Expand all Loading... |
234 left = right; | 234 left = right; |
235 } else { | 235 } else { |
236 if (image.imageSlices().left().hasPercent()) | 236 if (image.imageSlices().left().hasPercent()) |
237 left = cssValuePool().createValue(image.imageSlices().left()
.value(), CSSPrimitiveValue::UnitType::Percentage); | 237 left = cssValuePool().createValue(image.imageSlices().left()
.value(), CSSPrimitiveValue::UnitType::Percentage); |
238 else | 238 else |
239 left = cssValuePool().createValue(image.imageSlices().left()
.value(), CSSPrimitiveValue::UnitType::Number); | 239 left = cssValuePool().createValue(image.imageSlices().left()
.value(), CSSPrimitiveValue::UnitType::Number); |
240 } | 240 } |
241 } | 241 } |
242 } | 242 } |
243 | 243 |
244 return CSSBorderImageSliceValue::create(CSSQuadValue::create(top.release(),
right.release(), bottom.release(), left.release(), CSSQuadValue::SerializeAsQuad
), image.fill()); | 244 return CSSBorderImageSliceValue::create(CSSQuadValue::create(top, right, bot
tom, left, CSSQuadValue::SerializeAsQuad), image.fill()); |
245 } | 245 } |
246 | 246 |
247 static RawPtr<CSSQuadValue> valueForNinePieceImageQuad(const BorderImageLengthBo
x& box, const ComputedStyle& style) | 247 static CSSQuadValue* valueForNinePieceImageQuad(const BorderImageLengthBox& box,
const ComputedStyle& style) |
248 { | 248 { |
249 // Create the slices. | 249 // Create the slices. |
250 RawPtr<CSSPrimitiveValue> top = nullptr; | 250 CSSPrimitiveValue* top = nullptr; |
251 RawPtr<CSSPrimitiveValue> right = nullptr; | 251 CSSPrimitiveValue* right = nullptr; |
252 RawPtr<CSSPrimitiveValue> bottom = nullptr; | 252 CSSPrimitiveValue* bottom = nullptr; |
253 RawPtr<CSSPrimitiveValue> left = nullptr; | 253 CSSPrimitiveValue* left = nullptr; |
254 | 254 |
255 if (box.top().isNumber()) | 255 if (box.top().isNumber()) |
256 top = cssValuePool().createValue(box.top().number(), CSSPrimitiveValue::
UnitType::Number); | 256 top = cssValuePool().createValue(box.top().number(), CSSPrimitiveValue::
UnitType::Number); |
257 else | 257 else |
258 top = cssValuePool().createValue(box.top().length(), style); | 258 top = cssValuePool().createValue(box.top().length(), style); |
259 | 259 |
260 if (box.right() == box.top() && box.bottom() == box.top() && box.left() == b
ox.top()) { | 260 if (box.right() == box.top() && box.bottom() == box.top() && box.left() == b
ox.top()) { |
261 right = top; | 261 right = top; |
262 bottom = top; | 262 bottom = top; |
263 left = top; | 263 left = top; |
(...skipping 16 matching lines...) Expand all Loading... |
280 left = right; | 280 left = right; |
281 } else { | 281 } else { |
282 if (box.left().isNumber()) | 282 if (box.left().isNumber()) |
283 left = cssValuePool().createValue(box.left().number(), CSSPr
imitiveValue::UnitType::Number); | 283 left = cssValuePool().createValue(box.left().number(), CSSPr
imitiveValue::UnitType::Number); |
284 else | 284 else |
285 left = cssValuePool().createValue(box.left().length(), style
); | 285 left = cssValuePool().createValue(box.left().length(), style
); |
286 } | 286 } |
287 } | 287 } |
288 } | 288 } |
289 | 289 |
290 return CSSQuadValue::create(top.release(), right.release(), bottom.release()
, left.release(), CSSQuadValue::SerializeAsQuad); | 290 return CSSQuadValue::create(top, right, bottom, left, CSSQuadValue::Serializ
eAsQuad); |
291 } | 291 } |
292 | 292 |
293 static CSSValueID valueForRepeatRule(int rule) | 293 static CSSValueID valueForRepeatRule(int rule) |
294 { | 294 { |
295 switch (rule) { | 295 switch (rule) { |
296 case RepeatImageRule: | 296 case RepeatImageRule: |
297 return CSSValueRepeat; | 297 return CSSValueRepeat; |
298 case RoundImageRule: | 298 case RoundImageRule: |
299 return CSSValueRound; | 299 return CSSValueRound; |
300 case SpaceImageRule: | 300 case SpaceImageRule: |
301 return CSSValueSpace; | 301 return CSSValueSpace; |
302 default: | 302 default: |
303 return CSSValueStretch; | 303 return CSSValueStretch; |
304 } | 304 } |
305 } | 305 } |
306 | 306 |
307 static RawPtr<CSSValue> valueForNinePieceImageRepeat(const NinePieceImage& image
) | 307 static CSSValue* valueForNinePieceImageRepeat(const NinePieceImage& image) |
308 { | 308 { |
309 RawPtr<CSSPrimitiveValue> horizontalRepeat = nullptr; | 309 CSSPrimitiveValue* horizontalRepeat = nullptr; |
310 RawPtr<CSSPrimitiveValue> verticalRepeat = nullptr; | 310 CSSPrimitiveValue* verticalRepeat = nullptr; |
311 | 311 |
312 horizontalRepeat = cssValuePool().createIdentifierValue(valueForRepeatRule(i
mage.horizontalRule())); | 312 horizontalRepeat = cssValuePool().createIdentifierValue(valueForRepeatRule(i
mage.horizontalRule())); |
313 if (image.horizontalRule() == image.verticalRule()) | 313 if (image.horizontalRule() == image.verticalRule()) |
314 verticalRepeat = horizontalRepeat; | 314 verticalRepeat = horizontalRepeat; |
315 else | 315 else |
316 verticalRepeat = cssValuePool().createIdentifierValue(valueForRepeatRule
(image.verticalRule())); | 316 verticalRepeat = cssValuePool().createIdentifierValue(valueForRepeatRule
(image.verticalRule())); |
317 return CSSValuePair::create(horizontalRepeat.release(), verticalRepeat.relea
se(), CSSValuePair::DropIdenticalValues); | 317 return CSSValuePair::create(horizontalRepeat, verticalRepeat, CSSValuePair::
DropIdenticalValues); |
318 } | 318 } |
319 | 319 |
320 static RawPtr<CSSValue> valueForNinePieceImage(const NinePieceImage& image, cons
t ComputedStyle& style) | 320 static CSSValue* valueForNinePieceImage(const NinePieceImage& image, const Compu
tedStyle& style) |
321 { | 321 { |
322 if (!image.hasImage()) | 322 if (!image.hasImage()) |
323 return cssValuePool().createIdentifierValue(CSSValueNone); | 323 return cssValuePool().createIdentifierValue(CSSValueNone); |
324 | 324 |
325 // Image first. | 325 // Image first. |
326 RawPtr<CSSValue> imageValue = nullptr; | 326 CSSValue* imageValue = nullptr; |
327 if (image.image()) | 327 if (image.image()) |
328 imageValue = image.image()->computedCSSValue(); | 328 imageValue = image.image()->computedCSSValue(); |
329 | 329 |
330 // Create the image slice. | 330 // Create the image slice. |
331 RawPtr<CSSBorderImageSliceValue> imageSlices = valueForNinePieceImageSlice(i
mage); | 331 CSSBorderImageSliceValue* imageSlices = valueForNinePieceImageSlice(image); |
332 | 332 |
333 // Create the border area slices. | 333 // Create the border area slices. |
334 RawPtr<CSSValue> borderSlices = valueForNinePieceImageQuad(image.borderSlice
s(), style); | 334 CSSValue* borderSlices = valueForNinePieceImageQuad(image.borderSlices(), st
yle); |
335 | 335 |
336 // Create the border outset. | 336 // Create the border outset. |
337 RawPtr<CSSValue> outset = valueForNinePieceImageQuad(image.outset(), style); | 337 CSSValue* outset = valueForNinePieceImageQuad(image.outset(), style); |
338 | 338 |
339 // Create the repeat rules. | 339 // Create the repeat rules. |
340 RawPtr<CSSValue> repeat = valueForNinePieceImageRepeat(image); | 340 CSSValue* repeat = valueForNinePieceImageRepeat(image); |
341 | 341 |
342 return createBorderImageValue(imageValue.release(), imageSlices.release(), b
orderSlices.release(), outset.release(), repeat.release()); | 342 return createBorderImageValue(imageValue, imageSlices, borderSlices, outset,
repeat); |
343 } | 343 } |
344 | 344 |
345 static RawPtr<CSSValue> valueForReflection(const StyleReflection* reflection, co
nst ComputedStyle& style) | 345 static CSSValue* valueForReflection(const StyleReflection* reflection, const Com
putedStyle& style) |
346 { | 346 { |
347 if (!reflection) | 347 if (!reflection) |
348 return cssValuePool().createIdentifierValue(CSSValueNone); | 348 return cssValuePool().createIdentifierValue(CSSValueNone); |
349 | 349 |
350 RawPtr<CSSPrimitiveValue> offset = nullptr; | 350 CSSPrimitiveValue* offset = nullptr; |
351 // TODO(alancutter): Make this work correctly for calc lengths. | 351 // TODO(alancutter): Make this work correctly for calc lengths. |
352 if (reflection->offset().hasPercent()) | 352 if (reflection->offset().hasPercent()) |
353 offset = cssValuePool().createValue(reflection->offset().percent(), CSSP
rimitiveValue::UnitType::Percentage); | 353 offset = cssValuePool().createValue(reflection->offset().percent(), CSSP
rimitiveValue::UnitType::Percentage); |
354 else | 354 else |
355 offset = zoomAdjustedPixelValue(reflection->offset().value(), style); | 355 offset = zoomAdjustedPixelValue(reflection->offset().value(), style); |
356 | 356 |
357 RawPtr<CSSPrimitiveValue> direction = nullptr; | 357 CSSPrimitiveValue* direction = nullptr; |
358 switch (reflection->direction()) { | 358 switch (reflection->direction()) { |
359 case ReflectionBelow: | 359 case ReflectionBelow: |
360 direction = cssValuePool().createIdentifierValue(CSSValueBelow); | 360 direction = cssValuePool().createIdentifierValue(CSSValueBelow); |
361 break; | 361 break; |
362 case ReflectionAbove: | 362 case ReflectionAbove: |
363 direction = cssValuePool().createIdentifierValue(CSSValueAbove); | 363 direction = cssValuePool().createIdentifierValue(CSSValueAbove); |
364 break; | 364 break; |
365 case ReflectionLeft: | 365 case ReflectionLeft: |
366 direction = cssValuePool().createIdentifierValue(CSSValueLeft); | 366 direction = cssValuePool().createIdentifierValue(CSSValueLeft); |
367 break; | 367 break; |
368 case ReflectionRight: | 368 case ReflectionRight: |
369 direction = cssValuePool().createIdentifierValue(CSSValueRight); | 369 direction = cssValuePool().createIdentifierValue(CSSValueRight); |
370 break; | 370 break; |
371 } | 371 } |
372 | 372 |
373 return CSSReflectValue::create(direction.release(), offset.release(), valueF
orNinePieceImage(reflection->mask(), style)); | 373 return CSSReflectValue::create(direction, offset, valueForNinePieceImage(ref
lection->mask(), style)); |
374 } | 374 } |
375 | 375 |
376 static ItemPosition resolveAlignmentAuto(ItemPosition position, const ComputedSt
yle* style) | 376 static ItemPosition resolveAlignmentAuto(ItemPosition position, const ComputedSt
yle* style) |
377 { | 377 { |
378 if (position != ItemPositionAuto) | 378 if (position != ItemPositionAuto) |
379 return position; | 379 return position; |
380 | 380 |
381 if (!RuntimeEnabledFeatures::cssGridLayoutEnabled()) | 381 if (!RuntimeEnabledFeatures::cssGridLayoutEnabled()) |
382 return ItemPositionStretch; | 382 return ItemPositionStretch; |
383 | 383 |
384 return isFlexOrGrid(style) ? ItemPositionStretch : ItemPositionStart; | 384 return isFlexOrGrid(style) ? ItemPositionStretch : ItemPositionStart; |
385 } | 385 } |
386 | 386 |
387 static RawPtr<CSSValueList> valueForItemPositionWithOverflowAlignment(ItemPositi
on itemPosition, OverflowAlignment overflowAlignment, ItemPositionType positionT
ype) | 387 static CSSValueList* valueForItemPositionWithOverflowAlignment(ItemPosition item
Position, OverflowAlignment overflowAlignment, ItemPositionType positionType) |
388 { | 388 { |
389 RawPtr<CSSValueList> result = CSSValueList::createSpaceSeparated(); | 389 CSSValueList* result = CSSValueList::createSpaceSeparated(); |
390 if (positionType == LegacyPosition) | 390 if (positionType == LegacyPosition) |
391 result->append(CSSPrimitiveValue::createIdentifier(CSSValueLegacy)); | 391 result->append(CSSPrimitiveValue::createIdentifier(CSSValueLegacy)); |
392 result->append(CSSPrimitiveValue::create(itemPosition)); | 392 result->append(CSSPrimitiveValue::create(itemPosition)); |
393 if (itemPosition >= ItemPositionCenter && overflowAlignment != OverflowAlign
mentDefault) | 393 if (itemPosition >= ItemPositionCenter && overflowAlignment != OverflowAlign
mentDefault) |
394 result->append(CSSPrimitiveValue::create(overflowAlignment)); | 394 result->append(CSSPrimitiveValue::create(overflowAlignment)); |
395 ASSERT(result->length() <= 2); | 395 ASSERT(result->length() <= 2); |
396 return result.release(); | 396 return result; |
397 } | 397 } |
398 | 398 |
399 static RawPtr<CSSValueList> valuesForGridShorthand(const StylePropertyShorthand&
shorthand, const ComputedStyle& style, const LayoutObject* layoutObject, Node*
styledNode, bool allowVisitedStyle) | 399 static CSSValueList* valuesForGridShorthand(const StylePropertyShorthand& shorth
and, const ComputedStyle& style, const LayoutObject* layoutObject, Node* styledN
ode, bool allowVisitedStyle) |
400 { | 400 { |
401 RawPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); | 401 CSSValueList* list = CSSValueList::createSlashSeparated(); |
402 for (size_t i = 0; i < shorthand.length(); ++i) { | 402 for (size_t i = 0; i < shorthand.length(); ++i) { |
403 RawPtr<CSSValue> value = ComputedStyleCSSValueMapping::get(shorthand.pro
perties()[i], style, layoutObject, styledNode, allowVisitedStyle); | 403 CSSValue* value = ComputedStyleCSSValueMapping::get(shorthand.properties
()[i], style, layoutObject, styledNode, allowVisitedStyle); |
404 ASSERT(value); | |
405 list->append(value.release()); | |
406 } | |
407 return list.release(); | |
408 } | |
409 | |
410 static RawPtr<CSSValueList> valuesForShorthandProperty(const StylePropertyShorth
and& shorthand, const ComputedStyle& style, const LayoutObject* layoutObject, No
de* styledNode, bool allowVisitedStyle) | |
411 { | |
412 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | |
413 for (size_t i = 0; i < shorthand.length(); ++i) { | |
414 RawPtr<CSSValue> value = ComputedStyleCSSValueMapping::get(shorthand.pro
perties()[i], style, layoutObject, styledNode, allowVisitedStyle); | |
415 ASSERT(value); | 404 ASSERT(value); |
416 list->append(value); | 405 list->append(value); |
417 } | 406 } |
418 return list.release(); | 407 return list; |
419 } | 408 } |
420 | 409 |
421 static RawPtr<CSSValueList> valuesForBackgroundShorthand(const ComputedStyle& st
yle, const LayoutObject* layoutObject, Node* styledNode, bool allowVisitedStyle) | 410 static CSSValueList* valuesForShorthandProperty(const StylePropertyShorthand& sh
orthand, const ComputedStyle& style, const LayoutObject* layoutObject, Node* sty
ledNode, bool allowVisitedStyle) |
422 { | 411 { |
423 RawPtr<CSSValueList> ret = CSSValueList::createCommaSeparated(); | 412 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
| 413 for (size_t i = 0; i < shorthand.length(); ++i) { |
| 414 CSSValue* value = ComputedStyleCSSValueMapping::get(shorthand.properties
()[i], style, layoutObject, styledNode, allowVisitedStyle); |
| 415 ASSERT(value); |
| 416 list->append(value); |
| 417 } |
| 418 return list; |
| 419 } |
| 420 |
| 421 static CSSValueList* valuesForBackgroundShorthand(const ComputedStyle& style, co
nst LayoutObject* layoutObject, Node* styledNode, bool allowVisitedStyle) |
| 422 { |
| 423 CSSValueList* ret = CSSValueList::createCommaSeparated(); |
424 const FillLayer* currLayer = &style.backgroundLayers(); | 424 const FillLayer* currLayer = &style.backgroundLayers(); |
425 for (; currLayer; currLayer = currLayer->next()) { | 425 for (; currLayer; currLayer = currLayer->next()) { |
426 RawPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); | 426 CSSValueList* list = CSSValueList::createSlashSeparated(); |
427 RawPtr<CSSValueList> beforeSlash = CSSValueList::createSpaceSeparated(); | 427 CSSValueList* beforeSlash = CSSValueList::createSpaceSeparated(); |
428 if (!currLayer->next()) { // color only for final layer | 428 if (!currLayer->next()) { // color only for final layer |
429 RawPtr<CSSValue> value = ComputedStyleCSSValueMapping::get(CSSProper
tyBackgroundColor, style, layoutObject, styledNode, allowVisitedStyle); | 429 CSSValue* value = ComputedStyleCSSValueMapping::get(CSSPropertyBackg
roundColor, style, layoutObject, styledNode, allowVisitedStyle); |
430 ASSERT(value); | 430 ASSERT(value); |
431 beforeSlash->append(value); | 431 beforeSlash->append(value); |
432 } | 432 } |
433 beforeSlash->append(currLayer->image() ? currLayer->image()->computedCSS
Value() : cssValuePool().createIdentifierValue(CSSValueNone)); | 433 beforeSlash->append(currLayer->image() ? currLayer->image()->computedCSS
Value() : cssValuePool().createIdentifierValue(CSSValueNone)); |
434 beforeSlash->append(valueForFillRepeat(currLayer->repeatX(), currLayer->
repeatY())); | 434 beforeSlash->append(valueForFillRepeat(currLayer->repeatX(), currLayer->
repeatY())); |
435 beforeSlash->append(cssValuePool().createValue(currLayer->attachment()))
; | 435 beforeSlash->append(cssValuePool().createValue(currLayer->attachment()))
; |
436 beforeSlash->append(createPositionListForLayer(CSSPropertyBackgroundPosi
tion, *currLayer, style)); | 436 beforeSlash->append(createPositionListForLayer(CSSPropertyBackgroundPosi
tion, *currLayer, style)); |
437 list->append(beforeSlash); | 437 list->append(beforeSlash); |
438 RawPtr<CSSValueList> afterSlash = CSSValueList::createSpaceSeparated(); | 438 CSSValueList* afterSlash = CSSValueList::createSpaceSeparated(); |
439 afterSlash->append(valueForFillSize(currLayer->size(), style)); | 439 afterSlash->append(valueForFillSize(currLayer->size(), style)); |
440 afterSlash->append(cssValuePool().createValue(currLayer->origin())); | 440 afterSlash->append(cssValuePool().createValue(currLayer->origin())); |
441 afterSlash->append(cssValuePool().createValue(currLayer->clip())); | 441 afterSlash->append(cssValuePool().createValue(currLayer->clip())); |
442 list->append(afterSlash); | 442 list->append(afterSlash); |
443 ret->append(list); | 443 ret->append(list); |
444 } | 444 } |
445 return ret.release(); | 445 return ret; |
446 } | 446 } |
447 | 447 |
448 static RawPtr<CSSValueList> valueForContentPositionAndDistributionWithOverflowAl
ignment(const StyleContentAlignmentData& data) | 448 static CSSValueList* valueForContentPositionAndDistributionWithOverflowAlignment
(const StyleContentAlignmentData& data) |
449 { | 449 { |
450 RawPtr<CSSValueList> result = CSSValueList::createSpaceSeparated(); | 450 CSSValueList* result = CSSValueList::createSpaceSeparated(); |
451 if (data.distribution() != ContentDistributionDefault) | 451 if (data.distribution() != ContentDistributionDefault) |
452 result->append(CSSPrimitiveValue::create(data.distribution())); | 452 result->append(CSSPrimitiveValue::create(data.distribution())); |
453 if (data.distribution() == ContentDistributionDefault || data.position() !=
ContentPositionNormal) | 453 if (data.distribution() == ContentDistributionDefault || data.position() !=
ContentPositionNormal) |
454 result->append(CSSPrimitiveValue::create(data.position())); | 454 result->append(CSSPrimitiveValue::create(data.position())); |
455 if ((data.position() >= ContentPositionCenter || data.distribution() != Cont
entDistributionDefault) && data.overflow() != OverflowAlignmentDefault) | 455 if ((data.position() >= ContentPositionCenter || data.distribution() != Cont
entDistributionDefault) && data.overflow() != OverflowAlignmentDefault) |
456 result->append(CSSPrimitiveValue::create(data.overflow())); | 456 result->append(CSSPrimitiveValue::create(data.overflow())); |
457 ASSERT(result->length() > 0); | 457 ASSERT(result->length() > 0); |
458 ASSERT(result->length() <= 3); | 458 ASSERT(result->length() <= 3); |
459 return result.release(); | 459 return result; |
460 } | 460 } |
461 | 461 |
462 static RawPtr<CSSPrimitiveValue> valueForLineHeight(const ComputedStyle& style) | 462 static CSSPrimitiveValue* valueForLineHeight(const ComputedStyle& style) |
463 { | 463 { |
464 Length length = style.lineHeight(); | 464 Length length = style.lineHeight(); |
465 if (length.isNegative()) | 465 if (length.isNegative()) |
466 return cssValuePool().createIdentifierValue(CSSValueNormal); | 466 return cssValuePool().createIdentifierValue(CSSValueNormal); |
467 | 467 |
468 return zoomAdjustedPixelValue(floatValueForLength(length, style.getFontDescr
iption().computedSize()), style); | 468 return zoomAdjustedPixelValue(floatValueForLength(length, style.getFontDescr
iption().computedSize()), style); |
469 } | 469 } |
470 | 470 |
471 static CSSValueID identifierForFamily(const AtomicString& family) | 471 static CSSValueID identifierForFamily(const AtomicString& family) |
472 { | 472 { |
473 if (family == FontFamilyNames::webkit_cursive) | 473 if (family == FontFamilyNames::webkit_cursive) |
474 return CSSValueCursive; | 474 return CSSValueCursive; |
475 if (family == FontFamilyNames::webkit_fantasy) | 475 if (family == FontFamilyNames::webkit_fantasy) |
476 return CSSValueFantasy; | 476 return CSSValueFantasy; |
477 if (family == FontFamilyNames::webkit_monospace) | 477 if (family == FontFamilyNames::webkit_monospace) |
478 return CSSValueMonospace; | 478 return CSSValueMonospace; |
479 if (family == FontFamilyNames::webkit_pictograph) | 479 if (family == FontFamilyNames::webkit_pictograph) |
480 return CSSValueWebkitPictograph; | 480 return CSSValueWebkitPictograph; |
481 if (family == FontFamilyNames::webkit_sans_serif) | 481 if (family == FontFamilyNames::webkit_sans_serif) |
482 return CSSValueSansSerif; | 482 return CSSValueSansSerif; |
483 if (family == FontFamilyNames::webkit_serif) | 483 if (family == FontFamilyNames::webkit_serif) |
484 return CSSValueSerif; | 484 return CSSValueSerif; |
485 return CSSValueInvalid; | 485 return CSSValueInvalid; |
486 } | 486 } |
487 | 487 |
488 static RawPtr<CSSValue> valueForFamily(const AtomicString& family) | 488 static CSSValue* valueForFamily(const AtomicString& family) |
489 { | 489 { |
490 if (CSSValueID familyIdentifier = identifierForFamily(family)) | 490 if (CSSValueID familyIdentifier = identifierForFamily(family)) |
491 return cssValuePool().createIdentifierValue(familyIdentifier); | 491 return cssValuePool().createIdentifierValue(familyIdentifier); |
492 return cssValuePool().createFontFamilyValue(family.getString()); | 492 return cssValuePool().createFontFamilyValue(family.getString()); |
493 } | 493 } |
494 | 494 |
495 static RawPtr<CSSValueList> valueForFontFamily(const ComputedStyle& style) | 495 static CSSValueList* valueForFontFamily(const ComputedStyle& style) |
496 { | 496 { |
497 const FontFamily& firstFamily = style.getFontDescription().family(); | 497 const FontFamily& firstFamily = style.getFontDescription().family(); |
498 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); | 498 CSSValueList* list = CSSValueList::createCommaSeparated(); |
499 for (const FontFamily* family = &firstFamily; family; family = family->next(
)) | 499 for (const FontFamily* family = &firstFamily; family; family = family->next(
)) |
500 list->append(valueForFamily(family->family())); | 500 list->append(valueForFamily(family->family())); |
501 return list.release(); | 501 return list; |
502 } | 502 } |
503 | 503 |
504 static RawPtr<CSSPrimitiveValue> valueForFontSize(const ComputedStyle& style) | 504 static CSSPrimitiveValue* valueForFontSize(const ComputedStyle& style) |
505 { | 505 { |
506 return zoomAdjustedPixelValue(style.getFontDescription().computedSize(), sty
le); | 506 return zoomAdjustedPixelValue(style.getFontDescription().computedSize(), sty
le); |
507 } | 507 } |
508 | 508 |
509 static RawPtr<CSSPrimitiveValue> valueForFontStretch(const ComputedStyle& style) | 509 static CSSPrimitiveValue* valueForFontStretch(const ComputedStyle& style) |
510 { | 510 { |
511 return cssValuePool().createValue(style.getFontDescription().stretch()); | 511 return cssValuePool().createValue(style.getFontDescription().stretch()); |
512 } | 512 } |
513 | 513 |
514 static RawPtr<CSSPrimitiveValue> valueForFontStyle(const ComputedStyle& style) | 514 static CSSPrimitiveValue* valueForFontStyle(const ComputedStyle& style) |
515 { | 515 { |
516 return cssValuePool().createValue(style.getFontDescription().style()); | 516 return cssValuePool().createValue(style.getFontDescription().style()); |
517 } | 517 } |
518 | 518 |
519 static RawPtr<CSSPrimitiveValue> valueForFontVariant(const ComputedStyle& style) | 519 static CSSPrimitiveValue* valueForFontVariant(const ComputedStyle& style) |
520 { | 520 { |
521 return cssValuePool().createValue(style.getFontDescription().variant()); | 521 return cssValuePool().createValue(style.getFontDescription().variant()); |
522 } | 522 } |
523 | 523 |
524 static RawPtr<CSSPrimitiveValue> valueForFontWeight(const ComputedStyle& style) | 524 static CSSPrimitiveValue* valueForFontWeight(const ComputedStyle& style) |
525 { | 525 { |
526 return cssValuePool().createValue(style.getFontDescription().weight()); | 526 return cssValuePool().createValue(style.getFontDescription().weight()); |
527 } | 527 } |
528 | 528 |
529 static RawPtr<CSSValue> specifiedValueForGridTrackBreadth(const GridLength& trac
kBreadth, const ComputedStyle& style) | 529 static CSSValue* specifiedValueForGridTrackBreadth(const GridLength& trackBreadt
h, const ComputedStyle& style) |
530 { | 530 { |
531 if (!trackBreadth.isLength()) | 531 if (!trackBreadth.isLength()) |
532 return cssValuePool().createValue(trackBreadth.flex(), CSSPrimitiveValue
::UnitType::Fraction); | 532 return cssValuePool().createValue(trackBreadth.flex(), CSSPrimitiveValue
::UnitType::Fraction); |
533 | 533 |
534 const Length& trackBreadthLength = trackBreadth.length(); | 534 const Length& trackBreadthLength = trackBreadth.length(); |
535 if (trackBreadthLength.isAuto()) | 535 if (trackBreadthLength.isAuto()) |
536 return cssValuePool().createIdentifierValue(CSSValueAuto); | 536 return cssValuePool().createIdentifierValue(CSSValueAuto); |
537 return zoomAdjustedPixelValueForLength(trackBreadthLength, style); | 537 return zoomAdjustedPixelValueForLength(trackBreadthLength, style); |
538 } | 538 } |
539 | 539 |
540 static RawPtr<CSSValue> specifiedValueForGridTrackSize(const GridTrackSize& trac
kSize, const ComputedStyle& style) | 540 static CSSValue* specifiedValueForGridTrackSize(const GridTrackSize& trackSize,
const ComputedStyle& style) |
541 { | 541 { |
542 switch (trackSize.type()) { | 542 switch (trackSize.type()) { |
543 case LengthTrackSizing: | 543 case LengthTrackSizing: |
544 return specifiedValueForGridTrackBreadth(trackSize.length(), style); | 544 return specifiedValueForGridTrackBreadth(trackSize.length(), style); |
545 case MinMaxTrackSizing: | 545 case MinMaxTrackSizing: |
546 RawPtr<CSSFunctionValue> minMaxTrackBreadths = CSSFunctionValue::create(
CSSValueMinmax); | 546 CSSFunctionValue* minMaxTrackBreadths = CSSFunctionValue::create(CSSValu
eMinmax); |
547 minMaxTrackBreadths->append(specifiedValueForGridTrackBreadth(trackSize.
minTrackBreadth(), style)); | 547 minMaxTrackBreadths->append(specifiedValueForGridTrackBreadth(trackSize.
minTrackBreadth(), style)); |
548 minMaxTrackBreadths->append(specifiedValueForGridTrackBreadth(trackSize.
maxTrackBreadth(), style)); | 548 minMaxTrackBreadths->append(specifiedValueForGridTrackBreadth(trackSize.
maxTrackBreadth(), style)); |
549 return minMaxTrackBreadths.release(); | 549 return minMaxTrackBreadths; |
550 } | 550 } |
551 ASSERT_NOT_REACHED(); | 551 ASSERT_NOT_REACHED(); |
552 return nullptr; | 552 return nullptr; |
553 } | 553 } |
554 | 554 |
555 static void addValuesForNamedGridLinesAtIndex(const OrderedNamedGridLines& order
edNamedGridLines, size_t i, CSSValueList& list) | 555 static void addValuesForNamedGridLinesAtIndex(const OrderedNamedGridLines& order
edNamedGridLines, size_t i, CSSValueList& list) |
556 { | 556 { |
557 const Vector<String>& namedGridLines = orderedNamedGridLines.get(i); | 557 const Vector<String>& namedGridLines = orderedNamedGridLines.get(i); |
558 if (namedGridLines.isEmpty()) | 558 if (namedGridLines.isEmpty()) |
559 return; | 559 return; |
560 | 560 |
561 RawPtr<CSSGridLineNamesValue> lineNames = CSSGridLineNamesValue::create(); | 561 CSSGridLineNamesValue* lineNames = CSSGridLineNamesValue::create(); |
562 for (size_t j = 0; j < namedGridLines.size(); ++j) | 562 for (size_t j = 0; j < namedGridLines.size(); ++j) |
563 lineNames->append(CSSCustomIdentValue::create(namedGridLines[j])); | 563 lineNames->append(CSSCustomIdentValue::create(namedGridLines[j])); |
564 list.append(lineNames.release()); | 564 list.append(lineNames); |
565 } | 565 } |
566 | 566 |
567 static RawPtr<CSSValue> valueForGridTrackList(GridTrackSizingDirection direction
, const LayoutObject* layoutObject, const ComputedStyle& style) | 567 static CSSValue* valueForGridTrackList(GridTrackSizingDirection direction, const
LayoutObject* layoutObject, const ComputedStyle& style) |
568 { | 568 { |
569 bool isRowAxis = direction == ForColumns; | 569 bool isRowAxis = direction == ForColumns; |
570 const Vector<GridTrackSize>& trackSizes = isRowAxis ? style.gridTemplateColu
mns() : style.gridTemplateRows(); | 570 const Vector<GridTrackSize>& trackSizes = isRowAxis ? style.gridTemplateColu
mns() : style.gridTemplateRows(); |
571 const Vector<GridTrackSize>& autoRepeatTrackSizes = isRowAxis ? style.gridAu
toRepeatColumns() : style.gridAutoRepeatRows(); | 571 const Vector<GridTrackSize>& autoRepeatTrackSizes = isRowAxis ? style.gridAu
toRepeatColumns() : style.gridAutoRepeatRows(); |
572 const OrderedNamedGridLines& orderedNamedGridLines = isRowAxis ? style.order
edNamedGridColumnLines() : style.orderedNamedGridRowLines(); | 572 const OrderedNamedGridLines& orderedNamedGridLines = isRowAxis ? style.order
edNamedGridColumnLines() : style.orderedNamedGridRowLines(); |
573 | 573 |
574 bool isLayoutGrid = layoutObject && layoutObject->isLayoutGrid(); | 574 bool isLayoutGrid = layoutObject && layoutObject->isLayoutGrid(); |
575 | 575 |
576 // Handle the 'none' case. | 576 // Handle the 'none' case. |
577 bool trackListIsEmpty = trackSizes.isEmpty() && autoRepeatTrackSizes.isEmpty
(); | 577 bool trackListIsEmpty = trackSizes.isEmpty() && autoRepeatTrackSizes.isEmpty
(); |
578 if (isLayoutGrid && trackListIsEmpty) { | 578 if (isLayoutGrid && trackListIsEmpty) { |
579 // For grids we should consider every listed track, whether implicitly o
r explicitly created. If we don't have | 579 // For grids we should consider every listed track, whether implicitly o
r explicitly created. If we don't have |
580 // any explicit track and there are no children then there are no implic
it tracks. We cannot simply check the | 580 // any explicit track and there are no children then there are no implic
it tracks. We cannot simply check the |
581 // number of rows/columns in our internal grid representation because it
's always at least 1x1 (see r143331). | 581 // number of rows/columns in our internal grid representation because it
's always at least 1x1 (see r143331). |
582 trackListIsEmpty = !toLayoutBlock(layoutObject)->firstChild(); | 582 trackListIsEmpty = !toLayoutBlock(layoutObject)->firstChild(); |
583 } | 583 } |
584 | 584 |
585 if (trackListIsEmpty) { | 585 if (trackListIsEmpty) { |
586 ASSERT(orderedNamedGridLines.isEmpty()); | 586 ASSERT(orderedNamedGridLines.isEmpty()); |
587 return cssValuePool().createIdentifierValue(CSSValueNone); | 587 return cssValuePool().createIdentifierValue(CSSValueNone); |
588 } | 588 } |
589 | 589 |
590 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | 590 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
591 size_t insertionIndex; | 591 size_t insertionIndex; |
592 if (isLayoutGrid) { | 592 if (isLayoutGrid) { |
593 const Vector<LayoutUnit>& trackPositions = direction == ForColumns ? toL
ayoutGrid(layoutObject)->columnPositions() : toLayoutGrid(layoutObject)->rowPosi
tions(); | 593 const Vector<LayoutUnit>& trackPositions = direction == ForColumns ? toL
ayoutGrid(layoutObject)->columnPositions() : toLayoutGrid(layoutObject)->rowPosi
tions(); |
594 // There are at least #tracks + 1 grid lines (trackPositions). Apart fro
m that, the grid container can generate implicit grid tracks, | 594 // There are at least #tracks + 1 grid lines (trackPositions). Apart fro
m that, the grid container can generate implicit grid tracks, |
595 // so we'll have more trackPositions than trackSizes as the latter only
contain the explicit grid. | 595 // so we'll have more trackPositions than trackSizes as the latter only
contain the explicit grid. |
596 ASSERT(trackPositions.size() - 1 >= trackSizes.size()); | 596 ASSERT(trackPositions.size() - 1 >= trackSizes.size()); |
597 | 597 |
598 size_t i; | 598 size_t i; |
599 LayoutUnit gutterSize = toLayoutGrid(layoutObject)->guttersSize(directio
n, 2); | 599 LayoutUnit gutterSize = toLayoutGrid(layoutObject)->guttersSize(directio
n, 2); |
600 for (i = 0; i < trackPositions.size() - 2; ++i) { | 600 for (i = 0; i < trackPositions.size() - 2; ++i) { |
601 addValuesForNamedGridLinesAtIndex(orderedNamedGridLines, i, *list); | 601 addValuesForNamedGridLinesAtIndex(orderedNamedGridLines, i, *list); |
602 list->append(zoomAdjustedPixelValue(trackPositions[i + 1] - trackPos
itions[i] - gutterSize, style)); | 602 list->append(zoomAdjustedPixelValue(trackPositions[i + 1] - trackPos
itions[i] - gutterSize, style)); |
603 } | 603 } |
604 // Last track line does not have any gutter. | 604 // Last track line does not have any gutter. |
605 addValuesForNamedGridLinesAtIndex(orderedNamedGridLines, i, *list); | 605 addValuesForNamedGridLinesAtIndex(orderedNamedGridLines, i, *list); |
606 list->append(zoomAdjustedPixelValue(trackPositions[i + 1] - trackPositio
ns[i], style)); | 606 list->append(zoomAdjustedPixelValue(trackPositions[i + 1] - trackPositio
ns[i], style)); |
607 insertionIndex = trackPositions.size() - 1; | 607 insertionIndex = trackPositions.size() - 1; |
608 } else { | 608 } else { |
609 for (size_t i = 0; i < trackSizes.size(); ++i) { | 609 for (size_t i = 0; i < trackSizes.size(); ++i) { |
610 addValuesForNamedGridLinesAtIndex(orderedNamedGridLines, i, *list); | 610 addValuesForNamedGridLinesAtIndex(orderedNamedGridLines, i, *list); |
611 list->append(specifiedValueForGridTrackSize(trackSizes[i], style)); | 611 list->append(specifiedValueForGridTrackSize(trackSizes[i], style)); |
612 } | 612 } |
613 insertionIndex = trackSizes.size(); | 613 insertionIndex = trackSizes.size(); |
614 } | 614 } |
615 // Those are the trailing <string>* allowed in the syntax. | 615 // Those are the trailing <string>* allowed in the syntax. |
616 addValuesForNamedGridLinesAtIndex(orderedNamedGridLines, insertionIndex, *li
st); | 616 addValuesForNamedGridLinesAtIndex(orderedNamedGridLines, insertionIndex, *li
st); |
617 return list.release(); | 617 return list; |
618 } | 618 } |
619 | 619 |
620 static RawPtr<CSSValue> valueForGridPosition(const GridPosition& position) | 620 static CSSValue* valueForGridPosition(const GridPosition& position) |
621 { | 621 { |
622 if (position.isAuto()) | 622 if (position.isAuto()) |
623 return cssValuePool().createIdentifierValue(CSSValueAuto); | 623 return cssValuePool().createIdentifierValue(CSSValueAuto); |
624 | 624 |
625 if (position.isNamedGridArea()) | 625 if (position.isNamedGridArea()) |
626 return CSSCustomIdentValue::create(position.namedGridLine()); | 626 return CSSCustomIdentValue::create(position.namedGridLine()); |
627 | 627 |
628 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | 628 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
629 if (position.isSpan()) { | 629 if (position.isSpan()) { |
630 list->append(cssValuePool().createIdentifierValue(CSSValueSpan)); | 630 list->append(cssValuePool().createIdentifierValue(CSSValueSpan)); |
631 list->append(cssValuePool().createValue(position.spanPosition(), CSSPrim
itiveValue::UnitType::Number)); | 631 list->append(cssValuePool().createValue(position.spanPosition(), CSSPrim
itiveValue::UnitType::Number)); |
632 } else { | 632 } else { |
633 list->append(cssValuePool().createValue(position.integerPosition(), CSSP
rimitiveValue::UnitType::Number)); | 633 list->append(cssValuePool().createValue(position.integerPosition(), CSSP
rimitiveValue::UnitType::Number)); |
634 } | 634 } |
635 | 635 |
636 if (!position.namedGridLine().isNull()) | 636 if (!position.namedGridLine().isNull()) |
637 list->append(CSSCustomIdentValue::create(position.namedGridLine())); | 637 list->append(CSSCustomIdentValue::create(position.namedGridLine())); |
638 return list; | 638 return list; |
639 } | 639 } |
640 | 640 |
641 static LayoutRect sizingBox(const LayoutObject* layoutObject) | 641 static LayoutRect sizingBox(const LayoutObject* layoutObject) |
642 { | 642 { |
643 if (!layoutObject->isBox()) | 643 if (!layoutObject->isBox()) |
644 return LayoutRect(); | 644 return LayoutRect(); |
645 | 645 |
646 const LayoutBox* box = toLayoutBox(layoutObject); | 646 const LayoutBox* box = toLayoutBox(layoutObject); |
647 return box->style()->boxSizing() == BoxSizingBorderBox ? box->borderBoxRect(
) : box->computedCSSContentBoxRect(); | 647 return box->style()->boxSizing() == BoxSizingBorderBox ? box->borderBoxRect(
) : box->computedCSSContentBoxRect(); |
648 } | 648 } |
649 | 649 |
650 static RawPtr<CSSValue> renderTextDecorationFlagsToCSSValue(int textDecoration) | 650 static CSSValue* renderTextDecorationFlagsToCSSValue(int textDecoration) |
651 { | 651 { |
652 // Blink value is ignored. | 652 // Blink value is ignored. |
653 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | 653 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
654 if (textDecoration & TextDecorationUnderline) | 654 if (textDecoration & TextDecorationUnderline) |
655 list->append(cssValuePool().createIdentifierValue(CSSValueUnderline)); | 655 list->append(cssValuePool().createIdentifierValue(CSSValueUnderline)); |
656 if (textDecoration & TextDecorationOverline) | 656 if (textDecoration & TextDecorationOverline) |
657 list->append(cssValuePool().createIdentifierValue(CSSValueOverline)); | 657 list->append(cssValuePool().createIdentifierValue(CSSValueOverline)); |
658 if (textDecoration & TextDecorationLineThrough) | 658 if (textDecoration & TextDecorationLineThrough) |
659 list->append(cssValuePool().createIdentifierValue(CSSValueLineThrough)); | 659 list->append(cssValuePool().createIdentifierValue(CSSValueLineThrough)); |
660 | 660 |
661 if (!list->length()) | 661 if (!list->length()) |
662 return cssValuePool().createIdentifierValue(CSSValueNone); | 662 return cssValuePool().createIdentifierValue(CSSValueNone); |
663 return list.release(); | 663 return list; |
664 } | 664 } |
665 | 665 |
666 static RawPtr<CSSValue> valueForTextDecorationStyle(TextDecorationStyle textDeco
rationStyle) | 666 static CSSValue* valueForTextDecorationStyle(TextDecorationStyle textDecorationS
tyle) |
667 { | 667 { |
668 switch (textDecorationStyle) { | 668 switch (textDecorationStyle) { |
669 case TextDecorationStyleSolid: | 669 case TextDecorationStyleSolid: |
670 return cssValuePool().createIdentifierValue(CSSValueSolid); | 670 return cssValuePool().createIdentifierValue(CSSValueSolid); |
671 case TextDecorationStyleDouble: | 671 case TextDecorationStyleDouble: |
672 return cssValuePool().createIdentifierValue(CSSValueDouble); | 672 return cssValuePool().createIdentifierValue(CSSValueDouble); |
673 case TextDecorationStyleDotted: | 673 case TextDecorationStyleDotted: |
674 return cssValuePool().createIdentifierValue(CSSValueDotted); | 674 return cssValuePool().createIdentifierValue(CSSValueDotted); |
675 case TextDecorationStyleDashed: | 675 case TextDecorationStyleDashed: |
676 return cssValuePool().createIdentifierValue(CSSValueDashed); | 676 return cssValuePool().createIdentifierValue(CSSValueDashed); |
677 case TextDecorationStyleWavy: | 677 case TextDecorationStyleWavy: |
678 return cssValuePool().createIdentifierValue(CSSValueWavy); | 678 return cssValuePool().createIdentifierValue(CSSValueWavy); |
679 } | 679 } |
680 | 680 |
681 ASSERT_NOT_REACHED(); | 681 ASSERT_NOT_REACHED(); |
682 return cssValuePool().createExplicitInitialValue(); | 682 return cssValuePool().createExplicitInitialValue(); |
683 } | 683 } |
684 | 684 |
685 static RawPtr<CSSValue> touchActionFlagsToCSSValue(TouchAction touchAction) | 685 static CSSValue* touchActionFlagsToCSSValue(TouchAction touchAction) |
686 { | 686 { |
687 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | 687 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
688 if (touchAction == TouchActionAuto) { | 688 if (touchAction == TouchActionAuto) { |
689 list->append(cssValuePool().createIdentifierValue(CSSValueAuto)); | 689 list->append(cssValuePool().createIdentifierValue(CSSValueAuto)); |
690 } else if (touchAction == TouchActionNone) { | 690 } else if (touchAction == TouchActionNone) { |
691 list->append(cssValuePool().createIdentifierValue(CSSValueNone)); | 691 list->append(cssValuePool().createIdentifierValue(CSSValueNone)); |
692 } else if (touchAction == TouchActionManipulation) { | 692 } else if (touchAction == TouchActionManipulation) { |
693 list->append(cssValuePool().createIdentifierValue(CSSValueManipulation))
; | 693 list->append(cssValuePool().createIdentifierValue(CSSValueManipulation))
; |
694 } else { | 694 } else { |
695 if ((touchAction & TouchActionPanX) == TouchActionPanX) | 695 if ((touchAction & TouchActionPanX) == TouchActionPanX) |
696 list->append(cssValuePool().createIdentifierValue(CSSValuePanX)); | 696 list->append(cssValuePool().createIdentifierValue(CSSValuePanX)); |
697 else if (touchAction & TouchActionPanLeft) | 697 else if (touchAction & TouchActionPanLeft) |
698 list->append(cssValuePool().createIdentifierValue(CSSValuePanLeft)); | 698 list->append(cssValuePool().createIdentifierValue(CSSValuePanLeft)); |
699 else if (touchAction & TouchActionPanRight) | 699 else if (touchAction & TouchActionPanRight) |
700 list->append(cssValuePool().createIdentifierValue(CSSValuePanRight))
; | 700 list->append(cssValuePool().createIdentifierValue(CSSValuePanRight))
; |
701 | 701 |
702 if ((touchAction & TouchActionPanY) == TouchActionPanY) | 702 if ((touchAction & TouchActionPanY) == TouchActionPanY) |
703 list->append(cssValuePool().createIdentifierValue(CSSValuePanY)); | 703 list->append(cssValuePool().createIdentifierValue(CSSValuePanY)); |
704 else if (touchAction & TouchActionPanUp) | 704 else if (touchAction & TouchActionPanUp) |
705 list->append(cssValuePool().createIdentifierValue(CSSValuePanUp)); | 705 list->append(cssValuePool().createIdentifierValue(CSSValuePanUp)); |
706 else if (touchAction & TouchActionPanDown) | 706 else if (touchAction & TouchActionPanDown) |
707 list->append(cssValuePool().createIdentifierValue(CSSValuePanDown)); | 707 list->append(cssValuePool().createIdentifierValue(CSSValuePanDown)); |
708 } | 708 } |
709 ASSERT(list->length()); | 709 ASSERT(list->length()); |
710 return list.release(); | 710 return list; |
711 } | 711 } |
712 | 712 |
713 static RawPtr<CSSValue> valueForWillChange(const Vector<CSSPropertyID>& willChan
geProperties, bool willChangeContents, bool willChangeScrollPosition) | 713 static CSSValue* valueForWillChange(const Vector<CSSPropertyID>& willChangePrope
rties, bool willChangeContents, bool willChangeScrollPosition) |
714 { | 714 { |
715 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); | 715 CSSValueList* list = CSSValueList::createCommaSeparated(); |
716 if (willChangeContents) | 716 if (willChangeContents) |
717 list->append(cssValuePool().createIdentifierValue(CSSValueContents)); | 717 list->append(cssValuePool().createIdentifierValue(CSSValueContents)); |
718 if (willChangeScrollPosition) | 718 if (willChangeScrollPosition) |
719 list->append(cssValuePool().createIdentifierValue(CSSValueScrollPosition
)); | 719 list->append(cssValuePool().createIdentifierValue(CSSValueScrollPosition
)); |
720 for (size_t i = 0; i < willChangeProperties.size(); ++i) | 720 for (size_t i = 0; i < willChangeProperties.size(); ++i) |
721 list->append(cssValuePool().createIdentifierValue(willChangeProperties[i
])); | 721 list->append(cssValuePool().createIdentifierValue(willChangeProperties[i
])); |
722 if (!list->length()) | 722 if (!list->length()) |
723 list->append(cssValuePool().createIdentifierValue(CSSValueAuto)); | 723 list->append(cssValuePool().createIdentifierValue(CSSValueAuto)); |
724 return list.release(); | 724 return list; |
725 } | 725 } |
726 | 726 |
727 static RawPtr<CSSValue> valueForAnimationDelay(const CSSTimingData* timingData) | 727 static CSSValue* valueForAnimationDelay(const CSSTimingData* timingData) |
728 { | 728 { |
729 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); | 729 CSSValueList* list = CSSValueList::createCommaSeparated(); |
730 if (timingData) { | 730 if (timingData) { |
731 for (size_t i = 0; i < timingData->delayList().size(); ++i) | 731 for (size_t i = 0; i < timingData->delayList().size(); ++i) |
732 list->append(cssValuePool().createValue(timingData->delayList()[i],
CSSPrimitiveValue::UnitType::Seconds)); | 732 list->append(cssValuePool().createValue(timingData->delayList()[i],
CSSPrimitiveValue::UnitType::Seconds)); |
733 } else { | 733 } else { |
734 list->append(cssValuePool().createValue(CSSTimingData::initialDelay(), C
SSPrimitiveValue::UnitType::Seconds)); | 734 list->append(cssValuePool().createValue(CSSTimingData::initialDelay(), C
SSPrimitiveValue::UnitType::Seconds)); |
735 } | 735 } |
736 return list.release(); | 736 return list; |
737 } | 737 } |
738 | 738 |
739 static RawPtr<CSSValue> valueForAnimationDirection(Timing::PlaybackDirection dir
ection) | 739 static CSSValue* valueForAnimationDirection(Timing::PlaybackDirection direction) |
740 { | 740 { |
741 switch (direction) { | 741 switch (direction) { |
742 case Timing::PlaybackDirectionNormal: | 742 case Timing::PlaybackDirectionNormal: |
743 return cssValuePool().createIdentifierValue(CSSValueNormal); | 743 return cssValuePool().createIdentifierValue(CSSValueNormal); |
744 case Timing::PlaybackDirectionAlternate: | 744 case Timing::PlaybackDirectionAlternate: |
745 return cssValuePool().createIdentifierValue(CSSValueAlternate); | 745 return cssValuePool().createIdentifierValue(CSSValueAlternate); |
746 case Timing::PlaybackDirectionReverse: | 746 case Timing::PlaybackDirectionReverse: |
747 return cssValuePool().createIdentifierValue(CSSValueReverse); | 747 return cssValuePool().createIdentifierValue(CSSValueReverse); |
748 case Timing::PlaybackDirectionAlternateReverse: | 748 case Timing::PlaybackDirectionAlternateReverse: |
749 return cssValuePool().createIdentifierValue(CSSValueAlternateReverse); | 749 return cssValuePool().createIdentifierValue(CSSValueAlternateReverse); |
750 default: | 750 default: |
751 ASSERT_NOT_REACHED(); | 751 ASSERT_NOT_REACHED(); |
752 return nullptr; | 752 return nullptr; |
753 } | 753 } |
754 } | 754 } |
755 | 755 |
756 static RawPtr<CSSValue> valueForAnimationDuration(const CSSTimingData* timingDat
a) | 756 static CSSValue* valueForAnimationDuration(const CSSTimingData* timingData) |
757 { | 757 { |
758 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); | 758 CSSValueList* list = CSSValueList::createCommaSeparated(); |
759 if (timingData) { | 759 if (timingData) { |
760 for (size_t i = 0; i < timingData->durationList().size(); ++i) | 760 for (size_t i = 0; i < timingData->durationList().size(); ++i) |
761 list->append(cssValuePool().createValue(timingData->durationList()[i
], CSSPrimitiveValue::UnitType::Seconds)); | 761 list->append(cssValuePool().createValue(timingData->durationList()[i
], CSSPrimitiveValue::UnitType::Seconds)); |
762 } else { | 762 } else { |
763 list->append(cssValuePool().createValue(CSSTimingData::initialDuration()
, CSSPrimitiveValue::UnitType::Seconds)); | 763 list->append(cssValuePool().createValue(CSSTimingData::initialDuration()
, CSSPrimitiveValue::UnitType::Seconds)); |
764 } | 764 } |
765 return list.release(); | 765 return list; |
766 } | 766 } |
767 | 767 |
768 static RawPtr<CSSValue> valueForAnimationFillMode(Timing::FillMode fillMode) | 768 static CSSValue* valueForAnimationFillMode(Timing::FillMode fillMode) |
769 { | 769 { |
770 switch (fillMode) { | 770 switch (fillMode) { |
771 case Timing::FillModeNone: | 771 case Timing::FillModeNone: |
772 return cssValuePool().createIdentifierValue(CSSValueNone); | 772 return cssValuePool().createIdentifierValue(CSSValueNone); |
773 case Timing::FillModeForwards: | 773 case Timing::FillModeForwards: |
774 return cssValuePool().createIdentifierValue(CSSValueForwards); | 774 return cssValuePool().createIdentifierValue(CSSValueForwards); |
775 case Timing::FillModeBackwards: | 775 case Timing::FillModeBackwards: |
776 return cssValuePool().createIdentifierValue(CSSValueBackwards); | 776 return cssValuePool().createIdentifierValue(CSSValueBackwards); |
777 case Timing::FillModeBoth: | 777 case Timing::FillModeBoth: |
778 return cssValuePool().createIdentifierValue(CSSValueBoth); | 778 return cssValuePool().createIdentifierValue(CSSValueBoth); |
779 default: | 779 default: |
780 ASSERT_NOT_REACHED(); | 780 ASSERT_NOT_REACHED(); |
781 return nullptr; | 781 return nullptr; |
782 } | 782 } |
783 } | 783 } |
784 | 784 |
785 static RawPtr<CSSValue> valueForAnimationIterationCount(double iterationCount) | 785 static CSSValue* valueForAnimationIterationCount(double iterationCount) |
786 { | 786 { |
787 if (iterationCount == std::numeric_limits<double>::infinity()) | 787 if (iterationCount == std::numeric_limits<double>::infinity()) |
788 return cssValuePool().createIdentifierValue(CSSValueInfinite); | 788 return cssValuePool().createIdentifierValue(CSSValueInfinite); |
789 return cssValuePool().createValue(iterationCount, CSSPrimitiveValue::UnitTyp
e::Number); | 789 return cssValuePool().createValue(iterationCount, CSSPrimitiveValue::UnitTyp
e::Number); |
790 } | 790 } |
791 | 791 |
792 static RawPtr<CSSValue> valueForAnimationPlayState(EAnimPlayState playState) | 792 static CSSValue* valueForAnimationPlayState(EAnimPlayState playState) |
793 { | 793 { |
794 if (playState == AnimPlayStatePlaying) | 794 if (playState == AnimPlayStatePlaying) |
795 return cssValuePool().createIdentifierValue(CSSValueRunning); | 795 return cssValuePool().createIdentifierValue(CSSValueRunning); |
796 ASSERT(playState == AnimPlayStatePaused); | 796 ASSERT(playState == AnimPlayStatePaused); |
797 return cssValuePool().createIdentifierValue(CSSValuePaused); | 797 return cssValuePool().createIdentifierValue(CSSValuePaused); |
798 } | 798 } |
799 | 799 |
800 static RawPtr<CSSValue> createTimingFunctionValue(const TimingFunction* timingFu
nction) | 800 static CSSValue* createTimingFunctionValue(const TimingFunction* timingFunction) |
801 { | 801 { |
802 switch (timingFunction->type()) { | 802 switch (timingFunction->type()) { |
803 case TimingFunction::kCubicBezierFunction: | 803 case TimingFunction::kCubicBezierFunction: |
804 { | 804 { |
805 const CubicBezierTimingFunction* bezierTimingFunction = toCubicBezie
rTimingFunction(timingFunction); | 805 const CubicBezierTimingFunction* bezierTimingFunction = toCubicBezie
rTimingFunction(timingFunction); |
806 if (bezierTimingFunction->subType() != CubicBezierTimingFunction::Cu
stom) { | 806 if (bezierTimingFunction->subType() != CubicBezierTimingFunction::Cu
stom) { |
807 CSSValueID valueId = CSSValueInvalid; | 807 CSSValueID valueId = CSSValueInvalid; |
808 switch (bezierTimingFunction->subType()) { | 808 switch (bezierTimingFunction->subType()) { |
809 case CubicBezierTimingFunction::Ease: | 809 case CubicBezierTimingFunction::Ease: |
810 valueId = CSSValueEase; | 810 valueId = CSSValueEase; |
(...skipping 27 matching lines...) Expand all Loading... |
838 return CSSStepsTimingFunctionValue::create(steps, position); | 838 return CSSStepsTimingFunctionValue::create(steps, position); |
839 CSSValueID valueId = position == StepsTimingFunction::Start ? CSSVal
ueStepStart : CSSValueStepEnd; | 839 CSSValueID valueId = position == StepsTimingFunction::Start ? CSSVal
ueStepStart : CSSValueStepEnd; |
840 return cssValuePool().createIdentifierValue(valueId); | 840 return cssValuePool().createIdentifierValue(valueId); |
841 } | 841 } |
842 | 842 |
843 default: | 843 default: |
844 return cssValuePool().createIdentifierValue(CSSValueLinear); | 844 return cssValuePool().createIdentifierValue(CSSValueLinear); |
845 } | 845 } |
846 } | 846 } |
847 | 847 |
848 static RawPtr<CSSValue> valueForAnimationTimingFunction(const CSSTimingData* tim
ingData) | 848 static CSSValue* valueForAnimationTimingFunction(const CSSTimingData* timingData
) |
849 { | 849 { |
850 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); | 850 CSSValueList* list = CSSValueList::createCommaSeparated(); |
851 if (timingData) { | 851 if (timingData) { |
852 for (size_t i = 0; i < timingData->timingFunctionList().size(); ++i) | 852 for (size_t i = 0; i < timingData->timingFunctionList().size(); ++i) |
853 list->append(createTimingFunctionValue(timingData->timingFunctionLis
t()[i].get())); | 853 list->append(createTimingFunctionValue(timingData->timingFunctionLis
t()[i].get())); |
854 } else { | 854 } else { |
855 list->append(createTimingFunctionValue(CSSTimingData::initialTimingFunct
ion().get())); | 855 list->append(createTimingFunctionValue(CSSTimingData::initialTimingFunct
ion().get())); |
856 } | 856 } |
857 return list.release(); | 857 return list; |
858 } | 858 } |
859 | 859 |
860 static RawPtr<CSSValueList> valuesForBorderRadiusCorner(LengthSize radius, const
ComputedStyle& style) | 860 static CSSValueList* valuesForBorderRadiusCorner(LengthSize radius, const Comput
edStyle& style) |
861 { | 861 { |
862 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | 862 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
863 if (radius.width().type() == Percent) | 863 if (radius.width().type() == Percent) |
864 list->append(cssValuePool().createValue(radius.width().percent(), CSSPri
mitiveValue::UnitType::Percentage)); | 864 list->append(cssValuePool().createValue(radius.width().percent(), CSSPri
mitiveValue::UnitType::Percentage)); |
865 else | 865 else |
866 list->append(zoomAdjustedPixelValueForLength(radius.width(), style)); | 866 list->append(zoomAdjustedPixelValueForLength(radius.width(), style)); |
867 if (radius.height().type() == Percent) | 867 if (radius.height().type() == Percent) |
868 list->append(cssValuePool().createValue(radius.height().percent(), CSSPr
imitiveValue::UnitType::Percentage)); | 868 list->append(cssValuePool().createValue(radius.height().percent(), CSSPr
imitiveValue::UnitType::Percentage)); |
869 else | 869 else |
870 list->append(zoomAdjustedPixelValueForLength(radius.height(), style)); | 870 list->append(zoomAdjustedPixelValueForLength(radius.height(), style)); |
871 return list.release(); | 871 return list; |
872 } | 872 } |
873 | 873 |
874 static RawPtr<CSSValue> valueForBorderRadiusCorner(LengthSize radius, const Comp
utedStyle& style) | 874 static CSSValue* valueForBorderRadiusCorner(LengthSize radius, const ComputedSty
le& style) |
875 { | 875 { |
876 RawPtr<CSSValueList> list = valuesForBorderRadiusCorner(radius, style); | 876 CSSValueList* list = valuesForBorderRadiusCorner(radius, style); |
877 if (list->item(0)->equals(*list->item(1))) | 877 if (list->item(0)->equals(*list->item(1))) |
878 return list->item(0); | 878 return list->item(0); |
879 return list.release(); | 879 return list; |
880 } | 880 } |
881 | 881 |
882 static RawPtr<CSSFunctionValue> valueForMatrixTransform(const TransformationMatr
ix& transform, const ComputedStyle& style) | 882 static CSSFunctionValue* valueForMatrixTransform(const TransformationMatrix& tra
nsform, const ComputedStyle& style) |
883 { | 883 { |
884 RawPtr<CSSFunctionValue> transformValue = nullptr; | 884 CSSFunctionValue* transformValue = nullptr; |
885 if (transform.isAffine()) { | 885 if (transform.isAffine()) { |
886 transformValue = CSSFunctionValue::create(CSSValueMatrix); | 886 transformValue = CSSFunctionValue::create(CSSValueMatrix); |
887 | 887 |
888 transformValue->append(cssValuePool().createValue(transform.a(), CSSPrim
itiveValue::UnitType::Number)); | 888 transformValue->append(cssValuePool().createValue(transform.a(), CSSPrim
itiveValue::UnitType::Number)); |
889 transformValue->append(cssValuePool().createValue(transform.b(), CSSPrim
itiveValue::UnitType::Number)); | 889 transformValue->append(cssValuePool().createValue(transform.b(), CSSPrim
itiveValue::UnitType::Number)); |
890 transformValue->append(cssValuePool().createValue(transform.c(), CSSPrim
itiveValue::UnitType::Number)); | 890 transformValue->append(cssValuePool().createValue(transform.c(), CSSPrim
itiveValue::UnitType::Number)); |
891 transformValue->append(cssValuePool().createValue(transform.d(), CSSPrim
itiveValue::UnitType::Number)); | 891 transformValue->append(cssValuePool().createValue(transform.d(), CSSPrim
itiveValue::UnitType::Number)); |
892 transformValue->append(zoomAdjustedNumberValue(transform.e(), style)); | 892 transformValue->append(zoomAdjustedNumberValue(transform.e(), style)); |
893 transformValue->append(zoomAdjustedNumberValue(transform.f(), style)); | 893 transformValue->append(zoomAdjustedNumberValue(transform.f(), style)); |
894 } else { | 894 } else { |
(...skipping 13 matching lines...) Expand all Loading... |
908 transformValue->append(cssValuePool().createValue(transform.m32(), CSSPr
imitiveValue::UnitType::Number)); | 908 transformValue->append(cssValuePool().createValue(transform.m32(), CSSPr
imitiveValue::UnitType::Number)); |
909 transformValue->append(cssValuePool().createValue(transform.m33(), CSSPr
imitiveValue::UnitType::Number)); | 909 transformValue->append(cssValuePool().createValue(transform.m33(), CSSPr
imitiveValue::UnitType::Number)); |
910 transformValue->append(cssValuePool().createValue(transform.m34(), CSSPr
imitiveValue::UnitType::Number)); | 910 transformValue->append(cssValuePool().createValue(transform.m34(), CSSPr
imitiveValue::UnitType::Number)); |
911 | 911 |
912 transformValue->append(zoomAdjustedNumberValue(transform.m41(), style)); | 912 transformValue->append(zoomAdjustedNumberValue(transform.m41(), style)); |
913 transformValue->append(zoomAdjustedNumberValue(transform.m42(), style)); | 913 transformValue->append(zoomAdjustedNumberValue(transform.m42(), style)); |
914 transformValue->append(zoomAdjustedNumberValue(transform.m43(), style)); | 914 transformValue->append(zoomAdjustedNumberValue(transform.m43(), style)); |
915 transformValue->append(cssValuePool().createValue(transform.m44(), CSSPr
imitiveValue::UnitType::Number)); | 915 transformValue->append(cssValuePool().createValue(transform.m44(), CSSPr
imitiveValue::UnitType::Number)); |
916 } | 916 } |
917 | 917 |
918 return transformValue.release(); | 918 return transformValue; |
919 } | 919 } |
920 | 920 |
921 static RawPtr<CSSValue> computedTransform(const LayoutObject* layoutObject, cons
t ComputedStyle& style) | 921 static CSSValue* computedTransform(const LayoutObject* layoutObject, const Compu
tedStyle& style) |
922 { | 922 { |
923 if (!layoutObject || !style.hasTransform()) | 923 if (!layoutObject || !style.hasTransform()) |
924 return cssValuePool().createIdentifierValue(CSSValueNone); | 924 return cssValuePool().createIdentifierValue(CSSValueNone); |
925 | 925 |
926 IntRect box; | 926 IntRect box; |
927 if (layoutObject->isBox()) | 927 if (layoutObject->isBox()) |
928 box = pixelSnappedIntRect(toLayoutBox(layoutObject)->borderBoxRect()); | 928 box = pixelSnappedIntRect(toLayoutBox(layoutObject)->borderBoxRect()); |
929 | 929 |
930 TransformationMatrix transform; | 930 TransformationMatrix transform; |
931 style.applyTransform(transform, LayoutSize(box.size()), ComputedStyle::Exclu
deTransformOrigin, ComputedStyle::ExcludeMotionPath, ComputedStyle::ExcludeIndep
endentTransformProperties); | 931 style.applyTransform(transform, LayoutSize(box.size()), ComputedStyle::Exclu
deTransformOrigin, ComputedStyle::ExcludeMotionPath, ComputedStyle::ExcludeIndep
endentTransformProperties); |
932 | 932 |
933 // FIXME: Need to print out individual functions (https://bugs.webkit.org/sh
ow_bug.cgi?id=23924) | 933 // FIXME: Need to print out individual functions (https://bugs.webkit.org/sh
ow_bug.cgi?id=23924) |
934 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | 934 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
935 list->append(valueForMatrixTransform(transform, style)); | 935 list->append(valueForMatrixTransform(transform, style)); |
936 | 936 |
937 return list.release(); | 937 return list; |
938 } | 938 } |
939 | 939 |
940 static RawPtr<CSSValue> createTransitionPropertyValue(const CSSTransitionData::T
ransitionProperty& property) | 940 static CSSValue* createTransitionPropertyValue(const CSSTransitionData::Transiti
onProperty& property) |
941 { | 941 { |
942 if (property.propertyType == CSSTransitionData::TransitionNone) | 942 if (property.propertyType == CSSTransitionData::TransitionNone) |
943 return cssValuePool().createIdentifierValue(CSSValueNone); | 943 return cssValuePool().createIdentifierValue(CSSValueNone); |
944 if (property.propertyType == CSSTransitionData::TransitionUnknownProperty) | 944 if (property.propertyType == CSSTransitionData::TransitionUnknownProperty) |
945 return CSSCustomIdentValue::create(property.propertyString); | 945 return CSSCustomIdentValue::create(property.propertyString); |
946 ASSERT(property.propertyType == CSSTransitionData::TransitionKnownProperty); | 946 ASSERT(property.propertyType == CSSTransitionData::TransitionKnownProperty); |
947 return CSSCustomIdentValue::create(getPropertyNameString(property.unresolved
Property)); | 947 return CSSCustomIdentValue::create(getPropertyNameString(property.unresolved
Property)); |
948 } | 948 } |
949 | 949 |
950 static RawPtr<CSSValue> valueForTransitionProperty(const CSSTransitionData* tran
sitionData) | 950 static CSSValue* valueForTransitionProperty(const CSSTransitionData* transitionD
ata) |
951 { | 951 { |
952 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); | 952 CSSValueList* list = CSSValueList::createCommaSeparated(); |
953 if (transitionData) { | 953 if (transitionData) { |
954 for (size_t i = 0; i < transitionData->propertyList().size(); ++i) | 954 for (size_t i = 0; i < transitionData->propertyList().size(); ++i) |
955 list->append(createTransitionPropertyValue(transitionData->propertyL
ist()[i])); | 955 list->append(createTransitionPropertyValue(transitionData->propertyL
ist()[i])); |
956 } else { | 956 } else { |
957 list->append(cssValuePool().createIdentifierValue(CSSValueAll)); | 957 list->append(cssValuePool().createIdentifierValue(CSSValueAll)); |
958 } | 958 } |
959 return list.release(); | 959 return list; |
960 } | 960 } |
961 | 961 |
962 CSSValueID valueForQuoteType(const QuoteType quoteType) | 962 CSSValueID valueForQuoteType(const QuoteType quoteType) |
963 { | 963 { |
964 switch (quoteType) { | 964 switch (quoteType) { |
965 case NO_OPEN_QUOTE: | 965 case NO_OPEN_QUOTE: |
966 return CSSValueNoOpenQuote; | 966 return CSSValueNoOpenQuote; |
967 case NO_CLOSE_QUOTE: | 967 case NO_CLOSE_QUOTE: |
968 return CSSValueNoCloseQuote; | 968 return CSSValueNoCloseQuote; |
969 case CLOSE_QUOTE: | 969 case CLOSE_QUOTE: |
970 return CSSValueCloseQuote; | 970 return CSSValueCloseQuote; |
971 case OPEN_QUOTE: | 971 case OPEN_QUOTE: |
972 return CSSValueOpenQuote; | 972 return CSSValueOpenQuote; |
973 } | 973 } |
974 ASSERT_NOT_REACHED(); | 974 ASSERT_NOT_REACHED(); |
975 return CSSValueInvalid; | 975 return CSSValueInvalid; |
976 } | 976 } |
977 | 977 |
978 static RawPtr<CSSValue> valueForContentData(const ComputedStyle& style) | 978 static CSSValue* valueForContentData(const ComputedStyle& style) |
979 { | 979 { |
980 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | 980 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
981 for (const ContentData* contentData = style.contentData(); contentData; cont
entData = contentData->next()) { | 981 for (const ContentData* contentData = style.contentData(); contentData; cont
entData = contentData->next()) { |
982 if (contentData->isCounter()) { | 982 if (contentData->isCounter()) { |
983 const CounterContent* counter = toCounterContentData(contentData)->c
ounter(); | 983 const CounterContent* counter = toCounterContentData(contentData)->c
ounter(); |
984 ASSERT(counter); | 984 ASSERT(counter); |
985 RawPtr<CSSCustomIdentValue> identifier = CSSCustomIdentValue::create
(counter->identifier()); | 985 CSSCustomIdentValue* identifier = CSSCustomIdentValue::create(counte
r->identifier()); |
986 RawPtr<CSSCustomIdentValue> separator = CSSCustomIdentValue::create(
counter->separator()); | 986 CSSCustomIdentValue* separator = CSSCustomIdentValue::create(counter
->separator()); |
987 CSSValueID listStyleIdent = CSSValueNone; | 987 CSSValueID listStyleIdent = CSSValueNone; |
988 if (counter->listStyle() != NoneListStyle) | 988 if (counter->listStyle() != NoneListStyle) |
989 listStyleIdent = static_cast<CSSValueID>(CSSValueDisc + counter-
>listStyle()); | 989 listStyleIdent = static_cast<CSSValueID>(CSSValueDisc + counter-
>listStyle()); |
990 RawPtr<CSSPrimitiveValue> listStyle = cssValuePool().createIdentifie
rValue(listStyleIdent); | 990 CSSPrimitiveValue* listStyle = cssValuePool().createIdentifierValue(
listStyleIdent); |
991 list->append(CSSCounterValue::create(identifier.release(), listStyle
.release(), separator.release())); | 991 list->append(CSSCounterValue::create(identifier, listStyle, separato
r)); |
992 } else if (contentData->isImage()) { | 992 } else if (contentData->isImage()) { |
993 const StyleImage* image = toImageContentData(contentData)->image(); | 993 const StyleImage* image = toImageContentData(contentData)->image(); |
994 ASSERT(image); | 994 ASSERT(image); |
995 list->append(image->computedCSSValue()); | 995 list->append(image->computedCSSValue()); |
996 } else if (contentData->isText()) { | 996 } else if (contentData->isText()) { |
997 list->append(CSSStringValue::create(toTextContentData(contentData)->
text())); | 997 list->append(CSSStringValue::create(toTextContentData(contentData)->
text())); |
998 } else if (contentData->isQuote()) { | 998 } else if (contentData->isQuote()) { |
999 const QuoteType quoteType = toQuoteContentData(contentData)->quote()
; | 999 const QuoteType quoteType = toQuoteContentData(contentData)->quote()
; |
1000 list->append(cssValuePool().createIdentifierValue(valueForQuoteType(
quoteType))); | 1000 list->append(cssValuePool().createIdentifierValue(valueForQuoteType(
quoteType))); |
1001 } else { | 1001 } else { |
1002 ASSERT_NOT_REACHED(); | 1002 ASSERT_NOT_REACHED(); |
1003 } | 1003 } |
1004 } | 1004 } |
1005 return list.release(); | 1005 return list; |
1006 } | 1006 } |
1007 | 1007 |
1008 static RawPtr<CSSValue> valueForCounterDirectives(const ComputedStyle& style, CS
SPropertyID propertyID) | 1008 static CSSValue* valueForCounterDirectives(const ComputedStyle& style, CSSProper
tyID propertyID) |
1009 { | 1009 { |
1010 const CounterDirectiveMap* map = style.counterDirectives(); | 1010 const CounterDirectiveMap* map = style.counterDirectives(); |
1011 if (!map) | 1011 if (!map) |
1012 return cssValuePool().createIdentifierValue(CSSValueNone); | 1012 return cssValuePool().createIdentifierValue(CSSValueNone); |
1013 | 1013 |
1014 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | 1014 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
1015 for (const auto& item : *map) { | 1015 for (const auto& item : *map) { |
1016 bool isValidCounterValue = propertyID == CSSPropertyCounterIncrement ? i
tem.value.isIncrement() : item.value.isReset(); | 1016 bool isValidCounterValue = propertyID == CSSPropertyCounterIncrement ? i
tem.value.isIncrement() : item.value.isReset(); |
1017 if (!isValidCounterValue) | 1017 if (!isValidCounterValue) |
1018 continue; | 1018 continue; |
1019 | 1019 |
1020 list->append(CSSCustomIdentValue::create(item.key)); | 1020 list->append(CSSCustomIdentValue::create(item.key)); |
1021 short number = propertyID == CSSPropertyCounterIncrement ? item.value.in
crementValue() : item.value.resetValue(); | 1021 short number = propertyID == CSSPropertyCounterIncrement ? item.value.in
crementValue() : item.value.resetValue(); |
1022 list->append(cssValuePool().createValue((double)number, CSSPrimitiveValu
e::UnitType::Integer)); | 1022 list->append(cssValuePool().createValue((double)number, CSSPrimitiveValu
e::UnitType::Integer)); |
1023 } | 1023 } |
1024 | 1024 |
1025 if (!list->length()) | 1025 if (!list->length()) |
1026 return cssValuePool().createIdentifierValue(CSSValueNone); | 1026 return cssValuePool().createIdentifierValue(CSSValueNone); |
1027 | 1027 |
1028 return list.release(); | 1028 return list; |
1029 } | 1029 } |
1030 | 1030 |
1031 static RawPtr<CSSValue> valueForShape(const ComputedStyle& style, ShapeValue* sh
apeValue) | 1031 static CSSValue* valueForShape(const ComputedStyle& style, ShapeValue* shapeValu
e) |
1032 { | 1032 { |
1033 if (!shapeValue) | 1033 if (!shapeValue) |
1034 return cssValuePool().createIdentifierValue(CSSValueNone); | 1034 return cssValuePool().createIdentifierValue(CSSValueNone); |
1035 if (shapeValue->type() == ShapeValue::Box) | 1035 if (shapeValue->type() == ShapeValue::Box) |
1036 return cssValuePool().createValue(shapeValue->cssBox()); | 1036 return cssValuePool().createValue(shapeValue->cssBox()); |
1037 if (shapeValue->type() == ShapeValue::Image) { | 1037 if (shapeValue->type() == ShapeValue::Image) { |
1038 if (shapeValue->image()) | 1038 if (shapeValue->image()) |
1039 return shapeValue->image()->computedCSSValue(); | 1039 return shapeValue->image()->computedCSSValue(); |
1040 return cssValuePool().createIdentifierValue(CSSValueNone); | 1040 return cssValuePool().createIdentifierValue(CSSValueNone); |
1041 } | 1041 } |
1042 | 1042 |
1043 ASSERT(shapeValue->type() == ShapeValue::Shape); | 1043 ASSERT(shapeValue->type() == ShapeValue::Shape); |
1044 | 1044 |
1045 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | 1045 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
1046 list->append(valueForBasicShape(style, shapeValue->shape())); | 1046 list->append(valueForBasicShape(style, shapeValue->shape())); |
1047 if (shapeValue->cssBox() != BoxMissing) | 1047 if (shapeValue->cssBox() != BoxMissing) |
1048 list->append(cssValuePool().createValue(shapeValue->cssBox())); | 1048 list->append(cssValuePool().createValue(shapeValue->cssBox())); |
1049 return list.release(); | 1049 return list; |
1050 } | 1050 } |
1051 | 1051 |
1052 static RawPtr<CSSValueList> valuesForSidesShorthand(const StylePropertyShorthand
& shorthand, const ComputedStyle& style, const LayoutObject* layoutObject, Node*
styledNode, bool allowVisitedStyle) | 1052 static CSSValueList* valuesForSidesShorthand(const StylePropertyShorthand& short
hand, const ComputedStyle& style, const LayoutObject* layoutObject, Node* styled
Node, bool allowVisitedStyle) |
1053 { | 1053 { |
1054 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | 1054 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
1055 // Assume the properties are in the usual order top, right, bottom, left. | 1055 // Assume the properties are in the usual order top, right, bottom, left. |
1056 RawPtr<CSSValue> topValue = ComputedStyleCSSValueMapping::get(shorthand.prop
erties()[0], style, layoutObject, styledNode, allowVisitedStyle); | 1056 CSSValue* topValue = ComputedStyleCSSValueMapping::get(shorthand.properties(
)[0], style, layoutObject, styledNode, allowVisitedStyle); |
1057 RawPtr<CSSValue> rightValue = ComputedStyleCSSValueMapping::get(shorthand.pr
operties()[1], style, layoutObject, styledNode, allowVisitedStyle); | 1057 CSSValue* rightValue = ComputedStyleCSSValueMapping::get(shorthand.propertie
s()[1], style, layoutObject, styledNode, allowVisitedStyle); |
1058 RawPtr<CSSValue> bottomValue = ComputedStyleCSSValueMapping::get(shorthand.p
roperties()[2], style, layoutObject, styledNode, allowVisitedStyle); | 1058 CSSValue* bottomValue = ComputedStyleCSSValueMapping::get(shorthand.properti
es()[2], style, layoutObject, styledNode, allowVisitedStyle); |
1059 RawPtr<CSSValue> leftValue = ComputedStyleCSSValueMapping::get(shorthand.pro
perties()[3], style, layoutObject, styledNode, allowVisitedStyle); | 1059 CSSValue* leftValue = ComputedStyleCSSValueMapping::get(shorthand.properties
()[3], style, layoutObject, styledNode, allowVisitedStyle); |
1060 | 1060 |
1061 // All 4 properties must be specified. | 1061 // All 4 properties must be specified. |
1062 if (!topValue || !rightValue || !bottomValue || !leftValue) | 1062 if (!topValue || !rightValue || !bottomValue || !leftValue) |
1063 return nullptr; | 1063 return nullptr; |
1064 | 1064 |
1065 bool showLeft = !compareCSSValuePtr(rightValue, leftValue); | 1065 bool showLeft = !compareCSSValuePtr(rightValue, leftValue); |
1066 bool showBottom = !compareCSSValuePtr(topValue, bottomValue) || showLeft; | 1066 bool showBottom = !compareCSSValuePtr(topValue, bottomValue) || showLeft; |
1067 bool showRight = !compareCSSValuePtr(topValue, rightValue) || showBottom; | 1067 bool showRight = !compareCSSValuePtr(topValue, rightValue) || showBottom; |
1068 | 1068 |
1069 list->append(topValue.release()); | 1069 list->append(topValue); |
1070 if (showRight) | 1070 if (showRight) |
1071 list->append(rightValue.release()); | 1071 list->append(rightValue); |
1072 if (showBottom) | 1072 if (showBottom) |
1073 list->append(bottomValue.release()); | 1073 list->append(bottomValue); |
1074 if (showLeft) | 1074 if (showLeft) |
1075 list->append(leftValue.release()); | 1075 list->append(leftValue); |
1076 | 1076 |
1077 return list.release(); | 1077 return list; |
1078 } | 1078 } |
1079 | 1079 |
1080 static RawPtr<CSSValueList> valueForBorderRadiusShorthand(const ComputedStyle& s
tyle) | 1080 static CSSValueList* valueForBorderRadiusShorthand(const ComputedStyle& style) |
1081 { | 1081 { |
1082 RawPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); | 1082 CSSValueList* list = CSSValueList::createSlashSeparated(); |
1083 | 1083 |
1084 bool showHorizontalBottomLeft = style.borderTopRightRadius().width() != styl
e.borderBottomLeftRadius().width(); | 1084 bool showHorizontalBottomLeft = style.borderTopRightRadius().width() != styl
e.borderBottomLeftRadius().width(); |
1085 bool showHorizontalBottomRight = showHorizontalBottomLeft || (style.borderBo
ttomRightRadius().width() != style.borderTopLeftRadius().width()); | 1085 bool showHorizontalBottomRight = showHorizontalBottomLeft || (style.borderBo
ttomRightRadius().width() != style.borderTopLeftRadius().width()); |
1086 bool showHorizontalTopRight = showHorizontalBottomRight || (style.borderTopR
ightRadius().width() != style.borderTopLeftRadius().width()); | 1086 bool showHorizontalTopRight = showHorizontalBottomRight || (style.borderTopR
ightRadius().width() != style.borderTopLeftRadius().width()); |
1087 | 1087 |
1088 bool showVerticalBottomLeft = style.borderTopRightRadius().height() != style
.borderBottomLeftRadius().height(); | 1088 bool showVerticalBottomLeft = style.borderTopRightRadius().height() != style
.borderBottomLeftRadius().height(); |
1089 bool showVerticalBottomRight = showVerticalBottomLeft || (style.borderBottom
RightRadius().height() != style.borderTopLeftRadius().height()); | 1089 bool showVerticalBottomRight = showVerticalBottomLeft || (style.borderBottom
RightRadius().height() != style.borderTopLeftRadius().height()); |
1090 bool showVerticalTopRight = showVerticalBottomRight || (style.borderTopRight
Radius().height() != style.borderTopLeftRadius().height()); | 1090 bool showVerticalTopRight = showVerticalBottomRight || (style.borderTopRight
Radius().height() != style.borderTopLeftRadius().height()); |
1091 | 1091 |
1092 RawPtr<CSSValueList> topLeftRadius = valuesForBorderRadiusCorner(style.borde
rTopLeftRadius(), style); | 1092 CSSValueList* topLeftRadius = valuesForBorderRadiusCorner(style.borderTopLef
tRadius(), style); |
1093 RawPtr<CSSValueList> topRightRadius = valuesForBorderRadiusCorner(style.bord
erTopRightRadius(), style); | 1093 CSSValueList* topRightRadius = valuesForBorderRadiusCorner(style.borderTopRi
ghtRadius(), style); |
1094 RawPtr<CSSValueList> bottomRightRadius = valuesForBorderRadiusCorner(style.b
orderBottomRightRadius(), style); | 1094 CSSValueList* bottomRightRadius = valuesForBorderRadiusCorner(style.borderBo
ttomRightRadius(), style); |
1095 RawPtr<CSSValueList> bottomLeftRadius = valuesForBorderRadiusCorner(style.bo
rderBottomLeftRadius(), style); | 1095 CSSValueList* bottomLeftRadius = valuesForBorderRadiusCorner(style.borderBot
tomLeftRadius(), style); |
1096 | 1096 |
1097 RawPtr<CSSValueList> horizontalRadii = CSSValueList::createSpaceSeparated(); | 1097 CSSValueList* horizontalRadii = CSSValueList::createSpaceSeparated(); |
1098 horizontalRadii->append(topLeftRadius->item(0)); | 1098 horizontalRadii->append(topLeftRadius->item(0)); |
1099 if (showHorizontalTopRight) | 1099 if (showHorizontalTopRight) |
1100 horizontalRadii->append(topRightRadius->item(0)); | 1100 horizontalRadii->append(topRightRadius->item(0)); |
1101 if (showHorizontalBottomRight) | 1101 if (showHorizontalBottomRight) |
1102 horizontalRadii->append(bottomRightRadius->item(0)); | 1102 horizontalRadii->append(bottomRightRadius->item(0)); |
1103 if (showHorizontalBottomLeft) | 1103 if (showHorizontalBottomLeft) |
1104 horizontalRadii->append(bottomLeftRadius->item(0)); | 1104 horizontalRadii->append(bottomLeftRadius->item(0)); |
1105 | 1105 |
1106 list->append(horizontalRadii.release()); | 1106 list->append(horizontalRadii); |
1107 | 1107 |
1108 RawPtr<CSSValueList> verticalRadii = CSSValueList::createSpaceSeparated(); | 1108 CSSValueList* verticalRadii = CSSValueList::createSpaceSeparated(); |
1109 verticalRadii->append(topLeftRadius->item(1)); | 1109 verticalRadii->append(topLeftRadius->item(1)); |
1110 if (showVerticalTopRight) | 1110 if (showVerticalTopRight) |
1111 verticalRadii->append(topRightRadius->item(1)); | 1111 verticalRadii->append(topRightRadius->item(1)); |
1112 if (showVerticalBottomRight) | 1112 if (showVerticalBottomRight) |
1113 verticalRadii->append(bottomRightRadius->item(1)); | 1113 verticalRadii->append(bottomRightRadius->item(1)); |
1114 if (showVerticalBottomLeft) | 1114 if (showVerticalBottomLeft) |
1115 verticalRadii->append(bottomLeftRadius->item(1)); | 1115 verticalRadii->append(bottomLeftRadius->item(1)); |
1116 | 1116 |
1117 if (!verticalRadii->equals(*toCSSValueList(list->item(0)))) | 1117 if (!verticalRadii->equals(*toCSSValueList(list->item(0)))) |
1118 list->append(verticalRadii.release()); | 1118 list->append(verticalRadii); |
1119 | 1119 |
1120 return list.release(); | 1120 return list; |
1121 } | 1121 } |
1122 | 1122 |
1123 static RawPtr<CSSValue> strokeDashArrayToCSSValueList(const SVGDashArray& dashes
, const ComputedStyle& style) | 1123 static CSSValue* strokeDashArrayToCSSValueList(const SVGDashArray& dashes, const
ComputedStyle& style) |
1124 { | 1124 { |
1125 if (dashes.isEmpty()) | 1125 if (dashes.isEmpty()) |
1126 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 1126 return CSSPrimitiveValue::createIdentifier(CSSValueNone); |
1127 | 1127 |
1128 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); | 1128 CSSValueList* list = CSSValueList::createCommaSeparated(); |
1129 for (const Length& dashLength : dashes.vector()) | 1129 for (const Length& dashLength : dashes.vector()) |
1130 list->append(zoomAdjustedPixelValueForLength(dashLength, style)); | 1130 list->append(zoomAdjustedPixelValueForLength(dashLength, style)); |
1131 | 1131 |
1132 return list.release(); | 1132 return list; |
1133 } | 1133 } |
1134 | 1134 |
1135 static RawPtr<CSSValue> paintOrderToCSSValueList(const SVGComputedStyle& svgStyl
e) | 1135 static CSSValue* paintOrderToCSSValueList(const SVGComputedStyle& svgStyle) |
1136 { | 1136 { |
1137 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | 1137 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
1138 for (int i = 0; i < 3; i++) { | 1138 for (int i = 0; i < 3; i++) { |
1139 EPaintOrderType paintOrderType = svgStyle.paintOrderType(i); | 1139 EPaintOrderType paintOrderType = svgStyle.paintOrderType(i); |
1140 switch (paintOrderType) { | 1140 switch (paintOrderType) { |
1141 case PT_FILL: | 1141 case PT_FILL: |
1142 case PT_STROKE: | 1142 case PT_STROKE: |
1143 case PT_MARKERS: | 1143 case PT_MARKERS: |
1144 list->append(CSSPrimitiveValue::create(paintOrderType)); | 1144 list->append(CSSPrimitiveValue::create(paintOrderType)); |
1145 break; | 1145 break; |
1146 case PT_NONE: | 1146 case PT_NONE: |
1147 default: | 1147 default: |
1148 ASSERT_NOT_REACHED(); | 1148 ASSERT_NOT_REACHED(); |
1149 break; | 1149 break; |
1150 } | 1150 } |
1151 } | 1151 } |
1152 | 1152 |
1153 return list.release(); | 1153 return list; |
1154 } | 1154 } |
1155 | 1155 |
1156 static RawPtr<CSSValue> adjustSVGPaintForCurrentColor(SVGPaintType paintType, co
nst String& url, const Color& color, const Color& currentColor) | 1156 static CSSValue* adjustSVGPaintForCurrentColor(SVGPaintType paintType, const Str
ing& url, const Color& color, const Color& currentColor) |
1157 { | 1157 { |
1158 if (paintType >= SVG_PAINTTYPE_URI_NONE) { | 1158 if (paintType >= SVG_PAINTTYPE_URI_NONE) { |
1159 RawPtr<CSSValueList> values = CSSValueList::createSpaceSeparated(); | 1159 CSSValueList* values = CSSValueList::createSpaceSeparated(); |
1160 values->append(CSSURIValue::create(url)); | 1160 values->append(CSSURIValue::create(url)); |
1161 if (paintType == SVG_PAINTTYPE_URI_NONE) | 1161 if (paintType == SVG_PAINTTYPE_URI_NONE) |
1162 values->append(CSSPrimitiveValue::createIdentifier(CSSValueNone)); | 1162 values->append(CSSPrimitiveValue::createIdentifier(CSSValueNone)); |
1163 else if (paintType == SVG_PAINTTYPE_URI_CURRENTCOLOR) | 1163 else if (paintType == SVG_PAINTTYPE_URI_CURRENTCOLOR) |
1164 values->append(CSSColorValue::create(currentColor.rgb())); | 1164 values->append(CSSColorValue::create(currentColor.rgb())); |
1165 else if (paintType == SVG_PAINTTYPE_URI_RGBCOLOR) | 1165 else if (paintType == SVG_PAINTTYPE_URI_RGBCOLOR) |
1166 values->append(CSSColorValue::create(color.rgb())); | 1166 values->append(CSSColorValue::create(color.rgb())); |
1167 return values.release(); | 1167 return values; |
1168 } | 1168 } |
1169 if (paintType == SVG_PAINTTYPE_NONE) | 1169 if (paintType == SVG_PAINTTYPE_NONE) |
1170 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 1170 return CSSPrimitiveValue::createIdentifier(CSSValueNone); |
1171 if (paintType == SVG_PAINTTYPE_CURRENTCOLOR) | 1171 if (paintType == SVG_PAINTTYPE_CURRENTCOLOR) |
1172 return CSSColorValue::create(currentColor.rgb()); | 1172 return CSSColorValue::create(currentColor.rgb()); |
1173 | 1173 |
1174 return CSSColorValue::create(color.rgb()); | 1174 return CSSColorValue::create(color.rgb()); |
1175 } | 1175 } |
1176 | 1176 |
1177 static inline String serializeAsFragmentIdentifier(const AtomicString& resource) | 1177 static inline String serializeAsFragmentIdentifier(const AtomicString& resource) |
1178 { | 1178 { |
1179 return "#" + resource; | 1179 return "#" + resource; |
1180 } | 1180 } |
1181 | 1181 |
1182 RawPtr<CSSValue> ComputedStyleCSSValueMapping::valueForShadowData(const ShadowDa
ta& shadow, const ComputedStyle& style, bool useSpread) | 1182 CSSValue* ComputedStyleCSSValueMapping::valueForShadowData(const ShadowData& sha
dow, const ComputedStyle& style, bool useSpread) |
1183 { | 1183 { |
1184 RawPtr<CSSPrimitiveValue> x = zoomAdjustedPixelValue(shadow.x(), style); | 1184 CSSPrimitiveValue* x = zoomAdjustedPixelValue(shadow.x(), style); |
1185 RawPtr<CSSPrimitiveValue> y = zoomAdjustedPixelValue(shadow.y(), style); | 1185 CSSPrimitiveValue* y = zoomAdjustedPixelValue(shadow.y(), style); |
1186 RawPtr<CSSPrimitiveValue> blur = zoomAdjustedPixelValue(shadow.blur(), style
); | 1186 CSSPrimitiveValue* blur = zoomAdjustedPixelValue(shadow.blur(), style); |
1187 RawPtr<CSSPrimitiveValue> spread = useSpread ? zoomAdjustedPixelValue(shadow
.spread(), style) : RawPtr<CSSPrimitiveValue>(nullptr); | 1187 CSSPrimitiveValue* spread = useSpread ? zoomAdjustedPixelValue(shadow.spread
(), style) : nullptr; |
1188 RawPtr<CSSPrimitiveValue> shadowStyle = shadow.style() == Normal ? RawPtr<CS
SPrimitiveValue>(nullptr) : cssValuePool().createIdentifierValue(CSSValueInset); | 1188 CSSPrimitiveValue* shadowStyle = shadow.style() == Normal ? nullptr : cssVal
uePool().createIdentifierValue(CSSValueInset); |
1189 RawPtr<CSSValue> color = currentColorOrValidColor(style, shadow.color()); | 1189 CSSValue* color = currentColorOrValidColor(style, shadow.color()); |
1190 return CSSShadowValue::create(x.release(), y.release(), blur.release(), spre
ad.release(), shadowStyle.release(), color.release()); | 1190 return CSSShadowValue::create(x, y, blur, spread, shadowStyle, color); |
1191 } | 1191 } |
1192 | 1192 |
1193 RawPtr<CSSValue> ComputedStyleCSSValueMapping::valueForShadowList(const ShadowLi
st* shadowList, const ComputedStyle& style, bool useSpread) | 1193 CSSValue* ComputedStyleCSSValueMapping::valueForShadowList(const ShadowList* sha
dowList, const ComputedStyle& style, bool useSpread) |
1194 { | 1194 { |
1195 if (!shadowList) | 1195 if (!shadowList) |
1196 return cssValuePool().createIdentifierValue(CSSValueNone); | 1196 return cssValuePool().createIdentifierValue(CSSValueNone); |
1197 | 1197 |
1198 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); | 1198 CSSValueList* list = CSSValueList::createCommaSeparated(); |
1199 size_t shadowCount = shadowList->shadows().size(); | 1199 size_t shadowCount = shadowList->shadows().size(); |
1200 for (size_t i = 0; i < shadowCount; ++i) | 1200 for (size_t i = 0; i < shadowCount; ++i) |
1201 list->append(valueForShadowData(shadowList->shadows()[i], style, useSpre
ad)); | 1201 list->append(valueForShadowData(shadowList->shadows()[i], style, useSpre
ad)); |
1202 return list.release(); | 1202 return list; |
1203 } | 1203 } |
1204 | 1204 |
1205 RawPtr<CSSValue> ComputedStyleCSSValueMapping::valueForFilter(const ComputedStyl
e& style, const FilterOperations& filterOperations) | 1205 CSSValue* ComputedStyleCSSValueMapping::valueForFilter(const ComputedStyle& styl
e, const FilterOperations& filterOperations) |
1206 { | 1206 { |
1207 if (filterOperations.operations().isEmpty()) | 1207 if (filterOperations.operations().isEmpty()) |
1208 return cssValuePool().createIdentifierValue(CSSValueNone); | 1208 return cssValuePool().createIdentifierValue(CSSValueNone); |
1209 | 1209 |
1210 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | 1210 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
1211 | 1211 |
1212 RawPtr<CSSFunctionValue> filterValue = nullptr; | 1212 CSSFunctionValue* filterValue = nullptr; |
1213 | 1213 |
1214 for (const auto& operation : filterOperations.operations()) { | 1214 for (const auto& operation : filterOperations.operations()) { |
1215 FilterOperation* filterOperation = operation.get(); | 1215 FilterOperation* filterOperation = operation.get(); |
1216 switch (filterOperation->type()) { | 1216 switch (filterOperation->type()) { |
1217 case FilterOperation::REFERENCE: | 1217 case FilterOperation::REFERENCE: |
1218 filterValue = CSSFunctionValue::create(CSSValueUrl); | 1218 filterValue = CSSFunctionValue::create(CSSValueUrl); |
1219 filterValue->append(CSSStringValue::create(toReferenceFilterOperatio
n(filterOperation)->url())); | 1219 filterValue->append(CSSStringValue::create(toReferenceFilterOperatio
n(filterOperation)->url())); |
1220 break; | 1220 break; |
1221 case FilterOperation::GRAYSCALE: | 1221 case FilterOperation::GRAYSCALE: |
1222 filterValue = CSSFunctionValue::create(CSSValueGrayscale); | 1222 filterValue = CSSFunctionValue::create(CSSValueGrayscale); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1259 filterValue = CSSFunctionValue::create(CSSValueDropShadow); | 1259 filterValue = CSSFunctionValue::create(CSSValueDropShadow); |
1260 // We want our computed style to look like that of a text shadow (ha
s neither spread nor inset style). | 1260 // We want our computed style to look like that of a text shadow (ha
s neither spread nor inset style). |
1261 ShadowData shadow(dropShadowOperation->location(), dropShadowOperati
on->stdDeviation(), 0, Normal, StyleColor(dropShadowOperation->getColor())); | 1261 ShadowData shadow(dropShadowOperation->location(), dropShadowOperati
on->stdDeviation(), 0, Normal, StyleColor(dropShadowOperation->getColor())); |
1262 filterValue->append(valueForShadowData(shadow, style, false)); | 1262 filterValue->append(valueForShadowData(shadow, style, false)); |
1263 break; | 1263 break; |
1264 } | 1264 } |
1265 default: | 1265 default: |
1266 ASSERT_NOT_REACHED(); | 1266 ASSERT_NOT_REACHED(); |
1267 break; | 1267 break; |
1268 } | 1268 } |
1269 list->append(filterValue.release()); | 1269 list->append(filterValue); |
1270 } | 1270 } |
1271 | 1271 |
1272 return list.release(); | 1272 return list; |
1273 } | 1273 } |
1274 | 1274 |
1275 RawPtr<CSSValue> ComputedStyleCSSValueMapping::valueForFont(const ComputedStyle&
style) | 1275 CSSValue* ComputedStyleCSSValueMapping::valueForFont(const ComputedStyle& style) |
1276 { | 1276 { |
1277 // Add a slash between size and line-height. | 1277 // Add a slash between size and line-height. |
1278 RawPtr<CSSValueList> sizeAndLineHeight = CSSValueList::createSlashSeparated(
); | 1278 CSSValueList* sizeAndLineHeight = CSSValueList::createSlashSeparated(); |
1279 sizeAndLineHeight->append(valueForFontSize(style)); | 1279 sizeAndLineHeight->append(valueForFontSize(style)); |
1280 sizeAndLineHeight->append(valueForLineHeight(style)); | 1280 sizeAndLineHeight->append(valueForLineHeight(style)); |
1281 | 1281 |
1282 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | 1282 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
1283 list->append(valueForFontStyle(style)); | 1283 list->append(valueForFontStyle(style)); |
1284 list->append(valueForFontVariant(style)); | 1284 list->append(valueForFontVariant(style)); |
1285 list->append(valueForFontWeight(style)); | 1285 list->append(valueForFontWeight(style)); |
1286 list->append(valueForFontStretch(style)); | 1286 list->append(valueForFontStretch(style)); |
1287 list->append(sizeAndLineHeight.release()); | 1287 list->append(sizeAndLineHeight); |
1288 list->append(valueForFontFamily(style)); | 1288 list->append(valueForFontFamily(style)); |
1289 | 1289 |
1290 return list.release(); | 1290 return list; |
1291 } | 1291 } |
1292 | 1292 |
1293 static RawPtr<CSSValue> valueForScrollSnapDestination(const LengthPoint& destina
tion, const ComputedStyle& style) | 1293 static CSSValue* valueForScrollSnapDestination(const LengthPoint& destination, c
onst ComputedStyle& style) |
1294 { | 1294 { |
1295 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | 1295 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
1296 list->append(zoomAdjustedPixelValueForLength(destination.x(), style)); | 1296 list->append(zoomAdjustedPixelValueForLength(destination.x(), style)); |
1297 list->append(zoomAdjustedPixelValueForLength(destination.y(), style)); | 1297 list->append(zoomAdjustedPixelValueForLength(destination.y(), style)); |
1298 return list.release(); | 1298 return list; |
1299 } | 1299 } |
1300 | 1300 |
1301 static RawPtr<CSSValue> valueForScrollSnapPoints(const ScrollSnapPoints& points,
const ComputedStyle& style) | 1301 static CSSValue* valueForScrollSnapPoints(const ScrollSnapPoints& points, const
ComputedStyle& style) |
1302 { | 1302 { |
1303 if (points.hasRepeat) { | 1303 if (points.hasRepeat) { |
1304 RawPtr<CSSFunctionValue> repeat = CSSFunctionValue::create(CSSValueRepea
t); | 1304 CSSFunctionValue* repeat = CSSFunctionValue::create(CSSValueRepeat); |
1305 repeat->append(zoomAdjustedPixelValueForLength(points.repeatOffset, styl
e)); | 1305 repeat->append(zoomAdjustedPixelValueForLength(points.repeatOffset, styl
e)); |
1306 return repeat.release(); | 1306 return repeat; |
1307 } | 1307 } |
1308 | 1308 |
1309 return cssValuePool().createIdentifierValue(CSSValueNone); | 1309 return cssValuePool().createIdentifierValue(CSSValueNone); |
1310 } | 1310 } |
1311 | 1311 |
1312 static RawPtr<CSSValue> valueForScrollSnapCoordinate(const Vector<LengthPoint>&
coordinates, const ComputedStyle& style) | 1312 static CSSValue* valueForScrollSnapCoordinate(const Vector<LengthPoint>& coordin
ates, const ComputedStyle& style) |
1313 { | 1313 { |
1314 if (coordinates.isEmpty()) | 1314 if (coordinates.isEmpty()) |
1315 return cssValuePool().createIdentifierValue(CSSValueNone); | 1315 return cssValuePool().createIdentifierValue(CSSValueNone); |
1316 | 1316 |
1317 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); | 1317 CSSValueList* list = CSSValueList::createCommaSeparated(); |
1318 | 1318 |
1319 for (auto& coordinate : coordinates) { | 1319 for (auto& coordinate : coordinates) { |
1320 auto pair = CSSValueList::createSpaceSeparated(); | 1320 auto pair = CSSValueList::createSpaceSeparated(); |
1321 pair->append(zoomAdjustedPixelValueForLength(coordinate.x(), style)); | 1321 pair->append(zoomAdjustedPixelValueForLength(coordinate.x(), style)); |
1322 pair->append(zoomAdjustedPixelValueForLength(coordinate.y(), style)); | 1322 pair->append(zoomAdjustedPixelValueForLength(coordinate.y(), style)); |
1323 list->append(pair); | 1323 list->append(pair); |
1324 } | 1324 } |
1325 | 1325 |
1326 return list.release(); | 1326 return list; |
1327 } | 1327 } |
1328 | 1328 |
1329 static EBreak mapToPageBreakValue(EBreak genericBreakValue) | 1329 static EBreak mapToPageBreakValue(EBreak genericBreakValue) |
1330 { | 1330 { |
1331 switch (genericBreakValue) { | 1331 switch (genericBreakValue) { |
1332 case BreakAvoidColumn: | 1332 case BreakAvoidColumn: |
1333 case BreakColumn: | 1333 case BreakColumn: |
1334 case BreakRecto: | 1334 case BreakRecto: |
1335 case BreakVerso: | 1335 case BreakVerso: |
1336 return BreakAuto; | 1336 return BreakAuto; |
(...skipping 18 matching lines...) Expand all Loading... |
1355 return BreakAuto; | 1355 return BreakAuto; |
1356 case BreakColumn: | 1356 case BreakColumn: |
1357 return BreakAlways; | 1357 return BreakAlways; |
1358 case BreakAvoidColumn: | 1358 case BreakAvoidColumn: |
1359 return BreakAvoid; | 1359 return BreakAvoid; |
1360 default: | 1360 default: |
1361 return genericBreakValue; | 1361 return genericBreakValue; |
1362 } | 1362 } |
1363 } | 1363 } |
1364 | 1364 |
1365 RawPtr<CSSValue> ComputedStyleCSSValueMapping::get(const AtomicString customProp
ertyName, const ComputedStyle& style) | 1365 CSSValue* ComputedStyleCSSValueMapping::get(const AtomicString customPropertyNam
e, const ComputedStyle& style) |
1366 { | 1366 { |
1367 StyleVariableData* variables = style.variables(); | 1367 StyleVariableData* variables = style.variables(); |
1368 if (!variables) | 1368 if (!variables) |
1369 return nullptr; | 1369 return nullptr; |
1370 | 1370 |
1371 CSSVariableData* data = variables->getVariable(customPropertyName); | 1371 CSSVariableData* data = variables->getVariable(customPropertyName); |
1372 if (!data) | 1372 if (!data) |
1373 return nullptr; | 1373 return nullptr; |
1374 | 1374 |
1375 return CSSCustomPropertyDeclaration::create(customPropertyName, data); | 1375 return CSSCustomPropertyDeclaration::create(customPropertyName, data); |
1376 } | 1376 } |
1377 | 1377 |
1378 const HashMap<AtomicString, RefPtr<CSSVariableData>>* ComputedStyleCSSValueMappi
ng::getVariables(const ComputedStyle& style) | 1378 const HashMap<AtomicString, RefPtr<CSSVariableData>>* ComputedStyleCSSValueMappi
ng::getVariables(const ComputedStyle& style) |
1379 { | 1379 { |
1380 StyleVariableData* variables = style.variables(); | 1380 StyleVariableData* variables = style.variables(); |
1381 if (variables) | 1381 if (variables) |
1382 return variables->getVariables(); | 1382 return variables->getVariables(); |
1383 return nullptr; | 1383 return nullptr; |
1384 } | 1384 } |
1385 | 1385 |
1386 RawPtr<CSSValue> ComputedStyleCSSValueMapping::get(CSSPropertyID propertyID, con
st ComputedStyle& style, const LayoutObject* layoutObject, Node* styledNode, boo
l allowVisitedStyle) | 1386 CSSValue* ComputedStyleCSSValueMapping::get(CSSPropertyID propertyID, const Comp
utedStyle& style, const LayoutObject* layoutObject, Node* styledNode, bool allow
VisitedStyle) |
1387 { | 1387 { |
1388 const SVGComputedStyle& svgStyle = style.svgStyle(); | 1388 const SVGComputedStyle& svgStyle = style.svgStyle(); |
1389 propertyID = CSSProperty::resolveDirectionAwareProperty(propertyID, style.di
rection(), style.getWritingMode()); | 1389 propertyID = CSSProperty::resolveDirectionAwareProperty(propertyID, style.di
rection(), style.getWritingMode()); |
1390 switch (propertyID) { | 1390 switch (propertyID) { |
1391 case CSSPropertyInvalid: | 1391 case CSSPropertyInvalid: |
1392 return nullptr; | 1392 return nullptr; |
1393 | 1393 |
1394 case CSSPropertyBackgroundColor: | 1394 case CSSPropertyBackgroundColor: |
1395 return allowVisitedStyle ? cssValuePool().createColorValue(style.visited
DependentColor(CSSPropertyBackgroundColor).rgb()) : currentColorOrValidColor(sty
le, style.backgroundColor()); | 1395 return allowVisitedStyle ? cssValuePool().createColorValue(style.visited
DependentColor(CSSPropertyBackgroundColor).rgb()) : currentColorOrValidColor(sty
le, style.backgroundColor()); |
1396 case CSSPropertyBackgroundImage: | 1396 case CSSPropertyBackgroundImage: |
1397 case CSSPropertyWebkitMaskImage: { | 1397 case CSSPropertyWebkitMaskImage: { |
1398 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); | 1398 CSSValueList* list = CSSValueList::createCommaSeparated(); |
1399 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskImage ?
&style.maskLayers() : &style.backgroundLayers(); | 1399 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskImage ?
&style.maskLayers() : &style.backgroundLayers(); |
1400 for (; currLayer; currLayer = currLayer->next()) { | 1400 for (; currLayer; currLayer = currLayer->next()) { |
1401 if (currLayer->image()) | 1401 if (currLayer->image()) |
1402 list->append(currLayer->image()->computedCSSValue()); | 1402 list->append(currLayer->image()->computedCSSValue()); |
1403 else | 1403 else |
1404 list->append(cssValuePool().createIdentifierValue(CSSValueNone))
; | 1404 list->append(cssValuePool().createIdentifierValue(CSSValueNone))
; |
1405 } | 1405 } |
1406 return list.release(); | 1406 return list; |
1407 } | 1407 } |
1408 case CSSPropertyBackgroundSize: | 1408 case CSSPropertyBackgroundSize: |
1409 case CSSPropertyWebkitMaskSize: { | 1409 case CSSPropertyWebkitMaskSize: { |
1410 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); | 1410 CSSValueList* list = CSSValueList::createCommaSeparated(); |
1411 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskSize ? &
style.maskLayers() : &style.backgroundLayers(); | 1411 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskSize ? &
style.maskLayers() : &style.backgroundLayers(); |
1412 for (; currLayer; currLayer = currLayer->next()) | 1412 for (; currLayer; currLayer = currLayer->next()) |
1413 list->append(valueForFillSize(currLayer->size(), style)); | 1413 list->append(valueForFillSize(currLayer->size(), style)); |
1414 return list.release(); | 1414 return list; |
1415 } | 1415 } |
1416 case CSSPropertyBackgroundRepeat: | 1416 case CSSPropertyBackgroundRepeat: |
1417 case CSSPropertyWebkitMaskRepeat: { | 1417 case CSSPropertyWebkitMaskRepeat: { |
1418 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); | 1418 CSSValueList* list = CSSValueList::createCommaSeparated(); |
1419 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskRepeat ?
&style.maskLayers() : &style.backgroundLayers(); | 1419 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskRepeat ?
&style.maskLayers() : &style.backgroundLayers(); |
1420 for (; currLayer; currLayer = currLayer->next()) | 1420 for (; currLayer; currLayer = currLayer->next()) |
1421 list->append(valueForFillRepeat(currLayer->repeatX(), currLayer->rep
eatY())); | 1421 list->append(valueForFillRepeat(currLayer->repeatX(), currLayer->rep
eatY())); |
1422 return list.release(); | 1422 return list; |
1423 } | 1423 } |
1424 case CSSPropertyMaskSourceType: { | 1424 case CSSPropertyMaskSourceType: { |
1425 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); | 1425 CSSValueList* list = CSSValueList::createCommaSeparated(); |
1426 for (const FillLayer* currLayer = &style.maskLayers(); currLayer; currLa
yer = currLayer->next()) | 1426 for (const FillLayer* currLayer = &style.maskLayers(); currLayer; currLa
yer = currLayer->next()) |
1427 list->append(valueForFillSourceType(currLayer->maskSourceType())); | 1427 list->append(valueForFillSourceType(currLayer->maskSourceType())); |
1428 return list.release(); | 1428 return list; |
1429 } | 1429 } |
1430 case CSSPropertyWebkitMaskComposite: { | 1430 case CSSPropertyWebkitMaskComposite: { |
1431 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); | 1431 CSSValueList* list = CSSValueList::createCommaSeparated(); |
1432 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskComposit
e ? &style.maskLayers() : &style.backgroundLayers(); | 1432 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskComposit
e ? &style.maskLayers() : &style.backgroundLayers(); |
1433 for (; currLayer; currLayer = currLayer->next()) | 1433 for (; currLayer; currLayer = currLayer->next()) |
1434 list->append(cssValuePool().createValue(currLayer->composite())); | 1434 list->append(cssValuePool().createValue(currLayer->composite())); |
1435 return list.release(); | 1435 return list; |
1436 } | 1436 } |
1437 case CSSPropertyBackgroundAttachment: { | 1437 case CSSPropertyBackgroundAttachment: { |
1438 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); | 1438 CSSValueList* list = CSSValueList::createCommaSeparated(); |
1439 for (const FillLayer* currLayer = &style.backgroundLayers(); currLayer;
currLayer = currLayer->next()) | 1439 for (const FillLayer* currLayer = &style.backgroundLayers(); currLayer;
currLayer = currLayer->next()) |
1440 list->append(cssValuePool().createValue(currLayer->attachment())); | 1440 list->append(cssValuePool().createValue(currLayer->attachment())); |
1441 return list.release(); | 1441 return list; |
1442 } | 1442 } |
1443 case CSSPropertyBackgroundClip: | 1443 case CSSPropertyBackgroundClip: |
1444 case CSSPropertyBackgroundOrigin: | 1444 case CSSPropertyBackgroundOrigin: |
1445 case CSSPropertyWebkitBackgroundClip: | 1445 case CSSPropertyWebkitBackgroundClip: |
1446 case CSSPropertyWebkitBackgroundOrigin: | 1446 case CSSPropertyWebkitBackgroundOrigin: |
1447 case CSSPropertyWebkitMaskClip: | 1447 case CSSPropertyWebkitMaskClip: |
1448 case CSSPropertyWebkitMaskOrigin: { | 1448 case CSSPropertyWebkitMaskOrigin: { |
1449 bool isClip = propertyID == CSSPropertyBackgroundClip || propertyID == C
SSPropertyWebkitBackgroundClip || propertyID == CSSPropertyWebkitMaskClip; | 1449 bool isClip = propertyID == CSSPropertyBackgroundClip || propertyID == C
SSPropertyWebkitBackgroundClip || propertyID == CSSPropertyWebkitMaskClip; |
1450 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); | 1450 CSSValueList* list = CSSValueList::createCommaSeparated(); |
1451 const FillLayer* currLayer = (propertyID == CSSPropertyWebkitMaskClip ||
propertyID == CSSPropertyWebkitMaskOrigin) ? &style.maskLayers() : &style.backg
roundLayers(); | 1451 const FillLayer* currLayer = (propertyID == CSSPropertyWebkitMaskClip ||
propertyID == CSSPropertyWebkitMaskOrigin) ? &style.maskLayers() : &style.backg
roundLayers(); |
1452 for (; currLayer; currLayer = currLayer->next()) { | 1452 for (; currLayer; currLayer = currLayer->next()) { |
1453 EFillBox box = isClip ? currLayer->clip() : currLayer->origin(); | 1453 EFillBox box = isClip ? currLayer->clip() : currLayer->origin(); |
1454 list->append(cssValuePool().createValue(box)); | 1454 list->append(cssValuePool().createValue(box)); |
1455 } | 1455 } |
1456 return list.release(); | 1456 return list; |
1457 } | 1457 } |
1458 case CSSPropertyBackgroundPosition: | 1458 case CSSPropertyBackgroundPosition: |
1459 case CSSPropertyWebkitMaskPosition: { | 1459 case CSSPropertyWebkitMaskPosition: { |
1460 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); | 1460 CSSValueList* list = CSSValueList::createCommaSeparated(); |
1461 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskPosition
? &style.maskLayers() : &style.backgroundLayers(); | 1461 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskPosition
? &style.maskLayers() : &style.backgroundLayers(); |
1462 for (; currLayer; currLayer = currLayer->next()) | 1462 for (; currLayer; currLayer = currLayer->next()) |
1463 list->append(createPositionListForLayer(propertyID, *currLayer, styl
e)); | 1463 list->append(createPositionListForLayer(propertyID, *currLayer, styl
e)); |
1464 return list.release(); | 1464 return list; |
1465 } | 1465 } |
1466 case CSSPropertyBackgroundPositionX: | 1466 case CSSPropertyBackgroundPositionX: |
1467 case CSSPropertyWebkitMaskPositionX: { | 1467 case CSSPropertyWebkitMaskPositionX: { |
1468 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); | 1468 CSSValueList* list = CSSValueList::createCommaSeparated(); |
1469 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskPosition
X ? &style.maskLayers() : &style.backgroundLayers(); | 1469 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskPosition
X ? &style.maskLayers() : &style.backgroundLayers(); |
1470 for (; currLayer; currLayer = currLayer->next()) | 1470 for (; currLayer; currLayer = currLayer->next()) |
1471 list->append(zoomAdjustedPixelValueForLength(currLayer->xPosition(),
style)); | 1471 list->append(zoomAdjustedPixelValueForLength(currLayer->xPosition(),
style)); |
1472 return list.release(); | 1472 return list; |
1473 } | 1473 } |
1474 case CSSPropertyBackgroundPositionY: | 1474 case CSSPropertyBackgroundPositionY: |
1475 case CSSPropertyWebkitMaskPositionY: { | 1475 case CSSPropertyWebkitMaskPositionY: { |
1476 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); | 1476 CSSValueList* list = CSSValueList::createCommaSeparated(); |
1477 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskPosition
Y ? &style.maskLayers() : &style.backgroundLayers(); | 1477 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskPosition
Y ? &style.maskLayers() : &style.backgroundLayers(); |
1478 for (; currLayer; currLayer = currLayer->next()) | 1478 for (; currLayer; currLayer = currLayer->next()) |
1479 list->append(zoomAdjustedPixelValueForLength(currLayer->yPosition(),
style)); | 1479 list->append(zoomAdjustedPixelValueForLength(currLayer->yPosition(),
style)); |
1480 return list.release(); | 1480 return list; |
1481 } | 1481 } |
1482 case CSSPropertyBorderCollapse: | 1482 case CSSPropertyBorderCollapse: |
1483 if (style.borderCollapse()) | 1483 if (style.borderCollapse()) |
1484 return cssValuePool().createIdentifierValue(CSSValueCollapse); | 1484 return cssValuePool().createIdentifierValue(CSSValueCollapse); |
1485 return cssValuePool().createIdentifierValue(CSSValueSeparate); | 1485 return cssValuePool().createIdentifierValue(CSSValueSeparate); |
1486 case CSSPropertyBorderSpacing: { | 1486 case CSSPropertyBorderSpacing: { |
1487 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | 1487 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
1488 list->append(zoomAdjustedPixelValue(style.horizontalBorderSpacing(), sty
le)); | 1488 list->append(zoomAdjustedPixelValue(style.horizontalBorderSpacing(), sty
le)); |
1489 list->append(zoomAdjustedPixelValue(style.verticalBorderSpacing(), style
)); | 1489 list->append(zoomAdjustedPixelValue(style.verticalBorderSpacing(), style
)); |
1490 return list.release(); | 1490 return list; |
1491 } | 1491 } |
1492 case CSSPropertyWebkitBorderHorizontalSpacing: | 1492 case CSSPropertyWebkitBorderHorizontalSpacing: |
1493 return zoomAdjustedPixelValue(style.horizontalBorderSpacing(), style); | 1493 return zoomAdjustedPixelValue(style.horizontalBorderSpacing(), style); |
1494 case CSSPropertyWebkitBorderVerticalSpacing: | 1494 case CSSPropertyWebkitBorderVerticalSpacing: |
1495 return zoomAdjustedPixelValue(style.verticalBorderSpacing(), style); | 1495 return zoomAdjustedPixelValue(style.verticalBorderSpacing(), style); |
1496 case CSSPropertyBorderImageSource: | 1496 case CSSPropertyBorderImageSource: |
1497 if (style.borderImageSource()) | 1497 if (style.borderImageSource()) |
1498 return style.borderImageSource()->computedCSSValue(); | 1498 return style.borderImageSource()->computedCSSValue(); |
1499 return cssValuePool().createIdentifierValue(CSSValueNone); | 1499 return cssValuePool().createIdentifierValue(CSSValueNone); |
1500 case CSSPropertyBorderTopColor: | 1500 case CSSPropertyBorderTopColor: |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1581 case CSSPropertyWebkitColumnBreakInside: | 1581 case CSSPropertyWebkitColumnBreakInside: |
1582 return cssValuePool().createValue(mapToColumnBreakValue(style.breakInsid
e())); | 1582 return cssValuePool().createValue(mapToColumnBreakValue(style.breakInsid
e())); |
1583 case CSSPropertyColumnWidth: | 1583 case CSSPropertyColumnWidth: |
1584 if (style.hasAutoColumnWidth()) | 1584 if (style.hasAutoColumnWidth()) |
1585 return cssValuePool().createIdentifierValue(CSSValueAuto); | 1585 return cssValuePool().createIdentifierValue(CSSValueAuto); |
1586 return zoomAdjustedPixelValue(style.columnWidth(), style); | 1586 return zoomAdjustedPixelValue(style.columnWidth(), style); |
1587 case CSSPropertyTabSize: | 1587 case CSSPropertyTabSize: |
1588 return cssValuePool().createValue( | 1588 return cssValuePool().createValue( |
1589 style.getTabSize().getPixelSize(1.0), style.getTabSize().isSpaces()
? CSSPrimitiveValue::UnitType::Number : CSSPrimitiveValue::UnitType::Pixels); | 1589 style.getTabSize().getPixelSize(1.0), style.getTabSize().isSpaces()
? CSSPrimitiveValue::UnitType::Number : CSSPrimitiveValue::UnitType::Pixels); |
1590 case CSSPropertyCursor: { | 1590 case CSSPropertyCursor: { |
1591 RawPtr<CSSValueList> list = nullptr; | 1591 CSSValueList* list = nullptr; |
1592 CursorList* cursors = style.cursors(); | 1592 CursorList* cursors = style.cursors(); |
1593 if (cursors && cursors->size() > 0) { | 1593 if (cursors && cursors->size() > 0) { |
1594 list = CSSValueList::createCommaSeparated(); | 1594 list = CSSValueList::createCommaSeparated(); |
1595 for (unsigned i = 0; i < cursors->size(); ++i) { | 1595 for (unsigned i = 0; i < cursors->size(); ++i) { |
1596 if (StyleImage* image = cursors->at(i).image()) | 1596 if (StyleImage* image = cursors->at(i).image()) |
1597 list->append(image->computedCSSValue()); | 1597 list->append(image->computedCSSValue()); |
1598 } | 1598 } |
1599 } | 1599 } |
1600 RawPtr<CSSValue> value = cssValuePool().createValue(style.cursor()); | 1600 CSSValue* value = cssValuePool().createValue(style.cursor()); |
1601 if (list) { | 1601 if (list) { |
1602 list->append(value.release()); | 1602 list->append(value); |
1603 return list.release(); | 1603 return list; |
1604 } | 1604 } |
1605 return value.release(); | 1605 return value; |
1606 } | 1606 } |
1607 case CSSPropertyDirection: | 1607 case CSSPropertyDirection: |
1608 return cssValuePool().createValue(style.direction()); | 1608 return cssValuePool().createValue(style.direction()); |
1609 case CSSPropertyDisplay: | 1609 case CSSPropertyDisplay: |
1610 return cssValuePool().createValue(style.display()); | 1610 return cssValuePool().createValue(style.display()); |
1611 case CSSPropertyEmptyCells: | 1611 case CSSPropertyEmptyCells: |
1612 return cssValuePool().createValue(style.emptyCells()); | 1612 return cssValuePool().createValue(style.emptyCells()); |
1613 case CSSPropertyAlignContent: | 1613 case CSSPropertyAlignContent: |
1614 return valueForContentPositionAndDistributionWithOverflowAlignment(style
.alignContent()); | 1614 return valueForContentPositionAndDistributionWithOverflowAlignment(style
.alignContent()); |
1615 case CSSPropertyAlignItems: | 1615 case CSSPropertyAlignItems: |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1660 case CSSPropertyFontStyle: | 1660 case CSSPropertyFontStyle: |
1661 return valueForFontStyle(style); | 1661 return valueForFontStyle(style); |
1662 case CSSPropertyFontVariant: | 1662 case CSSPropertyFontVariant: |
1663 return valueForFontVariant(style); | 1663 return valueForFontVariant(style); |
1664 case CSSPropertyFontWeight: | 1664 case CSSPropertyFontWeight: |
1665 return valueForFontWeight(style); | 1665 return valueForFontWeight(style); |
1666 case CSSPropertyFontFeatureSettings: { | 1666 case CSSPropertyFontFeatureSettings: { |
1667 const FontFeatureSettings* featureSettings = style.getFontDescription().
featureSettings(); | 1667 const FontFeatureSettings* featureSettings = style.getFontDescription().
featureSettings(); |
1668 if (!featureSettings || !featureSettings->size()) | 1668 if (!featureSettings || !featureSettings->size()) |
1669 return cssValuePool().createIdentifierValue(CSSValueNormal); | 1669 return cssValuePool().createIdentifierValue(CSSValueNormal); |
1670 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); | 1670 CSSValueList* list = CSSValueList::createCommaSeparated(); |
1671 for (unsigned i = 0; i < featureSettings->size(); ++i) { | 1671 for (unsigned i = 0; i < featureSettings->size(); ++i) { |
1672 const FontFeature& feature = featureSettings->at(i); | 1672 const FontFeature& feature = featureSettings->at(i); |
1673 RawPtr<CSSFontFeatureValue> featureValue = CSSFontFeatureValue::crea
te(feature.tag(), feature.value()); | 1673 CSSFontFeatureValue* featureValue = CSSFontFeatureValue::create(feat
ure.tag(), feature.value()); |
1674 list->append(featureValue.release()); | 1674 list->append(featureValue); |
1675 } | 1675 } |
1676 return list.release(); | 1676 return list; |
1677 } | 1677 } |
1678 case CSSPropertyGridAutoFlow: { | 1678 case CSSPropertyGridAutoFlow: { |
1679 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | 1679 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
1680 switch (style.getGridAutoFlow()) { | 1680 switch (style.getGridAutoFlow()) { |
1681 case AutoFlowRow: | 1681 case AutoFlowRow: |
1682 case AutoFlowRowDense: | 1682 case AutoFlowRowDense: |
1683 list->append(cssValuePool().createIdentifierValue(CSSValueRow)); | 1683 list->append(cssValuePool().createIdentifierValue(CSSValueRow)); |
1684 break; | 1684 break; |
1685 case AutoFlowColumn: | 1685 case AutoFlowColumn: |
1686 case AutoFlowColumnDense: | 1686 case AutoFlowColumnDense: |
1687 list->append(cssValuePool().createIdentifierValue(CSSValueColumn)); | 1687 list->append(cssValuePool().createIdentifierValue(CSSValueColumn)); |
1688 break; | 1688 break; |
1689 default: | 1689 default: |
1690 ASSERT_NOT_REACHED(); | 1690 ASSERT_NOT_REACHED(); |
1691 } | 1691 } |
1692 | 1692 |
1693 switch (style.getGridAutoFlow()) { | 1693 switch (style.getGridAutoFlow()) { |
1694 case AutoFlowRowDense: | 1694 case AutoFlowRowDense: |
1695 case AutoFlowColumnDense: | 1695 case AutoFlowColumnDense: |
1696 list->append(cssValuePool().createIdentifierValue(CSSValueDense)); | 1696 list->append(cssValuePool().createIdentifierValue(CSSValueDense)); |
1697 break; | 1697 break; |
1698 default: | 1698 default: |
1699 // Do nothing. | 1699 // Do nothing. |
1700 break; | 1700 break; |
1701 } | 1701 } |
1702 | 1702 |
1703 return list.release(); | 1703 return list; |
1704 } | 1704 } |
1705 // Specs mention that getComputedStyle() should return the used value of the
property instead of the computed | 1705 // Specs mention that getComputedStyle() should return the used value of the
property instead of the computed |
1706 // one for grid-definition-{rows|columns} but not for the grid-auto-{rows|co
lumns} as things like | 1706 // one for grid-definition-{rows|columns} but not for the grid-auto-{rows|co
lumns} as things like |
1707 // grid-auto-columns: 2fr; cannot be resolved to a value in pixels as the '2
fr' means very different things | 1707 // grid-auto-columns: 2fr; cannot be resolved to a value in pixels as the '2
fr' means very different things |
1708 // depending on the size of the explicit grid or the number of implicit trac
ks added to the grid. See | 1708 // depending on the size of the explicit grid or the number of implicit trac
ks added to the grid. See |
1709 // http://lists.w3.org/Archives/Public/www-style/2013Nov/0014.html | 1709 // http://lists.w3.org/Archives/Public/www-style/2013Nov/0014.html |
1710 case CSSPropertyGridAutoColumns: | 1710 case CSSPropertyGridAutoColumns: |
1711 return specifiedValueForGridTrackSize(style.gridAutoColumns(), style); | 1711 return specifiedValueForGridTrackSize(style.gridAutoColumns(), style); |
1712 case CSSPropertyGridAutoRows: | 1712 case CSSPropertyGridAutoRows: |
1713 return specifiedValueForGridTrackSize(style.gridAutoRows(), style); | 1713 return specifiedValueForGridTrackSize(style.gridAutoRows(), style); |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1935 case CSSPropertyPageBreakInside: | 1935 case CSSPropertyPageBreakInside: |
1936 return cssValuePool().createValue(mapToPageBreakValue(style.breakInside(
))); | 1936 return cssValuePool().createValue(mapToPageBreakValue(style.breakInside(
))); |
1937 case CSSPropertyPosition: | 1937 case CSSPropertyPosition: |
1938 return cssValuePool().createValue(style.position()); | 1938 return cssValuePool().createValue(style.position()); |
1939 case CSSPropertyQuotes: | 1939 case CSSPropertyQuotes: |
1940 if (!style.quotes()) { | 1940 if (!style.quotes()) { |
1941 // TODO(ramya.v): We should return the quote values that we're actua
lly using. | 1941 // TODO(ramya.v): We should return the quote values that we're actua
lly using. |
1942 return nullptr; | 1942 return nullptr; |
1943 } | 1943 } |
1944 if (style.quotes()->size()) { | 1944 if (style.quotes()->size()) { |
1945 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | 1945 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
1946 for (int i = 0; i < style.quotes()->size(); i++) { | 1946 for (int i = 0; i < style.quotes()->size(); i++) { |
1947 list->append(CSSStringValue::create(style.quotes()->getOpenQuote
(i))); | 1947 list->append(CSSStringValue::create(style.quotes()->getOpenQuote
(i))); |
1948 list->append(CSSStringValue::create(style.quotes()->getCloseQuot
e(i))); | 1948 list->append(CSSStringValue::create(style.quotes()->getCloseQuot
e(i))); |
1949 } | 1949 } |
1950 return list.release(); | 1950 return list; |
1951 } | 1951 } |
1952 return cssValuePool().createIdentifierValue(CSSValueNone); | 1952 return cssValuePool().createIdentifierValue(CSSValueNone); |
1953 case CSSPropertyRight: | 1953 case CSSPropertyRight: |
1954 return valueForPositionOffset(style, CSSPropertyRight, layoutObject); | 1954 return valueForPositionOffset(style, CSSPropertyRight, layoutObject); |
1955 case CSSPropertyWebkitRubyPosition: | 1955 case CSSPropertyWebkitRubyPosition: |
1956 return cssValuePool().createValue(style.getRubyPosition()); | 1956 return cssValuePool().createValue(style.getRubyPosition()); |
1957 case CSSPropertyScrollBehavior: | 1957 case CSSPropertyScrollBehavior: |
1958 return cssValuePool().createValue(style.getScrollBehavior()); | 1958 return cssValuePool().createValue(style.getScrollBehavior()); |
1959 case CSSPropertyTableLayout: | 1959 case CSSPropertyTableLayout: |
1960 return cssValuePool().createValue(style.tableLayout()); | 1960 return cssValuePool().createValue(style.tableLayout()); |
(...skipping 30 matching lines...) Expand all Loading... |
1991 case TextEmphasisMarkCustom: | 1991 case TextEmphasisMarkCustom: |
1992 return CSSStringValue::create(style.textEmphasisCustomMark()); | 1992 return CSSStringValue::create(style.textEmphasisCustomMark()); |
1993 case TextEmphasisMarkAuto: | 1993 case TextEmphasisMarkAuto: |
1994 ASSERT_NOT_REACHED(); | 1994 ASSERT_NOT_REACHED(); |
1995 // Fall through | 1995 // Fall through |
1996 case TextEmphasisMarkDot: | 1996 case TextEmphasisMarkDot: |
1997 case TextEmphasisMarkCircle: | 1997 case TextEmphasisMarkCircle: |
1998 case TextEmphasisMarkDoubleCircle: | 1998 case TextEmphasisMarkDoubleCircle: |
1999 case TextEmphasisMarkTriangle: | 1999 case TextEmphasisMarkTriangle: |
2000 case TextEmphasisMarkSesame: { | 2000 case TextEmphasisMarkSesame: { |
2001 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | 2001 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
2002 list->append(cssValuePool().createValue(style.getTextEmphasisFill())
); | 2002 list->append(cssValuePool().createValue(style.getTextEmphasisFill())
); |
2003 list->append(cssValuePool().createValue(style.getTextEmphasisMark())
); | 2003 list->append(cssValuePool().createValue(style.getTextEmphasisMark())
); |
2004 return list.release(); | 2004 return list; |
2005 } | 2005 } |
2006 } | 2006 } |
2007 case CSSPropertyTextIndent: { | 2007 case CSSPropertyTextIndent: { |
2008 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | 2008 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
2009 list->append(zoomAdjustedPixelValueForLength(style.textIndent(), style))
; | 2009 list->append(zoomAdjustedPixelValueForLength(style.textIndent(), style))
; |
2010 if (RuntimeEnabledFeatures::css3TextEnabled() && (style.getTextIndentLin
e() == TextIndentEachLine || style.getTextIndentType() == TextIndentHanging)) { | 2010 if (RuntimeEnabledFeatures::css3TextEnabled() && (style.getTextIndentLin
e() == TextIndentEachLine || style.getTextIndentType() == TextIndentHanging)) { |
2011 if (style.getTextIndentLine() == TextIndentEachLine) | 2011 if (style.getTextIndentLine() == TextIndentEachLine) |
2012 list->append(cssValuePool().createIdentifierValue(CSSValueEachLi
ne)); | 2012 list->append(cssValuePool().createIdentifierValue(CSSValueEachLi
ne)); |
2013 if (style.getTextIndentType() == TextIndentHanging) | 2013 if (style.getTextIndentType() == TextIndentHanging) |
2014 list->append(cssValuePool().createIdentifierValue(CSSValueHangin
g)); | 2014 list->append(cssValuePool().createIdentifierValue(CSSValueHangin
g)); |
2015 } | 2015 } |
2016 return list.release(); | 2016 return list; |
2017 } | 2017 } |
2018 case CSSPropertyTextShadow: | 2018 case CSSPropertyTextShadow: |
2019 return valueForShadowList(style.textShadow(), style, false); | 2019 return valueForShadowList(style.textShadow(), style, false); |
2020 case CSSPropertyTextRendering: | 2020 case CSSPropertyTextRendering: |
2021 return cssValuePool().createValue(style.getFontDescription().textRenderi
ng()); | 2021 return cssValuePool().createValue(style.getFontDescription().textRenderi
ng()); |
2022 case CSSPropertyTextOverflow: | 2022 case CSSPropertyTextOverflow: |
2023 if (style.getTextOverflow()) | 2023 if (style.getTextOverflow()) |
2024 return cssValuePool().createIdentifierValue(CSSValueEllipsis); | 2024 return cssValuePool().createIdentifierValue(CSSValueEllipsis); |
2025 return cssValuePool().createIdentifierValue(CSSValueClip); | 2025 return cssValuePool().createIdentifierValue(CSSValueClip); |
2026 case CSSPropertyWebkitTextSecurity: | 2026 case CSSPropertyWebkitTextSecurity: |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2095 return cssValuePool().createValue(style.getFontDescription().fontSmoothi
ng()); | 2095 return cssValuePool().createValue(style.getFontDescription().fontSmoothi
ng()); |
2096 case CSSPropertyFontVariantLigatures: { | 2096 case CSSPropertyFontVariantLigatures: { |
2097 FontDescription::LigaturesState commonLigaturesState = style.getFontDesc
ription().commonLigaturesState(); | 2097 FontDescription::LigaturesState commonLigaturesState = style.getFontDesc
ription().commonLigaturesState(); |
2098 FontDescription::LigaturesState discretionaryLigaturesState = style.getF
ontDescription().discretionaryLigaturesState(); | 2098 FontDescription::LigaturesState discretionaryLigaturesState = style.getF
ontDescription().discretionaryLigaturesState(); |
2099 FontDescription::LigaturesState historicalLigaturesState = style.getFont
Description().historicalLigaturesState(); | 2099 FontDescription::LigaturesState historicalLigaturesState = style.getFont
Description().historicalLigaturesState(); |
2100 FontDescription::LigaturesState contextualLigaturesState = style.getFont
Description().contextualLigaturesState(); | 2100 FontDescription::LigaturesState contextualLigaturesState = style.getFont
Description().contextualLigaturesState(); |
2101 if (commonLigaturesState == FontDescription::NormalLigaturesState && dis
cretionaryLigaturesState == FontDescription::NormalLigaturesState | 2101 if (commonLigaturesState == FontDescription::NormalLigaturesState && dis
cretionaryLigaturesState == FontDescription::NormalLigaturesState |
2102 && historicalLigaturesState == FontDescription::NormalLigaturesState
&& contextualLigaturesState == FontDescription::NormalLigaturesState) | 2102 && historicalLigaturesState == FontDescription::NormalLigaturesState
&& contextualLigaturesState == FontDescription::NormalLigaturesState) |
2103 return cssValuePool().createIdentifierValue(CSSValueNormal); | 2103 return cssValuePool().createIdentifierValue(CSSValueNormal); |
2104 | 2104 |
2105 RawPtr<CSSValueList> valueList = CSSValueList::createSpaceSeparated(); | 2105 CSSValueList* valueList = CSSValueList::createSpaceSeparated(); |
2106 if (commonLigaturesState != FontDescription::NormalLigaturesState) | 2106 if (commonLigaturesState != FontDescription::NormalLigaturesState) |
2107 valueList->append(cssValuePool().createIdentifierValue(commonLigatur
esState == FontDescription::DisabledLigaturesState ? CSSValueNoCommonLigatures :
CSSValueCommonLigatures)); | 2107 valueList->append(cssValuePool().createIdentifierValue(commonLigatur
esState == FontDescription::DisabledLigaturesState ? CSSValueNoCommonLigatures :
CSSValueCommonLigatures)); |
2108 if (discretionaryLigaturesState != FontDescription::NormalLigaturesState
) | 2108 if (discretionaryLigaturesState != FontDescription::NormalLigaturesState
) |
2109 valueList->append(cssValuePool().createIdentifierValue(discretionary
LigaturesState == FontDescription::DisabledLigaturesState ? CSSValueNoDiscretion
aryLigatures : CSSValueDiscretionaryLigatures)); | 2109 valueList->append(cssValuePool().createIdentifierValue(discretionary
LigaturesState == FontDescription::DisabledLigaturesState ? CSSValueNoDiscretion
aryLigatures : CSSValueDiscretionaryLigatures)); |
2110 if (historicalLigaturesState != FontDescription::NormalLigaturesState) | 2110 if (historicalLigaturesState != FontDescription::NormalLigaturesState) |
2111 valueList->append(cssValuePool().createIdentifierValue(historicalLig
aturesState == FontDescription::DisabledLigaturesState ? CSSValueNoHistoricalLig
atures : CSSValueHistoricalLigatures)); | 2111 valueList->append(cssValuePool().createIdentifierValue(historicalLig
aturesState == FontDescription::DisabledLigaturesState ? CSSValueNoHistoricalLig
atures : CSSValueHistoricalLigatures)); |
2112 if (contextualLigaturesState != FontDescription::NormalLigaturesState) | 2112 if (contextualLigaturesState != FontDescription::NormalLigaturesState) |
2113 valueList->append(cssValuePool().createIdentifierValue(contextualLig
aturesState == FontDescription::DisabledLigaturesState ? CSSValueNoContextual :
CSSValueContextual)); | 2113 valueList->append(cssValuePool().createIdentifierValue(contextualLig
aturesState == FontDescription::DisabledLigaturesState ? CSSValueNoContextual :
CSSValueContextual)); |
2114 return valueList; | 2114 return valueList; |
2115 } | 2115 } |
2116 case CSSPropertyZIndex: | 2116 case CSSPropertyZIndex: |
2117 if (style.hasAutoZIndex()) | 2117 if (style.hasAutoZIndex()) |
2118 return cssValuePool().createIdentifierValue(CSSValueAuto); | 2118 return cssValuePool().createIdentifierValue(CSSValueAuto); |
2119 return cssValuePool().createValue(style.zIndex(), CSSPrimitiveValue::Uni
tType::Integer); | 2119 return cssValuePool().createValue(style.zIndex(), CSSPrimitiveValue::Uni
tType::Integer); |
2120 case CSSPropertyZoom: | 2120 case CSSPropertyZoom: |
2121 return cssValuePool().createValue(style.zoom(), CSSPrimitiveValue::UnitT
ype::Number); | 2121 return cssValuePool().createValue(style.zoom(), CSSPrimitiveValue::UnitT
ype::Number); |
2122 case CSSPropertyBoxSizing: | 2122 case CSSPropertyBoxSizing: |
2123 if (style.boxSizing() == BoxSizingContentBox) | 2123 if (style.boxSizing() == BoxSizingContentBox) |
2124 return cssValuePool().createIdentifierValue(CSSValueContentBox); | 2124 return cssValuePool().createIdentifierValue(CSSValueContentBox); |
2125 return cssValuePool().createIdentifierValue(CSSValueBorderBox); | 2125 return cssValuePool().createIdentifierValue(CSSValueBorderBox); |
2126 case CSSPropertyWebkitAppRegion: | 2126 case CSSPropertyWebkitAppRegion: |
2127 return cssValuePool().createIdentifierValue(style.getDraggableRegionMode
() == DraggableRegionDrag ? CSSValueDrag : CSSValueNoDrag); | 2127 return cssValuePool().createIdentifierValue(style.getDraggableRegionMode
() == DraggableRegionDrag ? CSSValueDrag : CSSValueNoDrag); |
2128 case CSSPropertyAnimationDelay: | 2128 case CSSPropertyAnimationDelay: |
2129 return valueForAnimationDelay(style.animations()); | 2129 return valueForAnimationDelay(style.animations()); |
2130 case CSSPropertyAnimationDirection: { | 2130 case CSSPropertyAnimationDirection: { |
2131 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); | 2131 CSSValueList* list = CSSValueList::createCommaSeparated(); |
2132 const CSSAnimationData* animationData = style.animations(); | 2132 const CSSAnimationData* animationData = style.animations(); |
2133 if (animationData) { | 2133 if (animationData) { |
2134 for (size_t i = 0; i < animationData->directionList().size(); ++i) | 2134 for (size_t i = 0; i < animationData->directionList().size(); ++i) |
2135 list->append(valueForAnimationDirection(animationData->direction
List()[i])); | 2135 list->append(valueForAnimationDirection(animationData->direction
List()[i])); |
2136 } else { | 2136 } else { |
2137 list->append(cssValuePool().createIdentifierValue(CSSValueNormal)); | 2137 list->append(cssValuePool().createIdentifierValue(CSSValueNormal)); |
2138 } | 2138 } |
2139 return list.release(); | 2139 return list; |
2140 } | 2140 } |
2141 case CSSPropertyAnimationDuration: | 2141 case CSSPropertyAnimationDuration: |
2142 return valueForAnimationDuration(style.animations()); | 2142 return valueForAnimationDuration(style.animations()); |
2143 case CSSPropertyAnimationFillMode: { | 2143 case CSSPropertyAnimationFillMode: { |
2144 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); | 2144 CSSValueList* list = CSSValueList::createCommaSeparated(); |
2145 const CSSAnimationData* animationData = style.animations(); | 2145 const CSSAnimationData* animationData = style.animations(); |
2146 if (animationData) { | 2146 if (animationData) { |
2147 for (size_t i = 0; i < animationData->fillModeList().size(); ++i) | 2147 for (size_t i = 0; i < animationData->fillModeList().size(); ++i) |
2148 list->append(valueForAnimationFillMode(animationData->fillModeLi
st()[i])); | 2148 list->append(valueForAnimationFillMode(animationData->fillModeLi
st()[i])); |
2149 } else { | 2149 } else { |
2150 list->append(cssValuePool().createIdentifierValue(CSSValueNone)); | 2150 list->append(cssValuePool().createIdentifierValue(CSSValueNone)); |
2151 } | 2151 } |
2152 return list.release(); | 2152 return list; |
2153 } | 2153 } |
2154 case CSSPropertyAnimationIterationCount: { | 2154 case CSSPropertyAnimationIterationCount: { |
2155 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); | 2155 CSSValueList* list = CSSValueList::createCommaSeparated(); |
2156 const CSSAnimationData* animationData = style.animations(); | 2156 const CSSAnimationData* animationData = style.animations(); |
2157 if (animationData) { | 2157 if (animationData) { |
2158 for (size_t i = 0; i < animationData->iterationCountList().size(); +
+i) | 2158 for (size_t i = 0; i < animationData->iterationCountList().size(); +
+i) |
2159 list->append(valueForAnimationIterationCount(animationData->iter
ationCountList()[i])); | 2159 list->append(valueForAnimationIterationCount(animationData->iter
ationCountList()[i])); |
2160 } else { | 2160 } else { |
2161 list->append(cssValuePool().createValue(CSSAnimationData::initialIte
rationCount(), CSSPrimitiveValue::UnitType::Number)); | 2161 list->append(cssValuePool().createValue(CSSAnimationData::initialIte
rationCount(), CSSPrimitiveValue::UnitType::Number)); |
2162 } | 2162 } |
2163 return list.release(); | 2163 return list; |
2164 } | 2164 } |
2165 case CSSPropertyAnimationName: { | 2165 case CSSPropertyAnimationName: { |
2166 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); | 2166 CSSValueList* list = CSSValueList::createCommaSeparated(); |
2167 const CSSAnimationData* animationData = style.animations(); | 2167 const CSSAnimationData* animationData = style.animations(); |
2168 if (animationData) { | 2168 if (animationData) { |
2169 for (size_t i = 0; i < animationData->nameList().size(); ++i) | 2169 for (size_t i = 0; i < animationData->nameList().size(); ++i) |
2170 list->append(CSSCustomIdentValue::create(animationData->nameList
()[i])); | 2170 list->append(CSSCustomIdentValue::create(animationData->nameList
()[i])); |
2171 } else { | 2171 } else { |
2172 list->append(cssValuePool().createIdentifierValue(CSSValueNone)); | 2172 list->append(cssValuePool().createIdentifierValue(CSSValueNone)); |
2173 } | 2173 } |
2174 return list.release(); | 2174 return list; |
2175 } | 2175 } |
2176 case CSSPropertyAnimationPlayState: { | 2176 case CSSPropertyAnimationPlayState: { |
2177 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); | 2177 CSSValueList* list = CSSValueList::createCommaSeparated(); |
2178 const CSSAnimationData* animationData = style.animations(); | 2178 const CSSAnimationData* animationData = style.animations(); |
2179 if (animationData) { | 2179 if (animationData) { |
2180 for (size_t i = 0; i < animationData->playStateList().size(); ++i) | 2180 for (size_t i = 0; i < animationData->playStateList().size(); ++i) |
2181 list->append(valueForAnimationPlayState(animationData->playState
List()[i])); | 2181 list->append(valueForAnimationPlayState(animationData->playState
List()[i])); |
2182 } else { | 2182 } else { |
2183 list->append(cssValuePool().createIdentifierValue(CSSValueRunning)); | 2183 list->append(cssValuePool().createIdentifierValue(CSSValueRunning)); |
2184 } | 2184 } |
2185 return list.release(); | 2185 return list; |
2186 } | 2186 } |
2187 case CSSPropertyAnimationTimingFunction: | 2187 case CSSPropertyAnimationTimingFunction: |
2188 return valueForAnimationTimingFunction(style.animations()); | 2188 return valueForAnimationTimingFunction(style.animations()); |
2189 case CSSPropertyAnimation: { | 2189 case CSSPropertyAnimation: { |
2190 const CSSAnimationData* animationData = style.animations(); | 2190 const CSSAnimationData* animationData = style.animations(); |
2191 if (animationData) { | 2191 if (animationData) { |
2192 RawPtr<CSSValueList> animationsList = CSSValueList::createCommaSepar
ated(); | 2192 CSSValueList* animationsList = CSSValueList::createCommaSeparated(); |
2193 for (size_t i = 0; i < animationData->nameList().size(); ++i) { | 2193 for (size_t i = 0; i < animationData->nameList().size(); ++i) { |
2194 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 2194 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
2195 list->append(CSSCustomIdentValue::create(animationData->nameList
()[i])); | 2195 list->append(CSSCustomIdentValue::create(animationData->nameList
()[i])); |
2196 list->append(cssValuePool().createValue(CSSTimingData::getRepeat
ed(animationData->durationList(), i), CSSPrimitiveValue::UnitType::Seconds)); | 2196 list->append(cssValuePool().createValue(CSSTimingData::getRepeat
ed(animationData->durationList(), i), CSSPrimitiveValue::UnitType::Seconds)); |
2197 list->append(createTimingFunctionValue(CSSTimingData::getRepeate
d(animationData->timingFunctionList(), i).get())); | 2197 list->append(createTimingFunctionValue(CSSTimingData::getRepeate
d(animationData->timingFunctionList(), i).get())); |
2198 list->append(cssValuePool().createValue(CSSTimingData::getRepeat
ed(animationData->delayList(), i), CSSPrimitiveValue::UnitType::Seconds)); | 2198 list->append(cssValuePool().createValue(CSSTimingData::getRepeat
ed(animationData->delayList(), i), CSSPrimitiveValue::UnitType::Seconds)); |
2199 list->append(valueForAnimationIterationCount(CSSTimingData::getR
epeated(animationData->iterationCountList(), i))); | 2199 list->append(valueForAnimationIterationCount(CSSTimingData::getR
epeated(animationData->iterationCountList(), i))); |
2200 list->append(valueForAnimationDirection(CSSTimingData::getRepeat
ed(animationData->directionList(), i))); | 2200 list->append(valueForAnimationDirection(CSSTimingData::getRepeat
ed(animationData->directionList(), i))); |
2201 list->append(valueForAnimationFillMode(CSSTimingData::getRepeate
d(animationData->fillModeList(), i))); | 2201 list->append(valueForAnimationFillMode(CSSTimingData::getRepeate
d(animationData->fillModeList(), i))); |
2202 list->append(valueForAnimationPlayState(CSSTimingData::getRepeat
ed(animationData->playStateList(), i))); | 2202 list->append(valueForAnimationPlayState(CSSTimingData::getRepeat
ed(animationData->playStateList(), i))); |
2203 animationsList->append(list); | 2203 animationsList->append(list); |
2204 } | 2204 } |
2205 return animationsList.release(); | 2205 return animationsList; |
2206 } | 2206 } |
2207 | 2207 |
2208 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | 2208 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
2209 // animation-name default value. | 2209 // animation-name default value. |
2210 list->append(cssValuePool().createIdentifierValue(CSSValueNone)); | 2210 list->append(cssValuePool().createIdentifierValue(CSSValueNone)); |
2211 list->append(cssValuePool().createValue(CSSAnimationData::initialDuratio
n(), CSSPrimitiveValue::UnitType::Seconds)); | 2211 list->append(cssValuePool().createValue(CSSAnimationData::initialDuratio
n(), CSSPrimitiveValue::UnitType::Seconds)); |
2212 list->append(createTimingFunctionValue(CSSAnimationData::initialTimingFu
nction().get())); | 2212 list->append(createTimingFunctionValue(CSSAnimationData::initialTimingFu
nction().get())); |
2213 list->append(cssValuePool().createValue(CSSAnimationData::initialDelay()
, CSSPrimitiveValue::UnitType::Seconds)); | 2213 list->append(cssValuePool().createValue(CSSAnimationData::initialDelay()
, CSSPrimitiveValue::UnitType::Seconds)); |
2214 list->append(cssValuePool().createValue(CSSAnimationData::initialIterati
onCount(), CSSPrimitiveValue::UnitType::Number)); | 2214 list->append(cssValuePool().createValue(CSSAnimationData::initialIterati
onCount(), CSSPrimitiveValue::UnitType::Number)); |
2215 list->append(valueForAnimationDirection(CSSAnimationData::initialDirecti
on())); | 2215 list->append(valueForAnimationDirection(CSSAnimationData::initialDirecti
on())); |
2216 list->append(valueForAnimationFillMode(CSSAnimationData::initialFillMode
())); | 2216 list->append(valueForAnimationFillMode(CSSAnimationData::initialFillMode
())); |
2217 // Initial animation-play-state. | 2217 // Initial animation-play-state. |
2218 list->append(cssValuePool().createIdentifierValue(CSSValueRunning)); | 2218 list->append(cssValuePool().createIdentifierValue(CSSValueRunning)); |
2219 return list.release(); | 2219 return list; |
2220 } | 2220 } |
2221 case CSSPropertyWebkitAppearance: | 2221 case CSSPropertyWebkitAppearance: |
2222 return cssValuePool().createValue(style.appearance()); | 2222 return cssValuePool().createValue(style.appearance()); |
2223 case CSSPropertyBackfaceVisibility: | 2223 case CSSPropertyBackfaceVisibility: |
2224 return cssValuePool().createIdentifierValue((style.backfaceVisibility()
== BackfaceVisibilityHidden) ? CSSValueHidden : CSSValueVisible); | 2224 return cssValuePool().createIdentifierValue((style.backfaceVisibility()
== BackfaceVisibilityHidden) ? CSSValueHidden : CSSValueVisible); |
2225 case CSSPropertyWebkitBorderImage: | 2225 case CSSPropertyWebkitBorderImage: |
2226 return valueForNinePieceImage(style.borderImage(), style); | 2226 return valueForNinePieceImage(style.borderImage(), style); |
2227 case CSSPropertyBorderImageOutset: | 2227 case CSSPropertyBorderImageOutset: |
2228 return valueForNinePieceImageQuad(style.borderImage().outset(), style); | 2228 return valueForNinePieceImageQuad(style.borderImage().outset(), style); |
2229 case CSSPropertyBorderImageRepeat: | 2229 case CSSPropertyBorderImageRepeat: |
(...skipping 23 matching lines...) Expand all Loading... |
2253 case CSSPropertyWebkitMarginAfterCollapse: | 2253 case CSSPropertyWebkitMarginAfterCollapse: |
2254 return cssValuePool().createValue(style.marginAfterCollapse()); | 2254 return cssValuePool().createValue(style.marginAfterCollapse()); |
2255 case CSSPropertyWebkitMarginTopCollapse: | 2255 case CSSPropertyWebkitMarginTopCollapse: |
2256 case CSSPropertyWebkitMarginBeforeCollapse: | 2256 case CSSPropertyWebkitMarginBeforeCollapse: |
2257 return cssValuePool().createValue(style.marginBeforeCollapse()); | 2257 return cssValuePool().createValue(style.marginBeforeCollapse()); |
2258 case CSSPropertyPerspective: | 2258 case CSSPropertyPerspective: |
2259 if (!style.hasPerspective()) | 2259 if (!style.hasPerspective()) |
2260 return cssValuePool().createIdentifierValue(CSSValueNone); | 2260 return cssValuePool().createIdentifierValue(CSSValueNone); |
2261 return zoomAdjustedPixelValue(style.perspective(), style); | 2261 return zoomAdjustedPixelValue(style.perspective(), style); |
2262 case CSSPropertyPerspectiveOrigin: { | 2262 case CSSPropertyPerspectiveOrigin: { |
2263 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | 2263 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
2264 if (layoutObject) { | 2264 if (layoutObject) { |
2265 LayoutRect box; | 2265 LayoutRect box; |
2266 if (layoutObject->isBox()) | 2266 if (layoutObject->isBox()) |
2267 box = toLayoutBox(layoutObject)->borderBoxRect(); | 2267 box = toLayoutBox(layoutObject)->borderBoxRect(); |
2268 | 2268 |
2269 list->append(zoomAdjustedPixelValue(minimumValueForLength(style.pers
pectiveOriginX(), box.width()), style)); | 2269 list->append(zoomAdjustedPixelValue(minimumValueForLength(style.pers
pectiveOriginX(), box.width()), style)); |
2270 list->append(zoomAdjustedPixelValue(minimumValueForLength(style.pers
pectiveOriginY(), box.height()), style)); | 2270 list->append(zoomAdjustedPixelValue(minimumValueForLength(style.pers
pectiveOriginY(), box.height()), style)); |
2271 } else { | 2271 } else { |
2272 list->append(zoomAdjustedPixelValueForLength(style.perspectiveOrigin
X(), style)); | 2272 list->append(zoomAdjustedPixelValueForLength(style.perspectiveOrigin
X(), style)); |
2273 list->append(zoomAdjustedPixelValueForLength(style.perspectiveOrigin
Y(), style)); | 2273 list->append(zoomAdjustedPixelValueForLength(style.perspectiveOrigin
Y(), style)); |
2274 } | 2274 } |
2275 return list.release(); | 2275 return list; |
2276 } | 2276 } |
2277 case CSSPropertyWebkitRtlOrdering: | 2277 case CSSPropertyWebkitRtlOrdering: |
2278 return cssValuePool().createIdentifierValue(style.rtlOrdering() ? CSSVal
ueVisual : CSSValueLogical); | 2278 return cssValuePool().createIdentifierValue(style.rtlOrdering() ? CSSVal
ueVisual : CSSValueLogical); |
2279 case CSSPropertyWebkitTapHighlightColor: | 2279 case CSSPropertyWebkitTapHighlightColor: |
2280 return currentColorOrValidColor(style, style.tapHighlightColor()); | 2280 return currentColorOrValidColor(style, style.tapHighlightColor()); |
2281 case CSSPropertyWebkitUserDrag: | 2281 case CSSPropertyWebkitUserDrag: |
2282 return cssValuePool().createValue(style.userDrag()); | 2282 return cssValuePool().createValue(style.userDrag()); |
2283 case CSSPropertyWebkitUserSelect: | 2283 case CSSPropertyWebkitUserSelect: |
2284 return cssValuePool().createValue(style.userSelect()); | 2284 return cssValuePool().createValue(style.userSelect()); |
2285 case CSSPropertyBorderBottomLeftRadius: | 2285 case CSSPropertyBorderBottomLeftRadius: |
2286 return valueForBorderRadiusCorner(style.borderBottomLeftRadius(), style)
; | 2286 return valueForBorderRadiusCorner(style.borderBottomLeftRadius(), style)
; |
2287 case CSSPropertyBorderBottomRightRadius: | 2287 case CSSPropertyBorderBottomRightRadius: |
2288 return valueForBorderRadiusCorner(style.borderBottomRightRadius(), style
); | 2288 return valueForBorderRadiusCorner(style.borderBottomRightRadius(), style
); |
2289 case CSSPropertyBorderTopLeftRadius: | 2289 case CSSPropertyBorderTopLeftRadius: |
2290 return valueForBorderRadiusCorner(style.borderTopLeftRadius(), style); | 2290 return valueForBorderRadiusCorner(style.borderTopLeftRadius(), style); |
2291 case CSSPropertyBorderTopRightRadius: | 2291 case CSSPropertyBorderTopRightRadius: |
2292 return valueForBorderRadiusCorner(style.borderTopRightRadius(), style); | 2292 return valueForBorderRadiusCorner(style.borderTopRightRadius(), style); |
2293 case CSSPropertyClip: { | 2293 case CSSPropertyClip: { |
2294 if (style.hasAutoClip()) | 2294 if (style.hasAutoClip()) |
2295 return cssValuePool().createIdentifierValue(CSSValueAuto); | 2295 return cssValuePool().createIdentifierValue(CSSValueAuto); |
2296 RawPtr<CSSPrimitiveValue> top = style.clip().top().isAuto() | 2296 CSSPrimitiveValue* top = style.clip().top().isAuto() |
2297 ? cssValuePool().createIdentifierValue(CSSValueAuto) | 2297 ? cssValuePool().createIdentifierValue(CSSValueAuto) |
2298 : zoomAdjustedPixelValue(style.clip().top().value(), style); | 2298 : zoomAdjustedPixelValue(style.clip().top().value(), style); |
2299 RawPtr<CSSPrimitiveValue> right = style.clip().right().isAuto() | 2299 CSSPrimitiveValue* right = style.clip().right().isAuto() |
2300 ? cssValuePool().createIdentifierValue(CSSValueAuto) | 2300 ? cssValuePool().createIdentifierValue(CSSValueAuto) |
2301 : zoomAdjustedPixelValue(style.clip().right().value(), style); | 2301 : zoomAdjustedPixelValue(style.clip().right().value(), style); |
2302 RawPtr<CSSPrimitiveValue> bottom = style.clip().bottom().isAuto() | 2302 CSSPrimitiveValue* bottom = style.clip().bottom().isAuto() |
2303 ? cssValuePool().createIdentifierValue(CSSValueAuto) | 2303 ? cssValuePool().createIdentifierValue(CSSValueAuto) |
2304 : zoomAdjustedPixelValue(style.clip().bottom().value(), style); | 2304 : zoomAdjustedPixelValue(style.clip().bottom().value(), style); |
2305 RawPtr<CSSPrimitiveValue> left = style.clip().left().isAuto() | 2305 CSSPrimitiveValue* left = style.clip().left().isAuto() |
2306 ? cssValuePool().createIdentifierValue(CSSValueAuto) | 2306 ? cssValuePool().createIdentifierValue(CSSValueAuto) |
2307 : zoomAdjustedPixelValue(style.clip().left().value(), style); | 2307 : zoomAdjustedPixelValue(style.clip().left().value(), style); |
2308 return CSSQuadValue::create(top.release(), right.release(), bottom.relea
se(), left.release(), CSSQuadValue::SerializeAsRect); | 2308 return CSSQuadValue::create(top, right, bottom, left, CSSQuadValue::Seri
alizeAsRect); |
2309 } | 2309 } |
2310 case CSSPropertySpeak: | 2310 case CSSPropertySpeak: |
2311 return cssValuePool().createValue(style.speak()); | 2311 return cssValuePool().createValue(style.speak()); |
2312 case CSSPropertyTransform: | 2312 case CSSPropertyTransform: |
2313 return computedTransform(layoutObject, style); | 2313 return computedTransform(layoutObject, style); |
2314 case CSSPropertyTransformOrigin: { | 2314 case CSSPropertyTransformOrigin: { |
2315 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | 2315 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
2316 if (layoutObject) { | 2316 if (layoutObject) { |
2317 LayoutRect box; | 2317 LayoutRect box; |
2318 if (layoutObject->isBox()) | 2318 if (layoutObject->isBox()) |
2319 box = toLayoutBox(layoutObject)->borderBoxRect(); | 2319 box = toLayoutBox(layoutObject)->borderBoxRect(); |
2320 | 2320 |
2321 list->append(zoomAdjustedPixelValue(minimumValueForLength(style.tran
sformOriginX(), box.width()), style)); | 2321 list->append(zoomAdjustedPixelValue(minimumValueForLength(style.tran
sformOriginX(), box.width()), style)); |
2322 list->append(zoomAdjustedPixelValue(minimumValueForLength(style.tran
sformOriginY(), box.height()), style)); | 2322 list->append(zoomAdjustedPixelValue(minimumValueForLength(style.tran
sformOriginY(), box.height()), style)); |
2323 if (style.transformOriginZ() != 0) | 2323 if (style.transformOriginZ() != 0) |
2324 list->append(zoomAdjustedPixelValue(style.transformOriginZ(), st
yle)); | 2324 list->append(zoomAdjustedPixelValue(style.transformOriginZ(), st
yle)); |
2325 } else { | 2325 } else { |
2326 list->append(zoomAdjustedPixelValueForLength(style.transformOriginX(
), style)); | 2326 list->append(zoomAdjustedPixelValueForLength(style.transformOriginX(
), style)); |
2327 list->append(zoomAdjustedPixelValueForLength(style.transformOriginY(
), style)); | 2327 list->append(zoomAdjustedPixelValueForLength(style.transformOriginY(
), style)); |
2328 if (style.transformOriginZ() != 0) | 2328 if (style.transformOriginZ() != 0) |
2329 list->append(zoomAdjustedPixelValue(style.transformOriginZ(), st
yle)); | 2329 list->append(zoomAdjustedPixelValue(style.transformOriginZ(), st
yle)); |
2330 } | 2330 } |
2331 return list.release(); | 2331 return list; |
2332 } | 2332 } |
2333 case CSSPropertyTransformStyle: | 2333 case CSSPropertyTransformStyle: |
2334 return cssValuePool().createIdentifierValue((style.transformStyle3D() ==
TransformStyle3DPreserve3D) ? CSSValuePreserve3d : CSSValueFlat); | 2334 return cssValuePool().createIdentifierValue((style.transformStyle3D() ==
TransformStyle3DPreserve3D) ? CSSValuePreserve3d : CSSValueFlat); |
2335 case CSSPropertyTransitionDelay: | 2335 case CSSPropertyTransitionDelay: |
2336 return valueForAnimationDelay(style.transitions()); | 2336 return valueForAnimationDelay(style.transitions()); |
2337 case CSSPropertyTransitionDuration: | 2337 case CSSPropertyTransitionDuration: |
2338 return valueForAnimationDuration(style.transitions()); | 2338 return valueForAnimationDuration(style.transitions()); |
2339 case CSSPropertyTransitionProperty: | 2339 case CSSPropertyTransitionProperty: |
2340 return valueForTransitionProperty(style.transitions()); | 2340 return valueForTransitionProperty(style.transitions()); |
2341 case CSSPropertyTransitionTimingFunction: | 2341 case CSSPropertyTransitionTimingFunction: |
2342 return valueForAnimationTimingFunction(style.transitions()); | 2342 return valueForAnimationTimingFunction(style.transitions()); |
2343 case CSSPropertyTransition: { | 2343 case CSSPropertyTransition: { |
2344 const CSSTransitionData* transitionData = style.transitions(); | 2344 const CSSTransitionData* transitionData = style.transitions(); |
2345 if (transitionData) { | 2345 if (transitionData) { |
2346 RawPtr<CSSValueList> transitionsList = CSSValueList::createCommaSepa
rated(); | 2346 CSSValueList* transitionsList = CSSValueList::createCommaSeparated()
; |
2347 for (size_t i = 0; i < transitionData->propertyList().size(); ++i) { | 2347 for (size_t i = 0; i < transitionData->propertyList().size(); ++i) { |
2348 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 2348 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
2349 list->append(createTransitionPropertyValue(transitionData->prope
rtyList()[i])); | 2349 list->append(createTransitionPropertyValue(transitionData->prope
rtyList()[i])); |
2350 list->append(cssValuePool().createValue(CSSTimingData::getRepeat
ed(transitionData->durationList(), i), CSSPrimitiveValue::UnitType::Seconds)); | 2350 list->append(cssValuePool().createValue(CSSTimingData::getRepeat
ed(transitionData->durationList(), i), CSSPrimitiveValue::UnitType::Seconds)); |
2351 list->append(createTimingFunctionValue(CSSTimingData::getRepeate
d(transitionData->timingFunctionList(), i).get())); | 2351 list->append(createTimingFunctionValue(CSSTimingData::getRepeate
d(transitionData->timingFunctionList(), i).get())); |
2352 list->append(cssValuePool().createValue(CSSTimingData::getRepeat
ed(transitionData->delayList(), i), CSSPrimitiveValue::UnitType::Seconds)); | 2352 list->append(cssValuePool().createValue(CSSTimingData::getRepeat
ed(transitionData->delayList(), i), CSSPrimitiveValue::UnitType::Seconds)); |
2353 transitionsList->append(list); | 2353 transitionsList->append(list); |
2354 } | 2354 } |
2355 return transitionsList.release(); | 2355 return transitionsList; |
2356 } | 2356 } |
2357 | 2357 |
2358 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | 2358 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
2359 // transition-property default value. | 2359 // transition-property default value. |
2360 list->append(cssValuePool().createIdentifierValue(CSSValueAll)); | 2360 list->append(cssValuePool().createIdentifierValue(CSSValueAll)); |
2361 list->append(cssValuePool().createValue(CSSTransitionData::initialDurati
on(), CSSPrimitiveValue::UnitType::Seconds)); | 2361 list->append(cssValuePool().createValue(CSSTransitionData::initialDurati
on(), CSSPrimitiveValue::UnitType::Seconds)); |
2362 list->append(createTimingFunctionValue(CSSTransitionData::initialTimingF
unction().get())); | 2362 list->append(createTimingFunctionValue(CSSTransitionData::initialTimingF
unction().get())); |
2363 list->append(cssValuePool().createValue(CSSTransitionData::initialDelay(
), CSSPrimitiveValue::UnitType::Seconds)); | 2363 list->append(cssValuePool().createValue(CSSTransitionData::initialDelay(
), CSSPrimitiveValue::UnitType::Seconds)); |
2364 return list.release(); | 2364 return list; |
2365 } | 2365 } |
2366 case CSSPropertyPointerEvents: | 2366 case CSSPropertyPointerEvents: |
2367 return cssValuePool().createValue(style.pointerEvents()); | 2367 return cssValuePool().createValue(style.pointerEvents()); |
2368 case CSSPropertyWritingMode: | 2368 case CSSPropertyWritingMode: |
2369 case CSSPropertyWebkitWritingMode: | 2369 case CSSPropertyWebkitWritingMode: |
2370 return cssValuePool().createValue(style.getWritingMode()); | 2370 return cssValuePool().createValue(style.getWritingMode()); |
2371 case CSSPropertyWebkitTextCombine: | 2371 case CSSPropertyWebkitTextCombine: |
2372 if (style.getTextCombine() == TextCombineAll) | 2372 if (style.getTextCombine() == TextCombineAll) |
2373 return CSSPrimitiveValue::createIdentifier(CSSValueHorizontal); | 2373 return CSSPrimitiveValue::createIdentifier(CSSValueHorizontal); |
2374 case CSSPropertyTextCombineUpright: | 2374 case CSSPropertyTextCombineUpright: |
(...skipping 28 matching lines...) Expand all Loading... |
2403 case CSSPropertyShapeOutside: | 2403 case CSSPropertyShapeOutside: |
2404 return valueForShape(style, style.shapeOutside()); | 2404 return valueForShape(style, style.shapeOutside()); |
2405 case CSSPropertyWebkitFilter: | 2405 case CSSPropertyWebkitFilter: |
2406 return valueForFilter(style, style.filter()); | 2406 return valueForFilter(style, style.filter()); |
2407 case CSSPropertyBackdropFilter: | 2407 case CSSPropertyBackdropFilter: |
2408 return valueForFilter(style, style.backdropFilter()); | 2408 return valueForFilter(style, style.backdropFilter()); |
2409 case CSSPropertyMixBlendMode: | 2409 case CSSPropertyMixBlendMode: |
2410 return cssValuePool().createValue(style.blendMode()); | 2410 return cssValuePool().createValue(style.blendMode()); |
2411 | 2411 |
2412 case CSSPropertyBackgroundBlendMode: { | 2412 case CSSPropertyBackgroundBlendMode: { |
2413 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); | 2413 CSSValueList* list = CSSValueList::createCommaSeparated(); |
2414 for (const FillLayer* currLayer = &style.backgroundLayers(); currLayer;
currLayer = currLayer->next()) | 2414 for (const FillLayer* currLayer = &style.backgroundLayers(); currLayer;
currLayer = currLayer->next()) |
2415 list->append(cssValuePool().createValue(currLayer->blendMode())); | 2415 list->append(cssValuePool().createValue(currLayer->blendMode())); |
2416 return list.release(); | 2416 return list; |
2417 } | 2417 } |
2418 case CSSPropertyBackground: | 2418 case CSSPropertyBackground: |
2419 return valuesForBackgroundShorthand(style, layoutObject, styledNode, all
owVisitedStyle); | 2419 return valuesForBackgroundShorthand(style, layoutObject, styledNode, all
owVisitedStyle); |
2420 case CSSPropertyBorder: { | 2420 case CSSPropertyBorder: { |
2421 RawPtr<CSSValue> value = get(CSSPropertyBorderTop, style, layoutObject,
styledNode, allowVisitedStyle); | 2421 CSSValue* value = get(CSSPropertyBorderTop, style, layoutObject, styledN
ode, allowVisitedStyle); |
2422 const CSSPropertyID properties[] = { | 2422 const CSSPropertyID properties[] = { |
2423 CSSPropertyBorderRight, | 2423 CSSPropertyBorderRight, |
2424 CSSPropertyBorderBottom, | 2424 CSSPropertyBorderBottom, |
2425 CSSPropertyBorderLeft | 2425 CSSPropertyBorderLeft |
2426 }; | 2426 }; |
2427 for (size_t i = 0; i < WTF_ARRAY_LENGTH(properties); ++i) { | 2427 for (size_t i = 0; i < WTF_ARRAY_LENGTH(properties); ++i) { |
2428 if (!compareCSSValuePtr<CSSValue>(value, get(properties[i], style, l
ayoutObject, styledNode, allowVisitedStyle))) | 2428 if (!compareCSSValuePtr<CSSValue>(value, get(properties[i], style, l
ayoutObject, styledNode, allowVisitedStyle))) |
2429 return nullptr; | 2429 return nullptr; |
2430 } | 2430 } |
2431 return value.release(); | 2431 return value; |
2432 } | 2432 } |
2433 case CSSPropertyBorderBottom: | 2433 case CSSPropertyBorderBottom: |
2434 return valuesForShorthandProperty(borderBottomShorthand(), style, layout
Object, styledNode, allowVisitedStyle); | 2434 return valuesForShorthandProperty(borderBottomShorthand(), style, layout
Object, styledNode, allowVisitedStyle); |
2435 case CSSPropertyBorderColor: | 2435 case CSSPropertyBorderColor: |
2436 return valuesForSidesShorthand(borderColorShorthand(), style, layoutObje
ct, styledNode, allowVisitedStyle); | 2436 return valuesForSidesShorthand(borderColorShorthand(), style, layoutObje
ct, styledNode, allowVisitedStyle); |
2437 case CSSPropertyBorderLeft: | 2437 case CSSPropertyBorderLeft: |
2438 return valuesForShorthandProperty(borderLeftShorthand(), style, layoutOb
ject, styledNode, allowVisitedStyle); | 2438 return valuesForShorthandProperty(borderLeftShorthand(), style, layoutOb
ject, styledNode, allowVisitedStyle); |
2439 case CSSPropertyBorderImage: | 2439 case CSSPropertyBorderImage: |
2440 return valueForNinePieceImage(style.borderImage(), style); | 2440 return valueForNinePieceImage(style.borderImage(), style); |
2441 case CSSPropertyBorderRadius: | 2441 case CSSPropertyBorderRadius: |
(...skipping 28 matching lines...) Expand all Loading... |
2470 | 2470 |
2471 case CSSPropertyMotionPath: | 2471 case CSSPropertyMotionPath: |
2472 if (const StylePath* styleMotionPath = style.motionPath()) | 2472 if (const StylePath* styleMotionPath = style.motionPath()) |
2473 return styleMotionPath->computedCSSValue(); | 2473 return styleMotionPath->computedCSSValue(); |
2474 return cssValuePool().createIdentifierValue(CSSValueNone); | 2474 return cssValuePool().createIdentifierValue(CSSValueNone); |
2475 | 2475 |
2476 case CSSPropertyMotionOffset: | 2476 case CSSPropertyMotionOffset: |
2477 return zoomAdjustedPixelValueForLength(style.motionOffset(), style); | 2477 return zoomAdjustedPixelValueForLength(style.motionOffset(), style); |
2478 | 2478 |
2479 case CSSPropertyMotionRotation: { | 2479 case CSSPropertyMotionRotation: { |
2480 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | 2480 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
2481 if (style.motionRotation().type == MotionRotationAuto) | 2481 if (style.motionRotation().type == MotionRotationAuto) |
2482 list->append(cssValuePool().createIdentifierValue(CSSValueAuto)); | 2482 list->append(cssValuePool().createIdentifierValue(CSSValueAuto)); |
2483 list->append(cssValuePool().createValue(style.motionRotation().angle, CS
SPrimitiveValue::UnitType::Degrees)); | 2483 list->append(cssValuePool().createValue(style.motionRotation().angle, CS
SPrimitiveValue::UnitType::Degrees)); |
2484 return list.release(); | 2484 return list; |
2485 } | 2485 } |
2486 | 2486 |
2487 // Unimplemented CSS 3 properties (including CSS3 shorthand properties). | 2487 // Unimplemented CSS 3 properties (including CSS3 shorthand properties). |
2488 case CSSPropertyWebkitTextEmphasis: | 2488 case CSSPropertyWebkitTextEmphasis: |
2489 return nullptr; | 2489 return nullptr; |
2490 | 2490 |
2491 // Directional properties are resolved by resolveDirectionAwareProperty() be
fore the switch. | 2491 // Directional properties are resolved by resolveDirectionAwareProperty() be
fore the switch. |
2492 case CSSPropertyWebkitBorderEnd: | 2492 case CSSPropertyWebkitBorderEnd: |
2493 case CSSPropertyWebkitBorderEndColor: | 2493 case CSSPropertyWebkitBorderEndColor: |
2494 case CSSPropertyWebkitBorderEndStyle: | 2494 case CSSPropertyWebkitBorderEndStyle: |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2673 case CSSPropertyScrollSnapPointsY: | 2673 case CSSPropertyScrollSnapPointsY: |
2674 return valueForScrollSnapPoints(style.scrollSnapPointsY(), style); | 2674 return valueForScrollSnapPoints(style.scrollSnapPointsY(), style); |
2675 case CSSPropertyScrollSnapCoordinate: | 2675 case CSSPropertyScrollSnapCoordinate: |
2676 return valueForScrollSnapCoordinate(style.scrollSnapCoordinate(), style)
; | 2676 return valueForScrollSnapCoordinate(style.scrollSnapCoordinate(), style)
; |
2677 case CSSPropertyScrollSnapDestination: | 2677 case CSSPropertyScrollSnapDestination: |
2678 return valueForScrollSnapDestination(style.scrollSnapDestination(), styl
e); | 2678 return valueForScrollSnapDestination(style.scrollSnapDestination(), styl
e); |
2679 case CSSPropertyTranslate: { | 2679 case CSSPropertyTranslate: { |
2680 if (!style.translate()) | 2680 if (!style.translate()) |
2681 return cssValuePool().createValue(0, CSSPrimitiveValue::UnitType::Pi
xels); | 2681 return cssValuePool().createValue(0, CSSPrimitiveValue::UnitType::Pi
xels); |
2682 | 2682 |
2683 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | 2683 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
2684 if (layoutObject && layoutObject->isBox()) { | 2684 if (layoutObject && layoutObject->isBox()) { |
2685 LayoutRect box = toLayoutBox(layoutObject)->borderBoxRect(); | 2685 LayoutRect box = toLayoutBox(layoutObject)->borderBoxRect(); |
2686 list->append(zoomAdjustedPixelValue(floatValueForLength(style.transl
ate()->x(), box.width().toFloat()), style)); | 2686 list->append(zoomAdjustedPixelValue(floatValueForLength(style.transl
ate()->x(), box.width().toFloat()), style)); |
2687 | 2687 |
2688 if (!style.translate()->y().isZero() || style.translate()->z() != 0) | 2688 if (!style.translate()->y().isZero() || style.translate()->z() != 0) |
2689 list->append(zoomAdjustedPixelValue(floatValueForLength(style.tr
anslate()->y(), box.height().toFloat()), style)); | 2689 list->append(zoomAdjustedPixelValue(floatValueForLength(style.tr
anslate()->y(), box.height().toFloat()), style)); |
2690 | 2690 |
2691 } else { | 2691 } else { |
2692 // No box to resolve the percentage values | 2692 // No box to resolve the percentage values |
2693 list->append(zoomAdjustedPixelValueForLength(style.translate()->x(),
style)); | 2693 list->append(zoomAdjustedPixelValueForLength(style.translate()->x(),
style)); |
2694 | 2694 |
2695 if (!style.translate()->y().isZero() || style.translate()->z() != 0) | 2695 if (!style.translate()->y().isZero() || style.translate()->z() != 0) |
2696 list->append(zoomAdjustedPixelValueForLength(style.translate()->
y(), style)); | 2696 list->append(zoomAdjustedPixelValueForLength(style.translate()->
y(), style)); |
2697 } | 2697 } |
2698 | 2698 |
2699 if (style.translate()->z() != 0) | 2699 if (style.translate()->z() != 0) |
2700 list->append(zoomAdjustedPixelValue(style.translate()->z(), style)); | 2700 list->append(zoomAdjustedPixelValue(style.translate()->z(), style)); |
2701 | 2701 |
2702 return list.release(); | 2702 return list; |
2703 } | 2703 } |
2704 case CSSPropertyRotate: { | 2704 case CSSPropertyRotate: { |
2705 if (!style.rotate()) | 2705 if (!style.rotate()) |
2706 return cssValuePool().createValue(0, CSSPrimitiveValue::UnitType::De
grees); | 2706 return cssValuePool().createValue(0, CSSPrimitiveValue::UnitType::De
grees); |
2707 | 2707 |
2708 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | 2708 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
2709 list->append(cssValuePool().createValue(style.rotate()->angle(), CSSPrim
itiveValue::UnitType::Degrees)); | 2709 list->append(cssValuePool().createValue(style.rotate()->angle(), CSSPrim
itiveValue::UnitType::Degrees)); |
2710 if (style.rotate()->x() != 0 || style.rotate()->y() != 0 || style.rotate
()->z() != 1) { | 2710 if (style.rotate()->x() != 0 || style.rotate()->y() != 0 || style.rotate
()->z() != 1) { |
2711 list->append(cssValuePool().createValue(style.rotate()->x(), CSSPrim
itiveValue::UnitType::Number)); | 2711 list->append(cssValuePool().createValue(style.rotate()->x(), CSSPrim
itiveValue::UnitType::Number)); |
2712 list->append(cssValuePool().createValue(style.rotate()->y(), CSSPrim
itiveValue::UnitType::Number)); | 2712 list->append(cssValuePool().createValue(style.rotate()->y(), CSSPrim
itiveValue::UnitType::Number)); |
2713 list->append(cssValuePool().createValue(style.rotate()->z(), CSSPrim
itiveValue::UnitType::Number)); | 2713 list->append(cssValuePool().createValue(style.rotate()->z(), CSSPrim
itiveValue::UnitType::Number)); |
2714 } | 2714 } |
2715 return list.release(); | 2715 return list; |
2716 } | 2716 } |
2717 case CSSPropertyScale: { | 2717 case CSSPropertyScale: { |
2718 if (!style.scale()) | 2718 if (!style.scale()) |
2719 return cssValuePool().createValue(1, CSSPrimitiveValue::UnitType::Nu
mber); | 2719 return cssValuePool().createValue(1, CSSPrimitiveValue::UnitType::Nu
mber); |
2720 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | 2720 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
2721 list->append(cssValuePool().createValue(style.scale()->x(), CSSPrimitive
Value::UnitType::Number)); | 2721 list->append(cssValuePool().createValue(style.scale()->x(), CSSPrimitive
Value::UnitType::Number)); |
2722 if (style.scale()->y() == 1 && style.scale()->z() == 1) | 2722 if (style.scale()->y() == 1 && style.scale()->z() == 1) |
2723 return list.release(); | 2723 return list; |
2724 list->append(cssValuePool().createValue(style.scale()->y(), CSSPrimitive
Value::UnitType::Number)); | 2724 list->append(cssValuePool().createValue(style.scale()->y(), CSSPrimitive
Value::UnitType::Number)); |
2725 if (style.scale()->z() != 1) | 2725 if (style.scale()->z() != 1) |
2726 list->append(cssValuePool().createValue(style.scale()->z(), CSSPrimi
tiveValue::UnitType::Number)); | 2726 list->append(cssValuePool().createValue(style.scale()->z(), CSSPrimi
tiveValue::UnitType::Number)); |
2727 return list.release(); | 2727 return list; |
2728 } | 2728 } |
2729 case CSSPropertyContain: { | 2729 case CSSPropertyContain: { |
2730 if (!style.contain()) | 2730 if (!style.contain()) |
2731 return cssValuePool().createIdentifierValue(CSSValueNone); | 2731 return cssValuePool().createIdentifierValue(CSSValueNone); |
2732 if (style.contain() == ContainsStrict) | 2732 if (style.contain() == ContainsStrict) |
2733 return cssValuePool().createIdentifierValue(CSSValueStrict); | 2733 return cssValuePool().createIdentifierValue(CSSValueStrict); |
2734 | 2734 |
2735 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | 2735 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
2736 if (style.containsStyle()) | 2736 if (style.containsStyle()) |
2737 list->append(cssValuePool().createIdentifierValue(CSSValueStyle)); | 2737 list->append(cssValuePool().createIdentifierValue(CSSValueStyle)); |
2738 if (style.contain() & ContainsLayout) | 2738 if (style.contain() & ContainsLayout) |
2739 list->append(cssValuePool().createIdentifierValue(CSSValueLayout)); | 2739 list->append(cssValuePool().createIdentifierValue(CSSValueLayout)); |
2740 if (style.containsPaint()) | 2740 if (style.containsPaint()) |
2741 list->append(cssValuePool().createIdentifierValue(CSSValuePaint)); | 2741 list->append(cssValuePool().createIdentifierValue(CSSValuePaint)); |
2742 ASSERT(list->length()); | 2742 ASSERT(list->length()); |
2743 return list.release(); | 2743 return list; |
2744 } | 2744 } |
2745 case CSSPropertySnapHeight: { | 2745 case CSSPropertySnapHeight: { |
2746 if (!style.snapHeightUnit()) | 2746 if (!style.snapHeightUnit()) |
2747 return cssValuePool().createValue(0, CSSPrimitiveValue::UnitType::Pi
xels); | 2747 return cssValuePool().createValue(0, CSSPrimitiveValue::UnitType::Pi
xels); |
2748 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | 2748 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
2749 list->append(cssValuePool().createValue(style.snapHeightUnit(), CSSPrimi
tiveValue::UnitType::Pixels)); | 2749 list->append(cssValuePool().createValue(style.snapHeightUnit(), CSSPrimi
tiveValue::UnitType::Pixels)); |
2750 if (style.snapHeightPosition()) | 2750 if (style.snapHeightPosition()) |
2751 list->append(cssValuePool().createValue(style.snapHeightPosition(),
CSSPrimitiveValue::UnitType::Integer)); | 2751 list->append(cssValuePool().createValue(style.snapHeightPosition(),
CSSPrimitiveValue::UnitType::Integer)); |
2752 return list.release(); | 2752 return list; |
2753 } | 2753 } |
2754 case CSSPropertyVariable: | 2754 case CSSPropertyVariable: |
2755 // Variables are retrieved via get(AtomicString). | 2755 // Variables are retrieved via get(AtomicString). |
2756 ASSERT_NOT_REACHED(); | 2756 ASSERT_NOT_REACHED(); |
2757 return nullptr; | 2757 return nullptr; |
2758 case CSSPropertyAll: | 2758 case CSSPropertyAll: |
2759 return nullptr; | 2759 return nullptr; |
2760 default: | 2760 default: |
2761 break; | 2761 break; |
2762 } | 2762 } |
2763 ASSERT_NOT_REACHED(); | 2763 ASSERT_NOT_REACHED(); |
2764 return nullptr; | 2764 return nullptr; |
2765 } | 2765 } |
2766 | 2766 |
2767 } // namespace blink | 2767 } // namespace blink |
OLD | NEW |