| 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 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> zoomAdjustedPixelValue(d
ouble value, const ComputedStyle& style) | 68 inline static RawPtr<CSSPrimitiveValue> zoomAdjustedPixelValue(double value, con
st ComputedStyle& 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 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> zoomAdjustedNumberValue(
double value, const ComputedStyle& style) | 73 inline static RawPtr<CSSPrimitiveValue> zoomAdjustedNumberValue(double value, co
nst ComputedStyle& 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 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> zoomAdjustedPixelValueForLength
(const Length& length, const ComputedStyle& style) | 78 static RawPtr<CSSPrimitiveValue> zoomAdjustedPixelValueForLength(const Length& l
ength, 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 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> pixelValueForUnzoomedLength(con
st UnzoomedLength& unzoomedLength, const ComputedStyle& style) | 85 static RawPtr<CSSPrimitiveValue> pixelValueForUnzoomedLength(const UnzoomedLengt
h& unzoomedLength, 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 PassRefPtrWillBeRawPtr<CSSValueList> createPositionListForLayer(CSSProper
tyID propertyID, const FillLayer& layer, const ComputedStyle& style) | 93 static RawPtr<CSSValueList> createPositionListForLayer(CSSPropertyID propertyID,
const FillLayer& layer, const ComputedStyle& style) |
| 94 { | 94 { |
| 95 RefPtrWillBeRawPtr<CSSValueList> positionList = CSSValueList::createSpaceSep
arated(); | 95 RawPtr<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.release(); |
| 107 } | 107 } |
| 108 | 108 |
| 109 PassRefPtrWillBeRawPtr<CSSValue> ComputedStyleCSSValueMapping::currentColorOrVal
idColor(const ComputedStyle& style, const StyleColor& color) | 109 RawPtr<CSSValue> ComputedStyleCSSValueMapping::currentColorOrValidColor(const Co
mputedStyle& 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 PassRefPtrWillBeRawPtr<CSSValue> valueForFillSize(const FillSize& fillSiz
e, const ComputedStyle& style) | 115 static RawPtr<CSSValue> valueForFillSize(const FillSize& fillSize, const Compute
dStyle& 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 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 126 RawPtr<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.release(); |
| 130 } | 130 } |
| 131 | 131 |
| 132 static PassRefPtrWillBeRawPtr<CSSValue> valueForFillRepeat(EFillRepeat xRepeat,
EFillRepeat yRepeat) | 132 static RawPtr<CSSValue> valueForFillRepeat(EFillRepeat xRepeat, EFillRepeat yRep
eat) |
| 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 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 143 RawPtr<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.release(); |
| 147 } | 147 } |
| 148 | 148 |
| 149 static PassRefPtrWillBeRawPtr<CSSValue> valueForFillSourceType(EMaskSourceType t
ype) | 149 static RawPtr<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 PassRefPtrWillBeRawPtr<CSSValue> valueForPositionOffset(const ComputedSty
le& style, CSSPropertyID propertyID, const LayoutObject* layoutObject) | 163 static RawPtr<CSSValue> valueForPositionOffset(const ComputedStyle& style, CSSPr
opertyID 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 PassRefPtrWillBeRawPtr<CSSBorderImageSliceValue> valueForNinePieceImageSl
ice(const NinePieceImage& image) | 199 static RawPtr<CSSBorderImageSliceValue> valueForNinePieceImageSlice(const NinePi
eceImage& image) |
| 200 { | 200 { |
| 201 // Create the slices. | 201 // Create the slices. |
| 202 RefPtrWillBeRawPtr<CSSPrimitiveValue> top = nullptr; | 202 RawPtr<CSSPrimitiveValue> top = nullptr; |
| 203 RefPtrWillBeRawPtr<CSSPrimitiveValue> right = nullptr; | 203 RawPtr<CSSPrimitiveValue> right = nullptr; |
| 204 RefPtrWillBeRawPtr<CSSPrimitiveValue> bottom = nullptr; | 204 RawPtr<CSSPrimitiveValue> bottom = nullptr; |
| 205 RefPtrWillBeRawPtr<CSSPrimitiveValue> left = nullptr; | 205 RawPtr<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 21 matching lines...) Expand all Loading... |
| 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.release(),
right.release(), bottom.release(), left.release(), CSSQuadValue::SerializeAsQuad
), image.fill()); |
| 245 } | 245 } |
| 246 | 246 |
| 247 static PassRefPtrWillBeRawPtr<CSSQuadValue> valueForNinePieceImageQuad(const Bor
derImageLengthBox& box, const ComputedStyle& style) | 247 static RawPtr<CSSQuadValue> valueForNinePieceImageQuad(const BorderImageLengthBo
x& box, const ComputedStyle& style) |
| 248 { | 248 { |
| 249 // Create the slices. | 249 // Create the slices. |
| 250 RefPtrWillBeRawPtr<CSSPrimitiveValue> top = nullptr; | 250 RawPtr<CSSPrimitiveValue> top = nullptr; |
| 251 RefPtrWillBeRawPtr<CSSPrimitiveValue> right = nullptr; | 251 RawPtr<CSSPrimitiveValue> right = nullptr; |
| 252 RefPtrWillBeRawPtr<CSSPrimitiveValue> bottom = nullptr; | 252 RawPtr<CSSPrimitiveValue> bottom = nullptr; |
| 253 RefPtrWillBeRawPtr<CSSPrimitiveValue> left = nullptr; | 253 RawPtr<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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 PassRefPtrWillBeRawPtr<CSSValue> valueForNinePieceImageRepeat(const NineP
ieceImage& image) | 307 static RawPtr<CSSValue> valueForNinePieceImageRepeat(const NinePieceImage& image
) |
| 308 { | 308 { |
| 309 RefPtrWillBeRawPtr<CSSPrimitiveValue> horizontalRepeat = nullptr; | 309 RawPtr<CSSPrimitiveValue> horizontalRepeat = nullptr; |
| 310 RefPtrWillBeRawPtr<CSSPrimitiveValue> verticalRepeat = nullptr; | 310 RawPtr<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.release(), verticalRepeat.relea
se(), CSSValuePair::DropIdenticalValues); |
| 318 } | 318 } |
| 319 | 319 |
| 320 static PassRefPtrWillBeRawPtr<CSSValue> valueForNinePieceImage(const NinePieceIm
age& image, const ComputedStyle& style) | 320 static RawPtr<CSSValue> valueForNinePieceImage(const NinePieceImage& image, cons
t ComputedStyle& 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 RefPtrWillBeRawPtr<CSSValue> imageValue = nullptr; | 326 RawPtr<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 RefPtrWillBeRawPtr<CSSBorderImageSliceValue> imageSlices = valueForNinePiece
ImageSlice(image); | 331 RawPtr<CSSBorderImageSliceValue> imageSlices = valueForNinePieceImageSlice(i
mage); |
| 332 | 332 |
| 333 // Create the border area slices. | 333 // Create the border area slices. |
| 334 RefPtrWillBeRawPtr<CSSValue> borderSlices = valueForNinePieceImageQuad(image
.borderSlices(), style); | 334 RawPtr<CSSValue> borderSlices = valueForNinePieceImageQuad(image.borderSlice
s(), style); |
| 335 | 335 |
| 336 // Create the border outset. | 336 // Create the border outset. |
| 337 RefPtrWillBeRawPtr<CSSValue> outset = valueForNinePieceImageQuad(image.outse
t(), style); | 337 RawPtr<CSSValue> outset = valueForNinePieceImageQuad(image.outset(), style); |
| 338 | 338 |
| 339 // Create the repeat rules. | 339 // Create the repeat rules. |
| 340 RefPtrWillBeRawPtr<CSSValue> repeat = valueForNinePieceImageRepeat(image); | 340 RawPtr<CSSValue> repeat = valueForNinePieceImageRepeat(image); |
| 341 | 341 |
| 342 return createBorderImageValue(imageValue.release(), imageSlices.release(), b
orderSlices.release(), outset.release(), repeat.release()); | 342 return createBorderImageValue(imageValue.release(), imageSlices.release(), b
orderSlices.release(), outset.release(), repeat.release()); |
| 343 } | 343 } |
| 344 | 344 |
| 345 static PassRefPtrWillBeRawPtr<CSSValue> valueForReflection(const StyleReflection
* reflection, const ComputedStyle& style) | 345 static RawPtr<CSSValue> valueForReflection(const StyleReflection* reflection, co
nst ComputedStyle& style) |
| 346 { | 346 { |
| 347 if (!reflection) | 347 if (!reflection) |
| 348 return cssValuePool().createIdentifierValue(CSSValueNone); | 348 return cssValuePool().createIdentifierValue(CSSValueNone); |
| 349 | 349 |
| 350 RefPtrWillBeRawPtr<CSSPrimitiveValue> offset = nullptr; | 350 RawPtr<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 RefPtrWillBeRawPtr<CSSPrimitiveValue> direction = nullptr; | 357 RawPtr<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.release(), offset.release(), valueF
orNinePieceImage(reflection->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 PassRefPtrWillBeRawPtr<CSSValueList> valueForItemPositionWithOverflowAlig
nment(ItemPosition itemPosition, OverflowAlignment overflowAlignment, ItemPositi
onType positionType) | 387 static RawPtr<CSSValueList> valueForItemPositionWithOverflowAlignment(ItemPositi
on itemPosition, OverflowAlignment overflowAlignment, ItemPositionType positionT
ype) |
| 388 { | 388 { |
| 389 RefPtrWillBeRawPtr<CSSValueList> result = CSSValueList::createSpaceSeparated
(); | 389 RawPtr<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.release(); |
| 397 } | 397 } |
| 398 | 398 |
| 399 static PassRefPtrWillBeRawPtr<CSSValueList> valuesForGridShorthand(const StylePr
opertyShorthand& shorthand, const ComputedStyle& style, const LayoutObject* layo
utObject, Node* styledNode, bool allowVisitedStyle) | 399 static RawPtr<CSSValueList> valuesForGridShorthand(const StylePropertyShorthand&
shorthand, const ComputedStyle& style, const LayoutObject* layoutObject, Node*
styledNode, bool allowVisitedStyle) |
| 400 { | 400 { |
| 401 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSlashSeparated()
; | 401 RawPtr<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 RefPtrWillBeRawPtr<CSSValue> value = ComputedStyleCSSValueMapping::get(s
horthand.properties()[i], style, layoutObject, styledNode, allowVisitedStyle); | 403 RawPtr<CSSValue> value = ComputedStyleCSSValueMapping::get(shorthand.pro
perties()[i], style, layoutObject, styledNode, allowVisitedStyle); |
| 404 ASSERT(value); | 404 ASSERT(value); |
| 405 list->append(value.release()); | 405 list->append(value.release()); |
| 406 } | 406 } |
| 407 return list.release(); | 407 return list.release(); |
| 408 } | 408 } |
| 409 | 409 |
| 410 static PassRefPtrWillBeRawPtr<CSSValueList> valuesForShorthandProperty(const Sty
lePropertyShorthand& shorthand, const ComputedStyle& style, const LayoutObject*
layoutObject, Node* styledNode, bool allowVisitedStyle) | 410 static RawPtr<CSSValueList> valuesForShorthandProperty(const StylePropertyShorth
and& shorthand, const ComputedStyle& style, const LayoutObject* layoutObject, No
de* styledNode, bool allowVisitedStyle) |
| 411 { | 411 { |
| 412 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 412 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); |
| 413 for (size_t i = 0; i < shorthand.length(); ++i) { | 413 for (size_t i = 0; i < shorthand.length(); ++i) { |
| 414 RefPtrWillBeRawPtr<CSSValue> value = ComputedStyleCSSValueMapping::get(s
horthand.properties()[i], style, layoutObject, styledNode, allowVisitedStyle); | 414 RawPtr<CSSValue> value = ComputedStyleCSSValueMapping::get(shorthand.pro
perties()[i], style, layoutObject, styledNode, allowVisitedStyle); |
| 415 ASSERT(value); | 415 ASSERT(value); |
| 416 list->append(value); | 416 list->append(value); |
| 417 } | 417 } |
| 418 return list.release(); | 418 return list.release(); |
| 419 } | 419 } |
| 420 | 420 |
| 421 static PassRefPtrWillBeRawPtr<CSSValueList> valuesForBackgroundShorthand(const C
omputedStyle& style, const LayoutObject* layoutObject, Node* styledNode, bool al
lowVisitedStyle) | 421 static RawPtr<CSSValueList> valuesForBackgroundShorthand(const ComputedStyle& st
yle, const LayoutObject* layoutObject, Node* styledNode, bool allowVisitedStyle) |
| 422 { | 422 { |
| 423 RefPtrWillBeRawPtr<CSSValueList> ret = CSSValueList::createCommaSeparated(); | 423 RawPtr<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 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSlashSeparat
ed(); | 426 RawPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); |
| 427 RefPtrWillBeRawPtr<CSSValueList> beforeSlash = CSSValueList::createSpace
Separated(); | 427 RawPtr<CSSValueList> beforeSlash = CSSValueList::createSpaceSeparated(); |
| 428 if (!currLayer->next()) { // color only for final layer | 428 if (!currLayer->next()) { // color only for final layer |
| 429 RefPtrWillBeRawPtr<CSSValue> value = ComputedStyleCSSValueMapping::g
et(CSSPropertyBackgroundColor, style, layoutObject, styledNode, allowVisitedStyl
e); | 429 RawPtr<CSSValue> value = ComputedStyleCSSValueMapping::get(CSSProper
tyBackgroundColor, 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 RefPtrWillBeRawPtr<CSSValueList> afterSlash = CSSValueList::createSpaceS
eparated(); | 438 RawPtr<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.release(); |
| 446 } | 446 } |
| 447 | 447 |
| 448 static StyleContentAlignmentData resolveJustifyContentAuto(const ComputedStyle&
style) | 448 static StyleContentAlignmentData resolveJustifyContentAuto(const ComputedStyle&
style) |
| (...skipping 19 matching lines...) Expand all Loading... |
| 468 | 468 |
| 469 if (!RuntimeEnabledFeatures::cssGridLayoutEnabled()) | 469 if (!RuntimeEnabledFeatures::cssGridLayoutEnabled()) |
| 470 return {ContentPositionAuto, ContentDistributionStretch, OverflowAlignme
ntDefault}; | 470 return {ContentPositionAuto, ContentDistributionStretch, OverflowAlignme
ntDefault}; |
| 471 | 471 |
| 472 if (style.isDisplayFlexibleBox()) | 472 if (style.isDisplayFlexibleBox()) |
| 473 return {ContentPositionAuto, ContentDistributionStretch, OverflowAlignme
ntDefault}; | 473 return {ContentPositionAuto, ContentDistributionStretch, OverflowAlignme
ntDefault}; |
| 474 | 474 |
| 475 return {ContentPositionStart, ContentDistributionDefault, OverflowAlignmentD
efault}; | 475 return {ContentPositionStart, ContentDistributionDefault, OverflowAlignmentD
efault}; |
| 476 } | 476 } |
| 477 | 477 |
| 478 static PassRefPtrWillBeRawPtr<CSSValueList> valueForContentPositionAndDistributi
onWithOverflowAlignment(const StyleContentAlignmentData& data) | 478 static RawPtr<CSSValueList> valueForContentPositionAndDistributionWithOverflowAl
ignment(const StyleContentAlignmentData& data) |
| 479 { | 479 { |
| 480 RefPtrWillBeRawPtr<CSSValueList> result = CSSValueList::createSpaceSeparated
(); | 480 RawPtr<CSSValueList> result = CSSValueList::createSpaceSeparated(); |
| 481 if (data.distribution() != ContentDistributionDefault) | 481 if (data.distribution() != ContentDistributionDefault) |
| 482 result->append(CSSPrimitiveValue::create(data.distribution())); | 482 result->append(CSSPrimitiveValue::create(data.distribution())); |
| 483 if (data.distribution() == ContentDistributionDefault || data.position() !=
ContentPositionAuto) | 483 if (data.distribution() == ContentDistributionDefault || data.position() !=
ContentPositionAuto) |
| 484 result->append(CSSPrimitiveValue::create(data.position())); | 484 result->append(CSSPrimitiveValue::create(data.position())); |
| 485 if ((data.position() >= ContentPositionCenter || data.distribution() != Cont
entDistributionDefault) && data.overflow() != OverflowAlignmentDefault) | 485 if ((data.position() >= ContentPositionCenter || data.distribution() != Cont
entDistributionDefault) && data.overflow() != OverflowAlignmentDefault) |
| 486 result->append(CSSPrimitiveValue::create(data.overflow())); | 486 result->append(CSSPrimitiveValue::create(data.overflow())); |
| 487 ASSERT(result->length() > 0); | 487 ASSERT(result->length() > 0); |
| 488 ASSERT(result->length() <= 3); | 488 ASSERT(result->length() <= 3); |
| 489 return result.release(); | 489 return result.release(); |
| 490 } | 490 } |
| 491 | 491 |
| 492 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> valueForLineHeight(const Comput
edStyle& style) | 492 static RawPtr<CSSPrimitiveValue> valueForLineHeight(const ComputedStyle& style) |
| 493 { | 493 { |
| 494 Length length = style.lineHeight(); | 494 Length length = style.lineHeight(); |
| 495 if (length.isNegative()) | 495 if (length.isNegative()) |
| 496 return cssValuePool().createIdentifierValue(CSSValueNormal); | 496 return cssValuePool().createIdentifierValue(CSSValueNormal); |
| 497 | 497 |
| 498 return zoomAdjustedPixelValue(floatValueForLength(length, style.fontDescript
ion().computedSize()), style); | 498 return zoomAdjustedPixelValue(floatValueForLength(length, style.fontDescript
ion().computedSize()), style); |
| 499 } | 499 } |
| 500 | 500 |
| 501 static CSSValueID identifierForFamily(const AtomicString& family) | 501 static CSSValueID identifierForFamily(const AtomicString& family) |
| 502 { | 502 { |
| 503 if (family == FontFamilyNames::webkit_cursive) | 503 if (family == FontFamilyNames::webkit_cursive) |
| 504 return CSSValueCursive; | 504 return CSSValueCursive; |
| 505 if (family == FontFamilyNames::webkit_fantasy) | 505 if (family == FontFamilyNames::webkit_fantasy) |
| 506 return CSSValueFantasy; | 506 return CSSValueFantasy; |
| 507 if (family == FontFamilyNames::webkit_monospace) | 507 if (family == FontFamilyNames::webkit_monospace) |
| 508 return CSSValueMonospace; | 508 return CSSValueMonospace; |
| 509 if (family == FontFamilyNames::webkit_pictograph) | 509 if (family == FontFamilyNames::webkit_pictograph) |
| 510 return CSSValueWebkitPictograph; | 510 return CSSValueWebkitPictograph; |
| 511 if (family == FontFamilyNames::webkit_sans_serif) | 511 if (family == FontFamilyNames::webkit_sans_serif) |
| 512 return CSSValueSansSerif; | 512 return CSSValueSansSerif; |
| 513 if (family == FontFamilyNames::webkit_serif) | 513 if (family == FontFamilyNames::webkit_serif) |
| 514 return CSSValueSerif; | 514 return CSSValueSerif; |
| 515 return CSSValueInvalid; | 515 return CSSValueInvalid; |
| 516 } | 516 } |
| 517 | 517 |
| 518 static PassRefPtrWillBeRawPtr<CSSValue> valueForFamily(const AtomicString& famil
y) | 518 static RawPtr<CSSValue> valueForFamily(const AtomicString& family) |
| 519 { | 519 { |
| 520 if (CSSValueID familyIdentifier = identifierForFamily(family)) | 520 if (CSSValueID familyIdentifier = identifierForFamily(family)) |
| 521 return cssValuePool().createIdentifierValue(familyIdentifier); | 521 return cssValuePool().createIdentifierValue(familyIdentifier); |
| 522 return CSSCustomIdentValue::create(family.string()); | 522 return CSSCustomIdentValue::create(family.string()); |
| 523 } | 523 } |
| 524 | 524 |
| 525 static PassRefPtrWillBeRawPtr<CSSValueList> valueForFontFamily(const ComputedSty
le& style) | 525 static RawPtr<CSSValueList> valueForFontFamily(const ComputedStyle& style) |
| 526 { | 526 { |
| 527 const FontFamily& firstFamily = style.fontDescription().family(); | 527 const FontFamily& firstFamily = style.fontDescription().family(); |
| 528 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated()
; | 528 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); |
| 529 for (const FontFamily* family = &firstFamily; family; family = family->next(
)) | 529 for (const FontFamily* family = &firstFamily; family; family = family->next(
)) |
| 530 list->append(valueForFamily(family->family())); | 530 list->append(valueForFamily(family->family())); |
| 531 return list.release(); | 531 return list.release(); |
| 532 } | 532 } |
| 533 | 533 |
| 534 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> valueForFontSize(const Computed
Style& style) | 534 static RawPtr<CSSPrimitiveValue> valueForFontSize(const ComputedStyle& style) |
| 535 { | 535 { |
| 536 return zoomAdjustedPixelValue(style.fontDescription().computedSize(), style)
; | 536 return zoomAdjustedPixelValue(style.fontDescription().computedSize(), style)
; |
| 537 } | 537 } |
| 538 | 538 |
| 539 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> valueForFontStretch(const Compu
tedStyle& style) | 539 static RawPtr<CSSPrimitiveValue> valueForFontStretch(const ComputedStyle& style) |
| 540 { | 540 { |
| 541 return cssValuePool().createValue(style.fontDescription().stretch()); | 541 return cssValuePool().createValue(style.fontDescription().stretch()); |
| 542 } | 542 } |
| 543 | 543 |
| 544 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> valueForFontStyle(const Compute
dStyle& style) | 544 static RawPtr<CSSPrimitiveValue> valueForFontStyle(const ComputedStyle& style) |
| 545 { | 545 { |
| 546 return cssValuePool().createValue(style.fontDescription().style()); | 546 return cssValuePool().createValue(style.fontDescription().style()); |
| 547 } | 547 } |
| 548 | 548 |
| 549 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> valueForFontVariant(const Compu
tedStyle& style) | 549 static RawPtr<CSSPrimitiveValue> valueForFontVariant(const ComputedStyle& style) |
| 550 { | 550 { |
| 551 return cssValuePool().createValue(style.fontDescription().variant()); | 551 return cssValuePool().createValue(style.fontDescription().variant()); |
| 552 } | 552 } |
| 553 | 553 |
| 554 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> valueForFontWeight(const Comput
edStyle& style) | 554 static RawPtr<CSSPrimitiveValue> valueForFontWeight(const ComputedStyle& style) |
| 555 { | 555 { |
| 556 return cssValuePool().createValue(style.fontDescription().weight()); | 556 return cssValuePool().createValue(style.fontDescription().weight()); |
| 557 } | 557 } |
| 558 | 558 |
| 559 static PassRefPtrWillBeRawPtr<CSSValue> specifiedValueForGridTrackBreadth(const
GridLength& trackBreadth, const ComputedStyle& style) | 559 static RawPtr<CSSValue> specifiedValueForGridTrackBreadth(const GridLength& trac
kBreadth, const ComputedStyle& style) |
| 560 { | 560 { |
| 561 if (!trackBreadth.isLength()) | 561 if (!trackBreadth.isLength()) |
| 562 return cssValuePool().createValue(trackBreadth.flex(), CSSPrimitiveValue
::UnitType::Fraction); | 562 return cssValuePool().createValue(trackBreadth.flex(), CSSPrimitiveValue
::UnitType::Fraction); |
| 563 | 563 |
| 564 const Length& trackBreadthLength = trackBreadth.length(); | 564 const Length& trackBreadthLength = trackBreadth.length(); |
| 565 if (trackBreadthLength.isAuto()) | 565 if (trackBreadthLength.isAuto()) |
| 566 return cssValuePool().createIdentifierValue(CSSValueAuto); | 566 return cssValuePool().createIdentifierValue(CSSValueAuto); |
| 567 return zoomAdjustedPixelValueForLength(trackBreadthLength, style); | 567 return zoomAdjustedPixelValueForLength(trackBreadthLength, style); |
| 568 } | 568 } |
| 569 | 569 |
| 570 static PassRefPtrWillBeRawPtr<CSSValue> specifiedValueForGridTrackSize(const Gri
dTrackSize& trackSize, const ComputedStyle& style) | 570 static RawPtr<CSSValue> specifiedValueForGridTrackSize(const GridTrackSize& trac
kSize, const ComputedStyle& style) |
| 571 { | 571 { |
| 572 switch (trackSize.type()) { | 572 switch (trackSize.type()) { |
| 573 case LengthTrackSizing: | 573 case LengthTrackSizing: |
| 574 return specifiedValueForGridTrackBreadth(trackSize.length(), style); | 574 return specifiedValueForGridTrackBreadth(trackSize.length(), style); |
| 575 case MinMaxTrackSizing: | 575 case MinMaxTrackSizing: |
| 576 RefPtrWillBeRawPtr<CSSFunctionValue> minMaxTrackBreadths = CSSFunctionVa
lue::create(CSSValueMinmax); | 576 RawPtr<CSSFunctionValue> minMaxTrackBreadths = CSSFunctionValue::create(
CSSValueMinmax); |
| 577 minMaxTrackBreadths->append(specifiedValueForGridTrackBreadth(trackSize.
minTrackBreadth(), style)); | 577 minMaxTrackBreadths->append(specifiedValueForGridTrackBreadth(trackSize.
minTrackBreadth(), style)); |
| 578 minMaxTrackBreadths->append(specifiedValueForGridTrackBreadth(trackSize.
maxTrackBreadth(), style)); | 578 minMaxTrackBreadths->append(specifiedValueForGridTrackBreadth(trackSize.
maxTrackBreadth(), style)); |
| 579 return minMaxTrackBreadths.release(); | 579 return minMaxTrackBreadths.release(); |
| 580 } | 580 } |
| 581 ASSERT_NOT_REACHED(); | 581 ASSERT_NOT_REACHED(); |
| 582 return nullptr; | 582 return nullptr; |
| 583 } | 583 } |
| 584 | 584 |
| 585 static void addValuesForNamedGridLinesAtIndex(const OrderedNamedGridLines& order
edNamedGridLines, size_t i, CSSValueList& list) | 585 static void addValuesForNamedGridLinesAtIndex(const OrderedNamedGridLines& order
edNamedGridLines, size_t i, CSSValueList& list) |
| 586 { | 586 { |
| 587 const Vector<String>& namedGridLines = orderedNamedGridLines.get(i); | 587 const Vector<String>& namedGridLines = orderedNamedGridLines.get(i); |
| 588 if (namedGridLines.isEmpty()) | 588 if (namedGridLines.isEmpty()) |
| 589 return; | 589 return; |
| 590 | 590 |
| 591 RefPtrWillBeRawPtr<CSSGridLineNamesValue> lineNames = CSSGridLineNamesValue:
:create(); | 591 RawPtr<CSSGridLineNamesValue> lineNames = CSSGridLineNamesValue::create(); |
| 592 for (size_t j = 0; j < namedGridLines.size(); ++j) | 592 for (size_t j = 0; j < namedGridLines.size(); ++j) |
| 593 lineNames->append(CSSCustomIdentValue::create(namedGridLines[j])); | 593 lineNames->append(CSSCustomIdentValue::create(namedGridLines[j])); |
| 594 list.append(lineNames.release()); | 594 list.append(lineNames.release()); |
| 595 } | 595 } |
| 596 | 596 |
| 597 static PassRefPtrWillBeRawPtr<CSSValue> valueForGridTrackList(GridTrackSizingDir
ection direction, const LayoutObject* layoutObject, const ComputedStyle& style) | 597 static RawPtr<CSSValue> valueForGridTrackList(GridTrackSizingDirection direction
, const LayoutObject* layoutObject, const ComputedStyle& style) |
| 598 { | 598 { |
| 599 const Vector<GridTrackSize>& trackSizes = direction == ForColumns ? style.gr
idTemplateColumns() : style.gridTemplateRows(); | 599 const Vector<GridTrackSize>& trackSizes = direction == ForColumns ? style.gr
idTemplateColumns() : style.gridTemplateRows(); |
| 600 const OrderedNamedGridLines& orderedNamedGridLines = direction == ForColumns
? style.orderedNamedGridColumnLines() : style.orderedNamedGridRowLines(); | 600 const OrderedNamedGridLines& orderedNamedGridLines = direction == ForColumns
? style.orderedNamedGridColumnLines() : style.orderedNamedGridRowLines(); |
| 601 bool isLayoutGrid = layoutObject && layoutObject->isLayoutGrid(); | 601 bool isLayoutGrid = layoutObject && layoutObject->isLayoutGrid(); |
| 602 | 602 |
| 603 // Handle the 'none' case. | 603 // Handle the 'none' case. |
| 604 bool trackListIsEmpty = trackSizes.isEmpty(); | 604 bool trackListIsEmpty = trackSizes.isEmpty(); |
| 605 if (isLayoutGrid && trackListIsEmpty) { | 605 if (isLayoutGrid && trackListIsEmpty) { |
| 606 // For grids we should consider every listed track, whether implicitly o
r explicitly created. If we don't have | 606 // For grids we should consider every listed track, whether implicitly o
r explicitly created. If we don't have |
| 607 // any explicit track and there are no children then there are no implic
it tracks. We cannot simply check the | 607 // any explicit track and there are no children then there are no implic
it tracks. We cannot simply check the |
| 608 // number of rows/columns in our internal grid representation because it
's always at least 1x1 (see r143331). | 608 // number of rows/columns in our internal grid representation because it
's always at least 1x1 (see r143331). |
| 609 trackListIsEmpty = !toLayoutBlock(layoutObject)->firstChild(); | 609 trackListIsEmpty = !toLayoutBlock(layoutObject)->firstChild(); |
| 610 } | 610 } |
| 611 | 611 |
| 612 if (trackListIsEmpty) { | 612 if (trackListIsEmpty) { |
| 613 ASSERT(orderedNamedGridLines.isEmpty()); | 613 ASSERT(orderedNamedGridLines.isEmpty()); |
| 614 return cssValuePool().createIdentifierValue(CSSValueNone); | 614 return cssValuePool().createIdentifierValue(CSSValueNone); |
| 615 } | 615 } |
| 616 | 616 |
| 617 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 617 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); |
| 618 size_t insertionIndex; | 618 size_t insertionIndex; |
| 619 if (isLayoutGrid) { | 619 if (isLayoutGrid) { |
| 620 const Vector<LayoutUnit>& trackPositions = direction == ForColumns ? toL
ayoutGrid(layoutObject)->columnPositions() : toLayoutGrid(layoutObject)->rowPosi
tions(); | 620 const Vector<LayoutUnit>& trackPositions = direction == ForColumns ? toL
ayoutGrid(layoutObject)->columnPositions() : toLayoutGrid(layoutObject)->rowPosi
tions(); |
| 621 // There are at least #tracks + 1 grid lines (trackPositions). Apart fro
m that, the grid container can generate implicit grid tracks, | 621 // There are at least #tracks + 1 grid lines (trackPositions). Apart fro
m that, the grid container can generate implicit grid tracks, |
| 622 // so we'll have more trackPositions than trackSizes as the latter only
contain the explicit grid. | 622 // so we'll have more trackPositions than trackSizes as the latter only
contain the explicit grid. |
| 623 ASSERT(trackPositions.size() - 1 >= trackSizes.size()); | 623 ASSERT(trackPositions.size() - 1 >= trackSizes.size()); |
| 624 | 624 |
| 625 size_t i; | 625 size_t i; |
| 626 LayoutUnit gutterSize = toLayoutGrid(layoutObject)->guttersSize(directio
n, 2); | 626 LayoutUnit gutterSize = toLayoutGrid(layoutObject)->guttersSize(directio
n, 2); |
| 627 for (i = 0; i < trackPositions.size() - 2; ++i) { | 627 for (i = 0; i < trackPositions.size() - 2; ++i) { |
| 628 addValuesForNamedGridLinesAtIndex(orderedNamedGridLines, i, *list); | 628 addValuesForNamedGridLinesAtIndex(orderedNamedGridLines, i, *list); |
| 629 list->append(zoomAdjustedPixelValue(trackPositions[i + 1] - trackPos
itions[i] - gutterSize, style)); | 629 list->append(zoomAdjustedPixelValue(trackPositions[i + 1] - trackPos
itions[i] - gutterSize, style)); |
| 630 } | 630 } |
| 631 // Last track line does not have any gutter. | 631 // Last track line does not have any gutter. |
| 632 addValuesForNamedGridLinesAtIndex(orderedNamedGridLines, i, *list); | 632 addValuesForNamedGridLinesAtIndex(orderedNamedGridLines, i, *list); |
| 633 list->append(zoomAdjustedPixelValue(trackPositions[i + 1] - trackPositio
ns[i], style)); | 633 list->append(zoomAdjustedPixelValue(trackPositions[i + 1] - trackPositio
ns[i], style)); |
| 634 insertionIndex = trackPositions.size() - 1; | 634 insertionIndex = trackPositions.size() - 1; |
| 635 } else { | 635 } else { |
| 636 for (size_t i = 0; i < trackSizes.size(); ++i) { | 636 for (size_t i = 0; i < trackSizes.size(); ++i) { |
| 637 addValuesForNamedGridLinesAtIndex(orderedNamedGridLines, i, *list); | 637 addValuesForNamedGridLinesAtIndex(orderedNamedGridLines, i, *list); |
| 638 list->append(specifiedValueForGridTrackSize(trackSizes[i], style)); | 638 list->append(specifiedValueForGridTrackSize(trackSizes[i], style)); |
| 639 } | 639 } |
| 640 insertionIndex = trackSizes.size(); | 640 insertionIndex = trackSizes.size(); |
| 641 } | 641 } |
| 642 // Those are the trailing <string>* allowed in the syntax. | 642 // Those are the trailing <string>* allowed in the syntax. |
| 643 addValuesForNamedGridLinesAtIndex(orderedNamedGridLines, insertionIndex, *li
st); | 643 addValuesForNamedGridLinesAtIndex(orderedNamedGridLines, insertionIndex, *li
st); |
| 644 return list.release(); | 644 return list.release(); |
| 645 } | 645 } |
| 646 | 646 |
| 647 static PassRefPtrWillBeRawPtr<CSSValue> valueForGridPosition(const GridPosition&
position) | 647 static RawPtr<CSSValue> valueForGridPosition(const GridPosition& position) |
| 648 { | 648 { |
| 649 if (position.isAuto()) | 649 if (position.isAuto()) |
| 650 return cssValuePool().createIdentifierValue(CSSValueAuto); | 650 return cssValuePool().createIdentifierValue(CSSValueAuto); |
| 651 | 651 |
| 652 if (position.isNamedGridArea()) | 652 if (position.isNamedGridArea()) |
| 653 return CSSCustomIdentValue::create(position.namedGridLine()); | 653 return CSSCustomIdentValue::create(position.namedGridLine()); |
| 654 | 654 |
| 655 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 655 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); |
| 656 if (position.isSpan()) { | 656 if (position.isSpan()) { |
| 657 list->append(cssValuePool().createIdentifierValue(CSSValueSpan)); | 657 list->append(cssValuePool().createIdentifierValue(CSSValueSpan)); |
| 658 list->append(cssValuePool().createValue(position.spanPosition(), CSSPrim
itiveValue::UnitType::Number)); | 658 list->append(cssValuePool().createValue(position.spanPosition(), CSSPrim
itiveValue::UnitType::Number)); |
| 659 } else { | 659 } else { |
| 660 list->append(cssValuePool().createValue(position.integerPosition(), CSSP
rimitiveValue::UnitType::Number)); | 660 list->append(cssValuePool().createValue(position.integerPosition(), CSSP
rimitiveValue::UnitType::Number)); |
| 661 } | 661 } |
| 662 | 662 |
| 663 if (!position.namedGridLine().isNull()) | 663 if (!position.namedGridLine().isNull()) |
| 664 list->append(CSSCustomIdentValue::create(position.namedGridLine())); | 664 list->append(CSSCustomIdentValue::create(position.namedGridLine())); |
| 665 return list; | 665 return list; |
| 666 } | 666 } |
| 667 | 667 |
| 668 static LayoutRect sizingBox(const LayoutObject* layoutObject) | 668 static LayoutRect sizingBox(const LayoutObject* layoutObject) |
| 669 { | 669 { |
| 670 if (!layoutObject->isBox()) | 670 if (!layoutObject->isBox()) |
| 671 return LayoutRect(); | 671 return LayoutRect(); |
| 672 | 672 |
| 673 const LayoutBox* box = toLayoutBox(layoutObject); | 673 const LayoutBox* box = toLayoutBox(layoutObject); |
| 674 return box->style()->boxSizing() == BORDER_BOX ? box->borderBoxRect() : box-
>computedCSSContentBoxRect(); | 674 return box->style()->boxSizing() == BORDER_BOX ? box->borderBoxRect() : box-
>computedCSSContentBoxRect(); |
| 675 } | 675 } |
| 676 | 676 |
| 677 static PassRefPtrWillBeRawPtr<CSSValue> renderTextDecorationFlagsToCSSValue(int
textDecoration) | 677 static RawPtr<CSSValue> renderTextDecorationFlagsToCSSValue(int textDecoration) |
| 678 { | 678 { |
| 679 // Blink value is ignored. | 679 // Blink value is ignored. |
| 680 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 680 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); |
| 681 if (textDecoration & TextDecorationUnderline) | 681 if (textDecoration & TextDecorationUnderline) |
| 682 list->append(cssValuePool().createIdentifierValue(CSSValueUnderline)); | 682 list->append(cssValuePool().createIdentifierValue(CSSValueUnderline)); |
| 683 if (textDecoration & TextDecorationOverline) | 683 if (textDecoration & TextDecorationOverline) |
| 684 list->append(cssValuePool().createIdentifierValue(CSSValueOverline)); | 684 list->append(cssValuePool().createIdentifierValue(CSSValueOverline)); |
| 685 if (textDecoration & TextDecorationLineThrough) | 685 if (textDecoration & TextDecorationLineThrough) |
| 686 list->append(cssValuePool().createIdentifierValue(CSSValueLineThrough)); | 686 list->append(cssValuePool().createIdentifierValue(CSSValueLineThrough)); |
| 687 | 687 |
| 688 if (!list->length()) | 688 if (!list->length()) |
| 689 return cssValuePool().createIdentifierValue(CSSValueNone); | 689 return cssValuePool().createIdentifierValue(CSSValueNone); |
| 690 return list.release(); | 690 return list.release(); |
| 691 } | 691 } |
| 692 | 692 |
| 693 static PassRefPtrWillBeRawPtr<CSSValue> valueForTextDecorationStyle(TextDecorati
onStyle textDecorationStyle) | 693 static RawPtr<CSSValue> valueForTextDecorationStyle(TextDecorationStyle textDeco
rationStyle) |
| 694 { | 694 { |
| 695 switch (textDecorationStyle) { | 695 switch (textDecorationStyle) { |
| 696 case TextDecorationStyleSolid: | 696 case TextDecorationStyleSolid: |
| 697 return cssValuePool().createIdentifierValue(CSSValueSolid); | 697 return cssValuePool().createIdentifierValue(CSSValueSolid); |
| 698 case TextDecorationStyleDouble: | 698 case TextDecorationStyleDouble: |
| 699 return cssValuePool().createIdentifierValue(CSSValueDouble); | 699 return cssValuePool().createIdentifierValue(CSSValueDouble); |
| 700 case TextDecorationStyleDotted: | 700 case TextDecorationStyleDotted: |
| 701 return cssValuePool().createIdentifierValue(CSSValueDotted); | 701 return cssValuePool().createIdentifierValue(CSSValueDotted); |
| 702 case TextDecorationStyleDashed: | 702 case TextDecorationStyleDashed: |
| 703 return cssValuePool().createIdentifierValue(CSSValueDashed); | 703 return cssValuePool().createIdentifierValue(CSSValueDashed); |
| 704 case TextDecorationStyleWavy: | 704 case TextDecorationStyleWavy: |
| 705 return cssValuePool().createIdentifierValue(CSSValueWavy); | 705 return cssValuePool().createIdentifierValue(CSSValueWavy); |
| 706 } | 706 } |
| 707 | 707 |
| 708 ASSERT_NOT_REACHED(); | 708 ASSERT_NOT_REACHED(); |
| 709 return cssValuePool().createExplicitInitialValue(); | 709 return cssValuePool().createExplicitInitialValue(); |
| 710 } | 710 } |
| 711 | 711 |
| 712 static PassRefPtrWillBeRawPtr<CSSValue> touchActionFlagsToCSSValue(TouchAction t
ouchAction) | 712 static RawPtr<CSSValue> touchActionFlagsToCSSValue(TouchAction touchAction) |
| 713 { | 713 { |
| 714 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 714 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); |
| 715 if (touchAction == TouchActionAuto) { | 715 if (touchAction == TouchActionAuto) { |
| 716 list->append(cssValuePool().createIdentifierValue(CSSValueAuto)); | 716 list->append(cssValuePool().createIdentifierValue(CSSValueAuto)); |
| 717 } else if (touchAction == TouchActionNone) { | 717 } else if (touchAction == TouchActionNone) { |
| 718 list->append(cssValuePool().createIdentifierValue(CSSValueNone)); | 718 list->append(cssValuePool().createIdentifierValue(CSSValueNone)); |
| 719 } else if (touchAction == TouchActionManipulation) { | 719 } else if (touchAction == TouchActionManipulation) { |
| 720 list->append(cssValuePool().createIdentifierValue(CSSValueManipulation))
; | 720 list->append(cssValuePool().createIdentifierValue(CSSValueManipulation))
; |
| 721 } else { | 721 } else { |
| 722 if ((touchAction & TouchActionPanX) == TouchActionPanX) | 722 if ((touchAction & TouchActionPanX) == TouchActionPanX) |
| 723 list->append(cssValuePool().createIdentifierValue(CSSValuePanX)); | 723 list->append(cssValuePool().createIdentifierValue(CSSValuePanX)); |
| 724 else if (touchAction & TouchActionPanLeft) | 724 else if (touchAction & TouchActionPanLeft) |
| 725 list->append(cssValuePool().createIdentifierValue(CSSValuePanLeft)); | 725 list->append(cssValuePool().createIdentifierValue(CSSValuePanLeft)); |
| 726 else if (touchAction & TouchActionPanRight) | 726 else if (touchAction & TouchActionPanRight) |
| 727 list->append(cssValuePool().createIdentifierValue(CSSValuePanRight))
; | 727 list->append(cssValuePool().createIdentifierValue(CSSValuePanRight))
; |
| 728 | 728 |
| 729 if ((touchAction & TouchActionPanY) == TouchActionPanY) | 729 if ((touchAction & TouchActionPanY) == TouchActionPanY) |
| 730 list->append(cssValuePool().createIdentifierValue(CSSValuePanY)); | 730 list->append(cssValuePool().createIdentifierValue(CSSValuePanY)); |
| 731 else if (touchAction & TouchActionPanUp) | 731 else if (touchAction & TouchActionPanUp) |
| 732 list->append(cssValuePool().createIdentifierValue(CSSValuePanUp)); | 732 list->append(cssValuePool().createIdentifierValue(CSSValuePanUp)); |
| 733 else if (touchAction & TouchActionPanDown) | 733 else if (touchAction & TouchActionPanDown) |
| 734 list->append(cssValuePool().createIdentifierValue(CSSValuePanDown)); | 734 list->append(cssValuePool().createIdentifierValue(CSSValuePanDown)); |
| 735 } | 735 } |
| 736 ASSERT(list->length()); | 736 ASSERT(list->length()); |
| 737 return list.release(); | 737 return list.release(); |
| 738 } | 738 } |
| 739 | 739 |
| 740 static PassRefPtrWillBeRawPtr<CSSValue> valueForWillChange(const Vector<CSSPrope
rtyID>& willChangeProperties, bool willChangeContents, bool willChangeScrollPosi
tion) | 740 static RawPtr<CSSValue> valueForWillChange(const Vector<CSSPropertyID>& willChan
geProperties, bool willChangeContents, bool willChangeScrollPosition) |
| 741 { | 741 { |
| 742 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated()
; | 742 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); |
| 743 if (willChangeContents) | 743 if (willChangeContents) |
| 744 list->append(cssValuePool().createIdentifierValue(CSSValueContents)); | 744 list->append(cssValuePool().createIdentifierValue(CSSValueContents)); |
| 745 if (willChangeScrollPosition) | 745 if (willChangeScrollPosition) |
| 746 list->append(cssValuePool().createIdentifierValue(CSSValueScrollPosition
)); | 746 list->append(cssValuePool().createIdentifierValue(CSSValueScrollPosition
)); |
| 747 for (size_t i = 0; i < willChangeProperties.size(); ++i) | 747 for (size_t i = 0; i < willChangeProperties.size(); ++i) |
| 748 list->append(cssValuePool().createIdentifierValue(willChangeProperties[i
])); | 748 list->append(cssValuePool().createIdentifierValue(willChangeProperties[i
])); |
| 749 if (!list->length()) | 749 if (!list->length()) |
| 750 list->append(cssValuePool().createIdentifierValue(CSSValueAuto)); | 750 list->append(cssValuePool().createIdentifierValue(CSSValueAuto)); |
| 751 return list.release(); | 751 return list.release(); |
| 752 } | 752 } |
| 753 | 753 |
| 754 static PassRefPtrWillBeRawPtr<CSSValue> valueForAnimationDelay(const CSSTimingDa
ta* timingData) | 754 static RawPtr<CSSValue> valueForAnimationDelay(const CSSTimingData* timingData) |
| 755 { | 755 { |
| 756 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated()
; | 756 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); |
| 757 if (timingData) { | 757 if (timingData) { |
| 758 for (size_t i = 0; i < timingData->delayList().size(); ++i) | 758 for (size_t i = 0; i < timingData->delayList().size(); ++i) |
| 759 list->append(cssValuePool().createValue(timingData->delayList()[i],
CSSPrimitiveValue::UnitType::Seconds)); | 759 list->append(cssValuePool().createValue(timingData->delayList()[i],
CSSPrimitiveValue::UnitType::Seconds)); |
| 760 } else { | 760 } else { |
| 761 list->append(cssValuePool().createValue(CSSTimingData::initialDelay(), C
SSPrimitiveValue::UnitType::Seconds)); | 761 list->append(cssValuePool().createValue(CSSTimingData::initialDelay(), C
SSPrimitiveValue::UnitType::Seconds)); |
| 762 } | 762 } |
| 763 return list.release(); | 763 return list.release(); |
| 764 } | 764 } |
| 765 | 765 |
| 766 static PassRefPtrWillBeRawPtr<CSSValue> valueForAnimationDirection(Timing::Playb
ackDirection direction) | 766 static RawPtr<CSSValue> valueForAnimationDirection(Timing::PlaybackDirection dir
ection) |
| 767 { | 767 { |
| 768 switch (direction) { | 768 switch (direction) { |
| 769 case Timing::PlaybackDirectionNormal: | 769 case Timing::PlaybackDirectionNormal: |
| 770 return cssValuePool().createIdentifierValue(CSSValueNormal); | 770 return cssValuePool().createIdentifierValue(CSSValueNormal); |
| 771 case Timing::PlaybackDirectionAlternate: | 771 case Timing::PlaybackDirectionAlternate: |
| 772 return cssValuePool().createIdentifierValue(CSSValueAlternate); | 772 return cssValuePool().createIdentifierValue(CSSValueAlternate); |
| 773 case Timing::PlaybackDirectionReverse: | 773 case Timing::PlaybackDirectionReverse: |
| 774 return cssValuePool().createIdentifierValue(CSSValueReverse); | 774 return cssValuePool().createIdentifierValue(CSSValueReverse); |
| 775 case Timing::PlaybackDirectionAlternateReverse: | 775 case Timing::PlaybackDirectionAlternateReverse: |
| 776 return cssValuePool().createIdentifierValue(CSSValueAlternateReverse); | 776 return cssValuePool().createIdentifierValue(CSSValueAlternateReverse); |
| 777 default: | 777 default: |
| 778 ASSERT_NOT_REACHED(); | 778 ASSERT_NOT_REACHED(); |
| 779 return nullptr; | 779 return nullptr; |
| 780 } | 780 } |
| 781 } | 781 } |
| 782 | 782 |
| 783 static PassRefPtrWillBeRawPtr<CSSValue> valueForAnimationDuration(const CSSTimin
gData* timingData) | 783 static RawPtr<CSSValue> valueForAnimationDuration(const CSSTimingData* timingDat
a) |
| 784 { | 784 { |
| 785 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated()
; | 785 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); |
| 786 if (timingData) { | 786 if (timingData) { |
| 787 for (size_t i = 0; i < timingData->durationList().size(); ++i) | 787 for (size_t i = 0; i < timingData->durationList().size(); ++i) |
| 788 list->append(cssValuePool().createValue(timingData->durationList()[i
], CSSPrimitiveValue::UnitType::Seconds)); | 788 list->append(cssValuePool().createValue(timingData->durationList()[i
], CSSPrimitiveValue::UnitType::Seconds)); |
| 789 } else { | 789 } else { |
| 790 list->append(cssValuePool().createValue(CSSTimingData::initialDuration()
, CSSPrimitiveValue::UnitType::Seconds)); | 790 list->append(cssValuePool().createValue(CSSTimingData::initialDuration()
, CSSPrimitiveValue::UnitType::Seconds)); |
| 791 } | 791 } |
| 792 return list.release(); | 792 return list.release(); |
| 793 } | 793 } |
| 794 | 794 |
| 795 static PassRefPtrWillBeRawPtr<CSSValue> valueForAnimationFillMode(Timing::FillMo
de fillMode) | 795 static RawPtr<CSSValue> valueForAnimationFillMode(Timing::FillMode fillMode) |
| 796 { | 796 { |
| 797 switch (fillMode) { | 797 switch (fillMode) { |
| 798 case Timing::FillModeNone: | 798 case Timing::FillModeNone: |
| 799 return cssValuePool().createIdentifierValue(CSSValueNone); | 799 return cssValuePool().createIdentifierValue(CSSValueNone); |
| 800 case Timing::FillModeForwards: | 800 case Timing::FillModeForwards: |
| 801 return cssValuePool().createIdentifierValue(CSSValueForwards); | 801 return cssValuePool().createIdentifierValue(CSSValueForwards); |
| 802 case Timing::FillModeBackwards: | 802 case Timing::FillModeBackwards: |
| 803 return cssValuePool().createIdentifierValue(CSSValueBackwards); | 803 return cssValuePool().createIdentifierValue(CSSValueBackwards); |
| 804 case Timing::FillModeBoth: | 804 case Timing::FillModeBoth: |
| 805 return cssValuePool().createIdentifierValue(CSSValueBoth); | 805 return cssValuePool().createIdentifierValue(CSSValueBoth); |
| 806 default: | 806 default: |
| 807 ASSERT_NOT_REACHED(); | 807 ASSERT_NOT_REACHED(); |
| 808 return nullptr; | 808 return nullptr; |
| 809 } | 809 } |
| 810 } | 810 } |
| 811 | 811 |
| 812 static PassRefPtrWillBeRawPtr<CSSValue> valueForAnimationIterationCount(double i
terationCount) | 812 static RawPtr<CSSValue> valueForAnimationIterationCount(double iterationCount) |
| 813 { | 813 { |
| 814 if (iterationCount == std::numeric_limits<double>::infinity()) | 814 if (iterationCount == std::numeric_limits<double>::infinity()) |
| 815 return cssValuePool().createIdentifierValue(CSSValueInfinite); | 815 return cssValuePool().createIdentifierValue(CSSValueInfinite); |
| 816 return cssValuePool().createValue(iterationCount, CSSPrimitiveValue::UnitTyp
e::Number); | 816 return cssValuePool().createValue(iterationCount, CSSPrimitiveValue::UnitTyp
e::Number); |
| 817 } | 817 } |
| 818 | 818 |
| 819 static PassRefPtrWillBeRawPtr<CSSValue> valueForAnimationPlayState(EAnimPlayStat
e playState) | 819 static RawPtr<CSSValue> valueForAnimationPlayState(EAnimPlayState playState) |
| 820 { | 820 { |
| 821 if (playState == AnimPlayStatePlaying) | 821 if (playState == AnimPlayStatePlaying) |
| 822 return cssValuePool().createIdentifierValue(CSSValueRunning); | 822 return cssValuePool().createIdentifierValue(CSSValueRunning); |
| 823 ASSERT(playState == AnimPlayStatePaused); | 823 ASSERT(playState == AnimPlayStatePaused); |
| 824 return cssValuePool().createIdentifierValue(CSSValuePaused); | 824 return cssValuePool().createIdentifierValue(CSSValuePaused); |
| 825 } | 825 } |
| 826 | 826 |
| 827 static PassRefPtrWillBeRawPtr<CSSValue> createTimingFunctionValue(const TimingFu
nction* timingFunction) | 827 static RawPtr<CSSValue> createTimingFunctionValue(const TimingFunction* timingFu
nction) |
| 828 { | 828 { |
| 829 switch (timingFunction->type()) { | 829 switch (timingFunction->type()) { |
| 830 case TimingFunction::CubicBezierFunction: | 830 case TimingFunction::CubicBezierFunction: |
| 831 { | 831 { |
| 832 const CubicBezierTimingFunction* bezierTimingFunction = toCubicBezie
rTimingFunction(timingFunction); | 832 const CubicBezierTimingFunction* bezierTimingFunction = toCubicBezie
rTimingFunction(timingFunction); |
| 833 if (bezierTimingFunction->subType() != CubicBezierTimingFunction::Cu
stom) { | 833 if (bezierTimingFunction->subType() != CubicBezierTimingFunction::Cu
stom) { |
| 834 CSSValueID valueId = CSSValueInvalid; | 834 CSSValueID valueId = CSSValueInvalid; |
| 835 switch (bezierTimingFunction->subType()) { | 835 switch (bezierTimingFunction->subType()) { |
| 836 case CubicBezierTimingFunction::Ease: | 836 case CubicBezierTimingFunction::Ease: |
| 837 valueId = CSSValueEase; | 837 valueId = CSSValueEase; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 865 return CSSStepsTimingFunctionValue::create(steps, position); | 865 return CSSStepsTimingFunctionValue::create(steps, position); |
| 866 CSSValueID valueId = position == StepsTimingFunction::Start ? CSSVal
ueStepStart : CSSValueStepEnd; | 866 CSSValueID valueId = position == StepsTimingFunction::Start ? CSSVal
ueStepStart : CSSValueStepEnd; |
| 867 return cssValuePool().createIdentifierValue(valueId); | 867 return cssValuePool().createIdentifierValue(valueId); |
| 868 } | 868 } |
| 869 | 869 |
| 870 default: | 870 default: |
| 871 return cssValuePool().createIdentifierValue(CSSValueLinear); | 871 return cssValuePool().createIdentifierValue(CSSValueLinear); |
| 872 } | 872 } |
| 873 } | 873 } |
| 874 | 874 |
| 875 static PassRefPtrWillBeRawPtr<CSSValue> valueForAnimationTimingFunction(const CS
STimingData* timingData) | 875 static RawPtr<CSSValue> valueForAnimationTimingFunction(const CSSTimingData* tim
ingData) |
| 876 { | 876 { |
| 877 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated()
; | 877 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); |
| 878 if (timingData) { | 878 if (timingData) { |
| 879 for (size_t i = 0; i < timingData->timingFunctionList().size(); ++i) | 879 for (size_t i = 0; i < timingData->timingFunctionList().size(); ++i) |
| 880 list->append(createTimingFunctionValue(timingData->timingFunctionLis
t()[i].get())); | 880 list->append(createTimingFunctionValue(timingData->timingFunctionLis
t()[i].get())); |
| 881 } else { | 881 } else { |
| 882 list->append(createTimingFunctionValue(CSSTimingData::initialTimingFunct
ion().get())); | 882 list->append(createTimingFunctionValue(CSSTimingData::initialTimingFunct
ion().get())); |
| 883 } | 883 } |
| 884 return list.release(); | 884 return list.release(); |
| 885 } | 885 } |
| 886 | 886 |
| 887 static PassRefPtrWillBeRawPtr<CSSValueList> valuesForBorderRadiusCorner(LengthSi
ze radius, const ComputedStyle& style) | 887 static RawPtr<CSSValueList> valuesForBorderRadiusCorner(LengthSize radius, const
ComputedStyle& style) |
| 888 { | 888 { |
| 889 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 889 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); |
| 890 if (radius.width().type() == Percent) | 890 if (radius.width().type() == Percent) |
| 891 list->append(cssValuePool().createValue(radius.width().percent(), CSSPri
mitiveValue::UnitType::Percentage)); | 891 list->append(cssValuePool().createValue(radius.width().percent(), CSSPri
mitiveValue::UnitType::Percentage)); |
| 892 else | 892 else |
| 893 list->append(zoomAdjustedPixelValueForLength(radius.width(), style)); | 893 list->append(zoomAdjustedPixelValueForLength(radius.width(), style)); |
| 894 if (radius.height().type() == Percent) | 894 if (radius.height().type() == Percent) |
| 895 list->append(cssValuePool().createValue(radius.height().percent(), CSSPr
imitiveValue::UnitType::Percentage)); | 895 list->append(cssValuePool().createValue(radius.height().percent(), CSSPr
imitiveValue::UnitType::Percentage)); |
| 896 else | 896 else |
| 897 list->append(zoomAdjustedPixelValueForLength(radius.height(), style)); | 897 list->append(zoomAdjustedPixelValueForLength(radius.height(), style)); |
| 898 return list.release(); | 898 return list.release(); |
| 899 } | 899 } |
| 900 | 900 |
| 901 static PassRefPtrWillBeRawPtr<CSSValue> valueForBorderRadiusCorner(LengthSize ra
dius, const ComputedStyle& style) | 901 static RawPtr<CSSValue> valueForBorderRadiusCorner(LengthSize radius, const Comp
utedStyle& style) |
| 902 { | 902 { |
| 903 RefPtrWillBeRawPtr<CSSValueList> list = valuesForBorderRadiusCorner(radius,
style); | 903 RawPtr<CSSValueList> list = valuesForBorderRadiusCorner(radius, style); |
| 904 if (list->item(0)->equals(*list->item(1))) | 904 if (list->item(0)->equals(*list->item(1))) |
| 905 return list->item(0); | 905 return list->item(0); |
| 906 return list.release(); | 906 return list.release(); |
| 907 } | 907 } |
| 908 | 908 |
| 909 static PassRefPtrWillBeRawPtr<CSSFunctionValue> valueForMatrixTransform(const Tr
ansformationMatrix& transform, const ComputedStyle& style) | 909 static RawPtr<CSSFunctionValue> valueForMatrixTransform(const TransformationMatr
ix& transform, const ComputedStyle& style) |
| 910 { | 910 { |
| 911 RefPtrWillBeRawPtr<CSSFunctionValue> transformValue = nullptr; | 911 RawPtr<CSSFunctionValue> transformValue = nullptr; |
| 912 if (transform.isAffine()) { | 912 if (transform.isAffine()) { |
| 913 transformValue = CSSFunctionValue::create(CSSValueMatrix); | 913 transformValue = CSSFunctionValue::create(CSSValueMatrix); |
| 914 | 914 |
| 915 transformValue->append(cssValuePool().createValue(transform.a(), CSSPrim
itiveValue::UnitType::Number)); | 915 transformValue->append(cssValuePool().createValue(transform.a(), CSSPrim
itiveValue::UnitType::Number)); |
| 916 transformValue->append(cssValuePool().createValue(transform.b(), CSSPrim
itiveValue::UnitType::Number)); | 916 transformValue->append(cssValuePool().createValue(transform.b(), CSSPrim
itiveValue::UnitType::Number)); |
| 917 transformValue->append(cssValuePool().createValue(transform.c(), CSSPrim
itiveValue::UnitType::Number)); | 917 transformValue->append(cssValuePool().createValue(transform.c(), CSSPrim
itiveValue::UnitType::Number)); |
| 918 transformValue->append(cssValuePool().createValue(transform.d(), CSSPrim
itiveValue::UnitType::Number)); | 918 transformValue->append(cssValuePool().createValue(transform.d(), CSSPrim
itiveValue::UnitType::Number)); |
| 919 transformValue->append(zoomAdjustedNumberValue(transform.e(), style)); | 919 transformValue->append(zoomAdjustedNumberValue(transform.e(), style)); |
| 920 transformValue->append(zoomAdjustedNumberValue(transform.f(), style)); | 920 transformValue->append(zoomAdjustedNumberValue(transform.f(), style)); |
| 921 } else { | 921 } else { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 938 | 938 |
| 939 transformValue->append(zoomAdjustedNumberValue(transform.m41(), style)); | 939 transformValue->append(zoomAdjustedNumberValue(transform.m41(), style)); |
| 940 transformValue->append(zoomAdjustedNumberValue(transform.m42(), style)); | 940 transformValue->append(zoomAdjustedNumberValue(transform.m42(), style)); |
| 941 transformValue->append(zoomAdjustedNumberValue(transform.m43(), style)); | 941 transformValue->append(zoomAdjustedNumberValue(transform.m43(), style)); |
| 942 transformValue->append(cssValuePool().createValue(transform.m44(), CSSPr
imitiveValue::UnitType::Number)); | 942 transformValue->append(cssValuePool().createValue(transform.m44(), CSSPr
imitiveValue::UnitType::Number)); |
| 943 } | 943 } |
| 944 | 944 |
| 945 return transformValue.release(); | 945 return transformValue.release(); |
| 946 } | 946 } |
| 947 | 947 |
| 948 static PassRefPtrWillBeRawPtr<CSSValue> computedTransform(const LayoutObject* la
youtObject, const ComputedStyle& style) | 948 static RawPtr<CSSValue> computedTransform(const LayoutObject* layoutObject, cons
t ComputedStyle& style) |
| 949 { | 949 { |
| 950 if (!layoutObject || !style.hasTransform()) | 950 if (!layoutObject || !style.hasTransform()) |
| 951 return cssValuePool().createIdentifierValue(CSSValueNone); | 951 return cssValuePool().createIdentifierValue(CSSValueNone); |
| 952 | 952 |
| 953 IntRect box; | 953 IntRect box; |
| 954 if (layoutObject->isBox()) | 954 if (layoutObject->isBox()) |
| 955 box = pixelSnappedIntRect(toLayoutBox(layoutObject)->borderBoxRect()); | 955 box = pixelSnappedIntRect(toLayoutBox(layoutObject)->borderBoxRect()); |
| 956 | 956 |
| 957 TransformationMatrix transform; | 957 TransformationMatrix transform; |
| 958 style.applyTransform(transform, LayoutSize(box.size()), ComputedStyle::Exclu
deTransformOrigin, ComputedStyle::ExcludeMotionPath, ComputedStyle::ExcludeIndep
endentTransformProperties); | 958 style.applyTransform(transform, LayoutSize(box.size()), ComputedStyle::Exclu
deTransformOrigin, ComputedStyle::ExcludeMotionPath, ComputedStyle::ExcludeIndep
endentTransformProperties); |
| 959 | 959 |
| 960 // FIXME: Need to print out individual functions (https://bugs.webkit.org/sh
ow_bug.cgi?id=23924) | 960 // FIXME: Need to print out individual functions (https://bugs.webkit.org/sh
ow_bug.cgi?id=23924) |
| 961 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 961 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); |
| 962 list->append(valueForMatrixTransform(transform, style)); | 962 list->append(valueForMatrixTransform(transform, style)); |
| 963 | 963 |
| 964 return list.release(); | 964 return list.release(); |
| 965 } | 965 } |
| 966 | 966 |
| 967 static PassRefPtrWillBeRawPtr<CSSValue> createTransitionPropertyValue(const CSST
ransitionData::TransitionProperty& property) | 967 static RawPtr<CSSValue> createTransitionPropertyValue(const CSSTransitionData::T
ransitionProperty& property) |
| 968 { | 968 { |
| 969 if (property.propertyType == CSSTransitionData::TransitionNone) | 969 if (property.propertyType == CSSTransitionData::TransitionNone) |
| 970 return cssValuePool().createIdentifierValue(CSSValueNone); | 970 return cssValuePool().createIdentifierValue(CSSValueNone); |
| 971 if (property.propertyType == CSSTransitionData::TransitionUnknownProperty) | 971 if (property.propertyType == CSSTransitionData::TransitionUnknownProperty) |
| 972 return CSSCustomIdentValue::create(property.propertyString); | 972 return CSSCustomIdentValue::create(property.propertyString); |
| 973 ASSERT(property.propertyType == CSSTransitionData::TransitionKnownProperty); | 973 ASSERT(property.propertyType == CSSTransitionData::TransitionKnownProperty); |
| 974 return CSSCustomIdentValue::create(getPropertyNameString(property.unresolved
Property)); | 974 return CSSCustomIdentValue::create(getPropertyNameString(property.unresolved
Property)); |
| 975 } | 975 } |
| 976 | 976 |
| 977 static PassRefPtrWillBeRawPtr<CSSValue> valueForTransitionProperty(const CSSTran
sitionData* transitionData) | 977 static RawPtr<CSSValue> valueForTransitionProperty(const CSSTransitionData* tran
sitionData) |
| 978 { | 978 { |
| 979 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated()
; | 979 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); |
| 980 if (transitionData) { | 980 if (transitionData) { |
| 981 for (size_t i = 0; i < transitionData->propertyList().size(); ++i) | 981 for (size_t i = 0; i < transitionData->propertyList().size(); ++i) |
| 982 list->append(createTransitionPropertyValue(transitionData->propertyL
ist()[i])); | 982 list->append(createTransitionPropertyValue(transitionData->propertyL
ist()[i])); |
| 983 } else { | 983 } else { |
| 984 list->append(cssValuePool().createIdentifierValue(CSSValueAll)); | 984 list->append(cssValuePool().createIdentifierValue(CSSValueAll)); |
| 985 } | 985 } |
| 986 return list.release(); | 986 return list.release(); |
| 987 } | 987 } |
| 988 | 988 |
| 989 CSSValueID valueForQuoteType(const QuoteType quoteType) | 989 CSSValueID valueForQuoteType(const QuoteType quoteType) |
| 990 { | 990 { |
| 991 switch (quoteType) { | 991 switch (quoteType) { |
| 992 case NO_OPEN_QUOTE: | 992 case NO_OPEN_QUOTE: |
| 993 return CSSValueNoOpenQuote; | 993 return CSSValueNoOpenQuote; |
| 994 case NO_CLOSE_QUOTE: | 994 case NO_CLOSE_QUOTE: |
| 995 return CSSValueNoCloseQuote; | 995 return CSSValueNoCloseQuote; |
| 996 case CLOSE_QUOTE: | 996 case CLOSE_QUOTE: |
| 997 return CSSValueCloseQuote; | 997 return CSSValueCloseQuote; |
| 998 case OPEN_QUOTE: | 998 case OPEN_QUOTE: |
| 999 return CSSValueOpenQuote; | 999 return CSSValueOpenQuote; |
| 1000 } | 1000 } |
| 1001 ASSERT_NOT_REACHED(); | 1001 ASSERT_NOT_REACHED(); |
| 1002 return CSSValueInvalid; | 1002 return CSSValueInvalid; |
| 1003 } | 1003 } |
| 1004 | 1004 |
| 1005 static PassRefPtrWillBeRawPtr<CSSValue> valueForContentData(const ComputedStyle&
style) | 1005 static RawPtr<CSSValue> valueForContentData(const ComputedStyle& style) |
| 1006 { | 1006 { |
| 1007 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 1007 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); |
| 1008 for (const ContentData* contentData = style.contentData(); contentData; cont
entData = contentData->next()) { | 1008 for (const ContentData* contentData = style.contentData(); contentData; cont
entData = contentData->next()) { |
| 1009 if (contentData->isCounter()) { | 1009 if (contentData->isCounter()) { |
| 1010 const CounterContent* counter = toCounterContentData(contentData)->c
ounter(); | 1010 const CounterContent* counter = toCounterContentData(contentData)->c
ounter(); |
| 1011 ASSERT(counter); | 1011 ASSERT(counter); |
| 1012 RefPtrWillBeRawPtr<CSSCustomIdentValue> identifier = CSSCustomIdentV
alue::create(counter->identifier()); | 1012 RawPtr<CSSCustomIdentValue> identifier = CSSCustomIdentValue::create
(counter->identifier()); |
| 1013 RefPtrWillBeRawPtr<CSSCustomIdentValue> separator = CSSCustomIdentVa
lue::create(counter->separator()); | 1013 RawPtr<CSSCustomIdentValue> separator = CSSCustomIdentValue::create(
counter->separator()); |
| 1014 CSSValueID listStyleIdent = CSSValueNone; | 1014 CSSValueID listStyleIdent = CSSValueNone; |
| 1015 if (counter->listStyle() != NoneListStyle) | 1015 if (counter->listStyle() != NoneListStyle) |
| 1016 listStyleIdent = static_cast<CSSValueID>(CSSValueDisc + counter-
>listStyle()); | 1016 listStyleIdent = static_cast<CSSValueID>(CSSValueDisc + counter-
>listStyle()); |
| 1017 RefPtrWillBeRawPtr<CSSPrimitiveValue> listStyle = cssValuePool().cre
ateIdentifierValue(listStyleIdent); | 1017 RawPtr<CSSPrimitiveValue> listStyle = cssValuePool().createIdentifie
rValue(listStyleIdent); |
| 1018 list->append(CSSCounterValue::create(identifier.release(), listStyle
.release(), separator.release())); | 1018 list->append(CSSCounterValue::create(identifier.release(), listStyle
.release(), separator.release())); |
| 1019 } else if (contentData->isImage()) { | 1019 } else if (contentData->isImage()) { |
| 1020 const StyleImage* image = toImageContentData(contentData)->image(); | 1020 const StyleImage* image = toImageContentData(contentData)->image(); |
| 1021 ASSERT(image); | 1021 ASSERT(image); |
| 1022 list->append(image->computedCSSValue()); | 1022 list->append(image->computedCSSValue()); |
| 1023 } else if (contentData->isText()) { | 1023 } else if (contentData->isText()) { |
| 1024 list->append(CSSStringValue::create(toTextContentData(contentData)->
text())); | 1024 list->append(CSSStringValue::create(toTextContentData(contentData)->
text())); |
| 1025 } else if (contentData->isQuote()) { | 1025 } else if (contentData->isQuote()) { |
| 1026 const QuoteType quoteType = toQuoteContentData(contentData)->quote()
; | 1026 const QuoteType quoteType = toQuoteContentData(contentData)->quote()
; |
| 1027 list->append(cssValuePool().createIdentifierValue(valueForQuoteType(
quoteType))); | 1027 list->append(cssValuePool().createIdentifierValue(valueForQuoteType(
quoteType))); |
| 1028 } else { | 1028 } else { |
| 1029 ASSERT_NOT_REACHED(); | 1029 ASSERT_NOT_REACHED(); |
| 1030 } | 1030 } |
| 1031 } | 1031 } |
| 1032 return list.release(); | 1032 return list.release(); |
| 1033 } | 1033 } |
| 1034 | 1034 |
| 1035 static PassRefPtrWillBeRawPtr<CSSValue> valueForCounterDirectives(const Computed
Style& style, CSSPropertyID propertyID) | 1035 static RawPtr<CSSValue> valueForCounterDirectives(const ComputedStyle& style, CS
SPropertyID propertyID) |
| 1036 { | 1036 { |
| 1037 const CounterDirectiveMap* map = style.counterDirectives(); | 1037 const CounterDirectiveMap* map = style.counterDirectives(); |
| 1038 if (!map) | 1038 if (!map) |
| 1039 return cssValuePool().createIdentifierValue(CSSValueNone); | 1039 return cssValuePool().createIdentifierValue(CSSValueNone); |
| 1040 | 1040 |
| 1041 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 1041 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); |
| 1042 for (const auto& item : *map) { | 1042 for (const auto& item : *map) { |
| 1043 bool isValidCounterValue = propertyID == CSSPropertyCounterIncrement ? i
tem.value.isIncrement() : item.value.isReset(); | 1043 bool isValidCounterValue = propertyID == CSSPropertyCounterIncrement ? i
tem.value.isIncrement() : item.value.isReset(); |
| 1044 if (!isValidCounterValue) | 1044 if (!isValidCounterValue) |
| 1045 continue; | 1045 continue; |
| 1046 | 1046 |
| 1047 list->append(CSSCustomIdentValue::create(item.key)); | 1047 list->append(CSSCustomIdentValue::create(item.key)); |
| 1048 short number = propertyID == CSSPropertyCounterIncrement ? item.value.in
crementValue() : item.value.resetValue(); | 1048 short number = propertyID == CSSPropertyCounterIncrement ? item.value.in
crementValue() : item.value.resetValue(); |
| 1049 list->append(cssValuePool().createValue((double)number, CSSPrimitiveValu
e::UnitType::Integer)); | 1049 list->append(cssValuePool().createValue((double)number, CSSPrimitiveValu
e::UnitType::Integer)); |
| 1050 } | 1050 } |
| 1051 | 1051 |
| 1052 if (!list->length()) | 1052 if (!list->length()) |
| 1053 return cssValuePool().createIdentifierValue(CSSValueNone); | 1053 return cssValuePool().createIdentifierValue(CSSValueNone); |
| 1054 | 1054 |
| 1055 return list.release(); | 1055 return list.release(); |
| 1056 } | 1056 } |
| 1057 | 1057 |
| 1058 static PassRefPtrWillBeRawPtr<CSSValue> valueForShape(const ComputedStyle& style
, ShapeValue* shapeValue) | 1058 static RawPtr<CSSValue> valueForShape(const ComputedStyle& style, ShapeValue* sh
apeValue) |
| 1059 { | 1059 { |
| 1060 if (!shapeValue) | 1060 if (!shapeValue) |
| 1061 return cssValuePool().createIdentifierValue(CSSValueNone); | 1061 return cssValuePool().createIdentifierValue(CSSValueNone); |
| 1062 if (shapeValue->type() == ShapeValue::Box) | 1062 if (shapeValue->type() == ShapeValue::Box) |
| 1063 return cssValuePool().createValue(shapeValue->cssBox()); | 1063 return cssValuePool().createValue(shapeValue->cssBox()); |
| 1064 if (shapeValue->type() == ShapeValue::Image) { | 1064 if (shapeValue->type() == ShapeValue::Image) { |
| 1065 if (shapeValue->image()) | 1065 if (shapeValue->image()) |
| 1066 return shapeValue->image()->computedCSSValue(); | 1066 return shapeValue->image()->computedCSSValue(); |
| 1067 return cssValuePool().createIdentifierValue(CSSValueNone); | 1067 return cssValuePool().createIdentifierValue(CSSValueNone); |
| 1068 } | 1068 } |
| 1069 | 1069 |
| 1070 ASSERT(shapeValue->type() == ShapeValue::Shape); | 1070 ASSERT(shapeValue->type() == ShapeValue::Shape); |
| 1071 | 1071 |
| 1072 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 1072 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); |
| 1073 list->append(valueForBasicShape(style, shapeValue->shape())); | 1073 list->append(valueForBasicShape(style, shapeValue->shape())); |
| 1074 if (shapeValue->cssBox() != BoxMissing) | 1074 if (shapeValue->cssBox() != BoxMissing) |
| 1075 list->append(cssValuePool().createValue(shapeValue->cssBox())); | 1075 list->append(cssValuePool().createValue(shapeValue->cssBox())); |
| 1076 return list.release(); | 1076 return list.release(); |
| 1077 } | 1077 } |
| 1078 | 1078 |
| 1079 static PassRefPtrWillBeRawPtr<CSSValueList> valuesForSidesShorthand(const StyleP
ropertyShorthand& shorthand, const ComputedStyle& style, const LayoutObject* lay
outObject, Node* styledNode, bool allowVisitedStyle) | 1079 static RawPtr<CSSValueList> valuesForSidesShorthand(const StylePropertyShorthand
& shorthand, const ComputedStyle& style, const LayoutObject* layoutObject, Node*
styledNode, bool allowVisitedStyle) |
| 1080 { | 1080 { |
| 1081 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 1081 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); |
| 1082 // Assume the properties are in the usual order top, right, bottom, left. | 1082 // Assume the properties are in the usual order top, right, bottom, left. |
| 1083 RefPtrWillBeRawPtr<CSSValue> topValue = ComputedStyleCSSValueMapping::get(sh
orthand.properties()[0], style, layoutObject, styledNode, allowVisitedStyle); | 1083 RawPtr<CSSValue> topValue = ComputedStyleCSSValueMapping::get(shorthand.prop
erties()[0], style, layoutObject, styledNode, allowVisitedStyle); |
| 1084 RefPtrWillBeRawPtr<CSSValue> rightValue = ComputedStyleCSSValueMapping::get(
shorthand.properties()[1], style, layoutObject, styledNode, allowVisitedStyle); | 1084 RawPtr<CSSValue> rightValue = ComputedStyleCSSValueMapping::get(shorthand.pr
operties()[1], style, layoutObject, styledNode, allowVisitedStyle); |
| 1085 RefPtrWillBeRawPtr<CSSValue> bottomValue = ComputedStyleCSSValueMapping::get
(shorthand.properties()[2], style, layoutObject, styledNode, allowVisitedStyle); | 1085 RawPtr<CSSValue> bottomValue = ComputedStyleCSSValueMapping::get(shorthand.p
roperties()[2], style, layoutObject, styledNode, allowVisitedStyle); |
| 1086 RefPtrWillBeRawPtr<CSSValue> leftValue = ComputedStyleCSSValueMapping::get(s
horthand.properties()[3], style, layoutObject, styledNode, allowVisitedStyle); | 1086 RawPtr<CSSValue> leftValue = ComputedStyleCSSValueMapping::get(shorthand.pro
perties()[3], style, layoutObject, styledNode, allowVisitedStyle); |
| 1087 | 1087 |
| 1088 // All 4 properties must be specified. | 1088 // All 4 properties must be specified. |
| 1089 if (!topValue || !rightValue || !bottomValue || !leftValue) | 1089 if (!topValue || !rightValue || !bottomValue || !leftValue) |
| 1090 return nullptr; | 1090 return nullptr; |
| 1091 | 1091 |
| 1092 bool showLeft = !compareCSSValuePtr(rightValue, leftValue); | 1092 bool showLeft = !compareCSSValuePtr(rightValue, leftValue); |
| 1093 bool showBottom = !compareCSSValuePtr(topValue, bottomValue) || showLeft; | 1093 bool showBottom = !compareCSSValuePtr(topValue, bottomValue) || showLeft; |
| 1094 bool showRight = !compareCSSValuePtr(topValue, rightValue) || showBottom; | 1094 bool showRight = !compareCSSValuePtr(topValue, rightValue) || showBottom; |
| 1095 | 1095 |
| 1096 list->append(topValue.release()); | 1096 list->append(topValue.release()); |
| 1097 if (showRight) | 1097 if (showRight) |
| 1098 list->append(rightValue.release()); | 1098 list->append(rightValue.release()); |
| 1099 if (showBottom) | 1099 if (showBottom) |
| 1100 list->append(bottomValue.release()); | 1100 list->append(bottomValue.release()); |
| 1101 if (showLeft) | 1101 if (showLeft) |
| 1102 list->append(leftValue.release()); | 1102 list->append(leftValue.release()); |
| 1103 | 1103 |
| 1104 return list.release(); | 1104 return list.release(); |
| 1105 } | 1105 } |
| 1106 | 1106 |
| 1107 static PassRefPtrWillBeRawPtr<CSSValueList> valueForBorderRadiusShorthand(const
ComputedStyle& style) | 1107 static RawPtr<CSSValueList> valueForBorderRadiusShorthand(const ComputedStyle& s
tyle) |
| 1108 { | 1108 { |
| 1109 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSlashSeparated()
; | 1109 RawPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); |
| 1110 | 1110 |
| 1111 bool showHorizontalBottomLeft = style.borderTopRightRadius().width() != styl
e.borderBottomLeftRadius().width(); | 1111 bool showHorizontalBottomLeft = style.borderTopRightRadius().width() != styl
e.borderBottomLeftRadius().width(); |
| 1112 bool showHorizontalBottomRight = showHorizontalBottomLeft || (style.borderBo
ttomRightRadius().width() != style.borderTopLeftRadius().width()); | 1112 bool showHorizontalBottomRight = showHorizontalBottomLeft || (style.borderBo
ttomRightRadius().width() != style.borderTopLeftRadius().width()); |
| 1113 bool showHorizontalTopRight = showHorizontalBottomRight || (style.borderTopR
ightRadius().width() != style.borderTopLeftRadius().width()); | 1113 bool showHorizontalTopRight = showHorizontalBottomRight || (style.borderTopR
ightRadius().width() != style.borderTopLeftRadius().width()); |
| 1114 | 1114 |
| 1115 bool showVerticalBottomLeft = style.borderTopRightRadius().height() != style
.borderBottomLeftRadius().height(); | 1115 bool showVerticalBottomLeft = style.borderTopRightRadius().height() != style
.borderBottomLeftRadius().height(); |
| 1116 bool showVerticalBottomRight = showVerticalBottomLeft || (style.borderBottom
RightRadius().height() != style.borderTopLeftRadius().height()); | 1116 bool showVerticalBottomRight = showVerticalBottomLeft || (style.borderBottom
RightRadius().height() != style.borderTopLeftRadius().height()); |
| 1117 bool showVerticalTopRight = showVerticalBottomRight || (style.borderTopRight
Radius().height() != style.borderTopLeftRadius().height()); | 1117 bool showVerticalTopRight = showVerticalBottomRight || (style.borderTopRight
Radius().height() != style.borderTopLeftRadius().height()); |
| 1118 | 1118 |
| 1119 RefPtrWillBeRawPtr<CSSValueList> topLeftRadius = valuesForBorderRadiusCorner
(style.borderTopLeftRadius(), style); | 1119 RawPtr<CSSValueList> topLeftRadius = valuesForBorderRadiusCorner(style.borde
rTopLeftRadius(), style); |
| 1120 RefPtrWillBeRawPtr<CSSValueList> topRightRadius = valuesForBorderRadiusCorne
r(style.borderTopRightRadius(), style); | 1120 RawPtr<CSSValueList> topRightRadius = valuesForBorderRadiusCorner(style.bord
erTopRightRadius(), style); |
| 1121 RefPtrWillBeRawPtr<CSSValueList> bottomRightRadius = valuesForBorderRadiusCo
rner(style.borderBottomRightRadius(), style); | 1121 RawPtr<CSSValueList> bottomRightRadius = valuesForBorderRadiusCorner(style.b
orderBottomRightRadius(), style); |
| 1122 RefPtrWillBeRawPtr<CSSValueList> bottomLeftRadius = valuesForBorderRadiusCor
ner(style.borderBottomLeftRadius(), style); | 1122 RawPtr<CSSValueList> bottomLeftRadius = valuesForBorderRadiusCorner(style.bo
rderBottomLeftRadius(), style); |
| 1123 | 1123 |
| 1124 RefPtrWillBeRawPtr<CSSValueList> horizontalRadii = CSSValueList::createSpace
Separated(); | 1124 RawPtr<CSSValueList> horizontalRadii = CSSValueList::createSpaceSeparated(); |
| 1125 horizontalRadii->append(topLeftRadius->item(0)); | 1125 horizontalRadii->append(topLeftRadius->item(0)); |
| 1126 if (showHorizontalTopRight) | 1126 if (showHorizontalTopRight) |
| 1127 horizontalRadii->append(topRightRadius->item(0)); | 1127 horizontalRadii->append(topRightRadius->item(0)); |
| 1128 if (showHorizontalBottomRight) | 1128 if (showHorizontalBottomRight) |
| 1129 horizontalRadii->append(bottomRightRadius->item(0)); | 1129 horizontalRadii->append(bottomRightRadius->item(0)); |
| 1130 if (showHorizontalBottomLeft) | 1130 if (showHorizontalBottomLeft) |
| 1131 horizontalRadii->append(bottomLeftRadius->item(0)); | 1131 horizontalRadii->append(bottomLeftRadius->item(0)); |
| 1132 | 1132 |
| 1133 list->append(horizontalRadii.release()); | 1133 list->append(horizontalRadii.release()); |
| 1134 | 1134 |
| 1135 RefPtrWillBeRawPtr<CSSValueList> verticalRadii = CSSValueList::createSpaceSe
parated(); | 1135 RawPtr<CSSValueList> verticalRadii = CSSValueList::createSpaceSeparated(); |
| 1136 verticalRadii->append(topLeftRadius->item(1)); | 1136 verticalRadii->append(topLeftRadius->item(1)); |
| 1137 if (showVerticalTopRight) | 1137 if (showVerticalTopRight) |
| 1138 verticalRadii->append(topRightRadius->item(1)); | 1138 verticalRadii->append(topRightRadius->item(1)); |
| 1139 if (showVerticalBottomRight) | 1139 if (showVerticalBottomRight) |
| 1140 verticalRadii->append(bottomRightRadius->item(1)); | 1140 verticalRadii->append(bottomRightRadius->item(1)); |
| 1141 if (showVerticalBottomLeft) | 1141 if (showVerticalBottomLeft) |
| 1142 verticalRadii->append(bottomLeftRadius->item(1)); | 1142 verticalRadii->append(bottomLeftRadius->item(1)); |
| 1143 | 1143 |
| 1144 if (!verticalRadii->equals(*toCSSValueList(list->item(0)))) | 1144 if (!verticalRadii->equals(*toCSSValueList(list->item(0)))) |
| 1145 list->append(verticalRadii.release()); | 1145 list->append(verticalRadii.release()); |
| 1146 | 1146 |
| 1147 return list.release(); | 1147 return list.release(); |
| 1148 } | 1148 } |
| 1149 | 1149 |
| 1150 static PassRefPtrWillBeRawPtr<CSSValue> strokeDashArrayToCSSValueList(const SVGD
ashArray& dashes, const ComputedStyle& style) | 1150 static RawPtr<CSSValue> strokeDashArrayToCSSValueList(const SVGDashArray& dashes
, const ComputedStyle& style) |
| 1151 { | 1151 { |
| 1152 if (dashes.isEmpty()) | 1152 if (dashes.isEmpty()) |
| 1153 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 1153 return CSSPrimitiveValue::createIdentifier(CSSValueNone); |
| 1154 | 1154 |
| 1155 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated()
; | 1155 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); |
| 1156 for (const Length& dashLength : dashes.vector()) | 1156 for (const Length& dashLength : dashes.vector()) |
| 1157 list->append(zoomAdjustedPixelValueForLength(dashLength, style)); | 1157 list->append(zoomAdjustedPixelValueForLength(dashLength, style)); |
| 1158 | 1158 |
| 1159 return list.release(); | 1159 return list.release(); |
| 1160 } | 1160 } |
| 1161 | 1161 |
| 1162 static PassRefPtrWillBeRawPtr<CSSValue> paintOrderToCSSValueList(const SVGComput
edStyle& svgStyle) | 1162 static RawPtr<CSSValue> paintOrderToCSSValueList(const SVGComputedStyle& svgStyl
e) |
| 1163 { | 1163 { |
| 1164 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 1164 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); |
| 1165 for (int i = 0; i < 3; i++) { | 1165 for (int i = 0; i < 3; i++) { |
| 1166 EPaintOrderType paintOrderType = svgStyle.paintOrderType(i); | 1166 EPaintOrderType paintOrderType = svgStyle.paintOrderType(i); |
| 1167 switch (paintOrderType) { | 1167 switch (paintOrderType) { |
| 1168 case PT_FILL: | 1168 case PT_FILL: |
| 1169 case PT_STROKE: | 1169 case PT_STROKE: |
| 1170 case PT_MARKERS: | 1170 case PT_MARKERS: |
| 1171 list->append(CSSPrimitiveValue::create(paintOrderType)); | 1171 list->append(CSSPrimitiveValue::create(paintOrderType)); |
| 1172 break; | 1172 break; |
| 1173 case PT_NONE: | 1173 case PT_NONE: |
| 1174 default: | 1174 default: |
| 1175 ASSERT_NOT_REACHED(); | 1175 ASSERT_NOT_REACHED(); |
| 1176 break; | 1176 break; |
| 1177 } | 1177 } |
| 1178 } | 1178 } |
| 1179 | 1179 |
| 1180 return list.release(); | 1180 return list.release(); |
| 1181 } | 1181 } |
| 1182 | 1182 |
| 1183 static PassRefPtrWillBeRawPtr<CSSValue> adjustSVGPaintForCurrentColor(SVGPaintTy
pe paintType, const String& url, const Color& color, const Color& currentColor) | 1183 static RawPtr<CSSValue> adjustSVGPaintForCurrentColor(SVGPaintType paintType, co
nst String& url, const Color& color, const Color& currentColor) |
| 1184 { | 1184 { |
| 1185 if (paintType >= SVG_PAINTTYPE_URI_NONE) { | 1185 if (paintType >= SVG_PAINTTYPE_URI_NONE) { |
| 1186 RefPtrWillBeRawPtr<CSSValueList> values = CSSValueList::createSpaceSepar
ated(); | 1186 RawPtr<CSSValueList> values = CSSValueList::createSpaceSeparated(); |
| 1187 values->append(CSSURIValue::create(url)); | 1187 values->append(CSSURIValue::create(url)); |
| 1188 if (paintType == SVG_PAINTTYPE_URI_NONE) | 1188 if (paintType == SVG_PAINTTYPE_URI_NONE) |
| 1189 values->append(CSSPrimitiveValue::createIdentifier(CSSValueNone)); | 1189 values->append(CSSPrimitiveValue::createIdentifier(CSSValueNone)); |
| 1190 else if (paintType == SVG_PAINTTYPE_URI_CURRENTCOLOR) | 1190 else if (paintType == SVG_PAINTTYPE_URI_CURRENTCOLOR) |
| 1191 values->append(CSSColorValue::create(currentColor.rgb())); | 1191 values->append(CSSColorValue::create(currentColor.rgb())); |
| 1192 else if (paintType == SVG_PAINTTYPE_URI_RGBCOLOR) | 1192 else if (paintType == SVG_PAINTTYPE_URI_RGBCOLOR) |
| 1193 values->append(CSSColorValue::create(color.rgb())); | 1193 values->append(CSSColorValue::create(color.rgb())); |
| 1194 return values.release(); | 1194 return values.release(); |
| 1195 } | 1195 } |
| 1196 if (paintType == SVG_PAINTTYPE_NONE) | 1196 if (paintType == SVG_PAINTTYPE_NONE) |
| 1197 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 1197 return CSSPrimitiveValue::createIdentifier(CSSValueNone); |
| 1198 if (paintType == SVG_PAINTTYPE_CURRENTCOLOR) | 1198 if (paintType == SVG_PAINTTYPE_CURRENTCOLOR) |
| 1199 return CSSColorValue::create(currentColor.rgb()); | 1199 return CSSColorValue::create(currentColor.rgb()); |
| 1200 | 1200 |
| 1201 return CSSColorValue::create(color.rgb()); | 1201 return CSSColorValue::create(color.rgb()); |
| 1202 } | 1202 } |
| 1203 | 1203 |
| 1204 static inline String serializeAsFragmentIdentifier(const AtomicString& resource) | 1204 static inline String serializeAsFragmentIdentifier(const AtomicString& resource) |
| 1205 { | 1205 { |
| 1206 return "#" + resource; | 1206 return "#" + resource; |
| 1207 } | 1207 } |
| 1208 | 1208 |
| 1209 PassRefPtrWillBeRawPtr<CSSValue> ComputedStyleCSSValueMapping::valueForShadowDat
a(const ShadowData& shadow, const ComputedStyle& style, bool useSpread) | 1209 RawPtr<CSSValue> ComputedStyleCSSValueMapping::valueForShadowData(const ShadowDa
ta& shadow, const ComputedStyle& style, bool useSpread) |
| 1210 { | 1210 { |
| 1211 RefPtrWillBeRawPtr<CSSPrimitiveValue> x = zoomAdjustedPixelValue(shadow.x(),
style); | 1211 RawPtr<CSSPrimitiveValue> x = zoomAdjustedPixelValue(shadow.x(), style); |
| 1212 RefPtrWillBeRawPtr<CSSPrimitiveValue> y = zoomAdjustedPixelValue(shadow.y(),
style); | 1212 RawPtr<CSSPrimitiveValue> y = zoomAdjustedPixelValue(shadow.y(), style); |
| 1213 RefPtrWillBeRawPtr<CSSPrimitiveValue> blur = zoomAdjustedPixelValue(shadow.b
lur(), style); | 1213 RawPtr<CSSPrimitiveValue> blur = zoomAdjustedPixelValue(shadow.blur(), style
); |
| 1214 RefPtrWillBeRawPtr<CSSPrimitiveValue> spread = useSpread ? zoomAdjustedPixel
Value(shadow.spread(), style) : PassRefPtrWillBeRawPtr<CSSPrimitiveValue>(nullpt
r); | 1214 RawPtr<CSSPrimitiveValue> spread = useSpread ? zoomAdjustedPixelValue(shadow
.spread(), style) : RawPtr<CSSPrimitiveValue>(nullptr); |
| 1215 RefPtrWillBeRawPtr<CSSPrimitiveValue> shadowStyle = shadow.style() == Normal
? PassRefPtrWillBeRawPtr<CSSPrimitiveValue>(nullptr) : cssValuePool().createIde
ntifierValue(CSSValueInset); | 1215 RawPtr<CSSPrimitiveValue> shadowStyle = shadow.style() == Normal ? RawPtr<CS
SPrimitiveValue>(nullptr) : cssValuePool().createIdentifierValue(CSSValueInset); |
| 1216 RefPtrWillBeRawPtr<CSSValue> color = currentColorOrValidColor(style, shadow.
color()); | 1216 RawPtr<CSSValue> color = currentColorOrValidColor(style, shadow.color()); |
| 1217 return CSSShadowValue::create(x.release(), y.release(), blur.release(), spre
ad.release(), shadowStyle.release(), color.release()); | 1217 return CSSShadowValue::create(x.release(), y.release(), blur.release(), spre
ad.release(), shadowStyle.release(), color.release()); |
| 1218 } | 1218 } |
| 1219 | 1219 |
| 1220 PassRefPtrWillBeRawPtr<CSSValue> ComputedStyleCSSValueMapping::valueForShadowLis
t(const ShadowList* shadowList, const ComputedStyle& style, bool useSpread) | 1220 RawPtr<CSSValue> ComputedStyleCSSValueMapping::valueForShadowList(const ShadowLi
st* shadowList, const ComputedStyle& style, bool useSpread) |
| 1221 { | 1221 { |
| 1222 if (!shadowList) | 1222 if (!shadowList) |
| 1223 return cssValuePool().createIdentifierValue(CSSValueNone); | 1223 return cssValuePool().createIdentifierValue(CSSValueNone); |
| 1224 | 1224 |
| 1225 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated()
; | 1225 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); |
| 1226 size_t shadowCount = shadowList->shadows().size(); | 1226 size_t shadowCount = shadowList->shadows().size(); |
| 1227 for (size_t i = 0; i < shadowCount; ++i) | 1227 for (size_t i = 0; i < shadowCount; ++i) |
| 1228 list->append(valueForShadowData(shadowList->shadows()[i], style, useSpre
ad)); | 1228 list->append(valueForShadowData(shadowList->shadows()[i], style, useSpre
ad)); |
| 1229 return list.release(); | 1229 return list.release(); |
| 1230 } | 1230 } |
| 1231 | 1231 |
| 1232 PassRefPtrWillBeRawPtr<CSSValue> ComputedStyleCSSValueMapping::valueForFilter(co
nst ComputedStyle& style, const FilterOperations& filterOperations) | 1232 RawPtr<CSSValue> ComputedStyleCSSValueMapping::valueForFilter(const ComputedStyl
e& style, const FilterOperations& filterOperations) |
| 1233 { | 1233 { |
| 1234 if (filterOperations.operations().isEmpty()) | 1234 if (filterOperations.operations().isEmpty()) |
| 1235 return cssValuePool().createIdentifierValue(CSSValueNone); | 1235 return cssValuePool().createIdentifierValue(CSSValueNone); |
| 1236 | 1236 |
| 1237 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 1237 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); |
| 1238 | 1238 |
| 1239 RefPtrWillBeRawPtr<CSSFunctionValue> filterValue = nullptr; | 1239 RawPtr<CSSFunctionValue> filterValue = nullptr; |
| 1240 | 1240 |
| 1241 for (const auto& operation : filterOperations.operations()) { | 1241 for (const auto& operation : filterOperations.operations()) { |
| 1242 FilterOperation* filterOperation = operation.get(); | 1242 FilterOperation* filterOperation = operation.get(); |
| 1243 switch (filterOperation->type()) { | 1243 switch (filterOperation->type()) { |
| 1244 case FilterOperation::REFERENCE: | 1244 case FilterOperation::REFERENCE: |
| 1245 filterValue = CSSFunctionValue::create(CSSValueUrl); | 1245 filterValue = CSSFunctionValue::create(CSSValueUrl); |
| 1246 filterValue->append(CSSCustomIdentValue::create(toReferenceFilterOpe
ration(filterOperation)->url())); | 1246 filterValue->append(CSSCustomIdentValue::create(toReferenceFilterOpe
ration(filterOperation)->url())); |
| 1247 break; | 1247 break; |
| 1248 case FilterOperation::GRAYSCALE: | 1248 case FilterOperation::GRAYSCALE: |
| 1249 filterValue = CSSFunctionValue::create(CSSValueGrayscale); | 1249 filterValue = CSSFunctionValue::create(CSSValueGrayscale); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1292 default: | 1292 default: |
| 1293 ASSERT_NOT_REACHED(); | 1293 ASSERT_NOT_REACHED(); |
| 1294 break; | 1294 break; |
| 1295 } | 1295 } |
| 1296 list->append(filterValue.release()); | 1296 list->append(filterValue.release()); |
| 1297 } | 1297 } |
| 1298 | 1298 |
| 1299 return list.release(); | 1299 return list.release(); |
| 1300 } | 1300 } |
| 1301 | 1301 |
| 1302 PassRefPtrWillBeRawPtr<CSSValue> ComputedStyleCSSValueMapping::valueForFont(cons
t ComputedStyle& style) | 1302 RawPtr<CSSValue> ComputedStyleCSSValueMapping::valueForFont(const ComputedStyle&
style) |
| 1303 { | 1303 { |
| 1304 // Add a slash between size and line-height. | 1304 // Add a slash between size and line-height. |
| 1305 RefPtrWillBeRawPtr<CSSValueList> sizeAndLineHeight = CSSValueList::createSla
shSeparated(); | 1305 RawPtr<CSSValueList> sizeAndLineHeight = CSSValueList::createSlashSeparated(
); |
| 1306 sizeAndLineHeight->append(valueForFontSize(style)); | 1306 sizeAndLineHeight->append(valueForFontSize(style)); |
| 1307 sizeAndLineHeight->append(valueForLineHeight(style)); | 1307 sizeAndLineHeight->append(valueForLineHeight(style)); |
| 1308 | 1308 |
| 1309 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 1309 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); |
| 1310 list->append(valueForFontStyle(style)); | 1310 list->append(valueForFontStyle(style)); |
| 1311 list->append(valueForFontVariant(style)); | 1311 list->append(valueForFontVariant(style)); |
| 1312 list->append(valueForFontWeight(style)); | 1312 list->append(valueForFontWeight(style)); |
| 1313 list->append(valueForFontStretch(style)); | 1313 list->append(valueForFontStretch(style)); |
| 1314 list->append(sizeAndLineHeight.release()); | 1314 list->append(sizeAndLineHeight.release()); |
| 1315 list->append(valueForFontFamily(style)); | 1315 list->append(valueForFontFamily(style)); |
| 1316 | 1316 |
| 1317 return list.release(); | 1317 return list.release(); |
| 1318 } | 1318 } |
| 1319 | 1319 |
| 1320 static PassRefPtrWillBeRawPtr<CSSValue> valueForScrollSnapDestination(const Leng
thPoint& destination, const ComputedStyle& style) | 1320 static RawPtr<CSSValue> valueForScrollSnapDestination(const LengthPoint& destina
tion, const ComputedStyle& style) |
| 1321 { | 1321 { |
| 1322 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 1322 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); |
| 1323 list->append(zoomAdjustedPixelValueForLength(destination.x(), style)); | 1323 list->append(zoomAdjustedPixelValueForLength(destination.x(), style)); |
| 1324 list->append(zoomAdjustedPixelValueForLength(destination.y(), style)); | 1324 list->append(zoomAdjustedPixelValueForLength(destination.y(), style)); |
| 1325 return list.release(); | 1325 return list.release(); |
| 1326 } | 1326 } |
| 1327 | 1327 |
| 1328 static PassRefPtrWillBeRawPtr<CSSValue> valueForScrollSnapPoints(const ScrollSna
pPoints& points, const ComputedStyle& style) | 1328 static RawPtr<CSSValue> valueForScrollSnapPoints(const ScrollSnapPoints& points,
const ComputedStyle& style) |
| 1329 { | 1329 { |
| 1330 if (points.hasRepeat) { | 1330 if (points.hasRepeat) { |
| 1331 RefPtrWillBeRawPtr<CSSFunctionValue> repeat = CSSFunctionValue::create(C
SSValueRepeat); | 1331 RawPtr<CSSFunctionValue> repeat = CSSFunctionValue::create(CSSValueRepea
t); |
| 1332 repeat->append(zoomAdjustedPixelValueForLength(points.repeatOffset, styl
e)); | 1332 repeat->append(zoomAdjustedPixelValueForLength(points.repeatOffset, styl
e)); |
| 1333 return repeat.release(); | 1333 return repeat.release(); |
| 1334 } | 1334 } |
| 1335 | 1335 |
| 1336 return cssValuePool().createIdentifierValue(CSSValueNone); | 1336 return cssValuePool().createIdentifierValue(CSSValueNone); |
| 1337 } | 1337 } |
| 1338 | 1338 |
| 1339 static PassRefPtrWillBeRawPtr<CSSValue> valueForScrollSnapCoordinate(const Vecto
r<LengthPoint>& coordinates, const ComputedStyle& style) | 1339 static RawPtr<CSSValue> valueForScrollSnapCoordinate(const Vector<LengthPoint>&
coordinates, const ComputedStyle& style) |
| 1340 { | 1340 { |
| 1341 if (coordinates.isEmpty()) | 1341 if (coordinates.isEmpty()) |
| 1342 return cssValuePool().createIdentifierValue(CSSValueNone); | 1342 return cssValuePool().createIdentifierValue(CSSValueNone); |
| 1343 | 1343 |
| 1344 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated()
; | 1344 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); |
| 1345 | 1345 |
| 1346 for (auto& coordinate : coordinates) { | 1346 for (auto& coordinate : coordinates) { |
| 1347 auto pair = CSSValueList::createSpaceSeparated(); | 1347 auto pair = CSSValueList::createSpaceSeparated(); |
| 1348 pair->append(zoomAdjustedPixelValueForLength(coordinate.x(), style)); | 1348 pair->append(zoomAdjustedPixelValueForLength(coordinate.x(), style)); |
| 1349 pair->append(zoomAdjustedPixelValueForLength(coordinate.y(), style)); | 1349 pair->append(zoomAdjustedPixelValueForLength(coordinate.y(), style)); |
| 1350 list->append(pair); | 1350 list->append(pair); |
| 1351 } | 1351 } |
| 1352 | 1352 |
| 1353 return list.release(); | 1353 return list.release(); |
| 1354 } | 1354 } |
| 1355 | 1355 |
| 1356 PassRefPtrWillBeRawPtr<CSSValue> ComputedStyleCSSValueMapping::get(const AtomicS
tring customPropertyName, const ComputedStyle& style) | 1356 RawPtr<CSSValue> ComputedStyleCSSValueMapping::get(const AtomicString customProp
ertyName, const ComputedStyle& style) |
| 1357 { | 1357 { |
| 1358 StyleVariableData* variables = style.variables(); | 1358 StyleVariableData* variables = style.variables(); |
| 1359 if (!variables) | 1359 if (!variables) |
| 1360 return nullptr; | 1360 return nullptr; |
| 1361 | 1361 |
| 1362 CSSVariableData* data = variables->getVariable(customPropertyName); | 1362 CSSVariableData* data = variables->getVariable(customPropertyName); |
| 1363 if (!data) | 1363 if (!data) |
| 1364 return nullptr; | 1364 return nullptr; |
| 1365 | 1365 |
| 1366 return CSSCustomPropertyDeclaration::create(customPropertyName, data); | 1366 return CSSCustomPropertyDeclaration::create(customPropertyName, data); |
| 1367 } | 1367 } |
| 1368 | 1368 |
| 1369 const HashMap<AtomicString, RefPtr<CSSVariableData>>* ComputedStyleCSSValueMappi
ng::getVariables(const ComputedStyle& style) | 1369 const HashMap<AtomicString, RefPtr<CSSVariableData>>* ComputedStyleCSSValueMappi
ng::getVariables(const ComputedStyle& style) |
| 1370 { | 1370 { |
| 1371 StyleVariableData* variables = style.variables(); | 1371 StyleVariableData* variables = style.variables(); |
| 1372 if (variables) | 1372 if (variables) |
| 1373 return variables->getVariables(); | 1373 return variables->getVariables(); |
| 1374 return nullptr; | 1374 return nullptr; |
| 1375 } | 1375 } |
| 1376 | 1376 |
| 1377 PassRefPtrWillBeRawPtr<CSSValue> ComputedStyleCSSValueMapping::get(CSSPropertyID
propertyID, const ComputedStyle& style, const LayoutObject* layoutObject, Node*
styledNode, bool allowVisitedStyle) | 1377 RawPtr<CSSValue> ComputedStyleCSSValueMapping::get(CSSPropertyID propertyID, con
st ComputedStyle& style, const LayoutObject* layoutObject, Node* styledNode, boo
l allowVisitedStyle) |
| 1378 { | 1378 { |
| 1379 const SVGComputedStyle& svgStyle = style.svgStyle(); | 1379 const SVGComputedStyle& svgStyle = style.svgStyle(); |
| 1380 propertyID = CSSProperty::resolveDirectionAwareProperty(propertyID, style.di
rection(), style.writingMode()); | 1380 propertyID = CSSProperty::resolveDirectionAwareProperty(propertyID, style.di
rection(), style.writingMode()); |
| 1381 switch (propertyID) { | 1381 switch (propertyID) { |
| 1382 case CSSPropertyInvalid: | 1382 case CSSPropertyInvalid: |
| 1383 return nullptr; | 1383 return nullptr; |
| 1384 | 1384 |
| 1385 case CSSPropertyBackgroundColor: | 1385 case CSSPropertyBackgroundColor: |
| 1386 return allowVisitedStyle ? cssValuePool().createColorValue(style.visited
DependentColor(CSSPropertyBackgroundColor).rgb()) : currentColorOrValidColor(sty
le, style.backgroundColor()); | 1386 return allowVisitedStyle ? cssValuePool().createColorValue(style.visited
DependentColor(CSSPropertyBackgroundColor).rgb()) : currentColorOrValidColor(sty
le, style.backgroundColor()); |
| 1387 case CSSPropertyBackgroundImage: | 1387 case CSSPropertyBackgroundImage: |
| 1388 case CSSPropertyWebkitMaskImage: { | 1388 case CSSPropertyWebkitMaskImage: { |
| 1389 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparat
ed(); | 1389 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); |
| 1390 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskImage ?
&style.maskLayers() : &style.backgroundLayers(); | 1390 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskImage ?
&style.maskLayers() : &style.backgroundLayers(); |
| 1391 for (; currLayer; currLayer = currLayer->next()) { | 1391 for (; currLayer; currLayer = currLayer->next()) { |
| 1392 if (currLayer->image()) | 1392 if (currLayer->image()) |
| 1393 list->append(currLayer->image()->computedCSSValue()); | 1393 list->append(currLayer->image()->computedCSSValue()); |
| 1394 else | 1394 else |
| 1395 list->append(cssValuePool().createIdentifierValue(CSSValueNone))
; | 1395 list->append(cssValuePool().createIdentifierValue(CSSValueNone))
; |
| 1396 } | 1396 } |
| 1397 return list.release(); | 1397 return list.release(); |
| 1398 } | 1398 } |
| 1399 case CSSPropertyBackgroundSize: | 1399 case CSSPropertyBackgroundSize: |
| 1400 case CSSPropertyWebkitMaskSize: { | 1400 case CSSPropertyWebkitMaskSize: { |
| 1401 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparat
ed(); | 1401 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); |
| 1402 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskSize ? &
style.maskLayers() : &style.backgroundLayers(); | 1402 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskSize ? &
style.maskLayers() : &style.backgroundLayers(); |
| 1403 for (; currLayer; currLayer = currLayer->next()) | 1403 for (; currLayer; currLayer = currLayer->next()) |
| 1404 list->append(valueForFillSize(currLayer->size(), style)); | 1404 list->append(valueForFillSize(currLayer->size(), style)); |
| 1405 return list.release(); | 1405 return list.release(); |
| 1406 } | 1406 } |
| 1407 case CSSPropertyBackgroundRepeat: | 1407 case CSSPropertyBackgroundRepeat: |
| 1408 case CSSPropertyWebkitMaskRepeat: { | 1408 case CSSPropertyWebkitMaskRepeat: { |
| 1409 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparat
ed(); | 1409 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); |
| 1410 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskRepeat ?
&style.maskLayers() : &style.backgroundLayers(); | 1410 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskRepeat ?
&style.maskLayers() : &style.backgroundLayers(); |
| 1411 for (; currLayer; currLayer = currLayer->next()) | 1411 for (; currLayer; currLayer = currLayer->next()) |
| 1412 list->append(valueForFillRepeat(currLayer->repeatX(), currLayer->rep
eatY())); | 1412 list->append(valueForFillRepeat(currLayer->repeatX(), currLayer->rep
eatY())); |
| 1413 return list.release(); | 1413 return list.release(); |
| 1414 } | 1414 } |
| 1415 case CSSPropertyMaskSourceType: { | 1415 case CSSPropertyMaskSourceType: { |
| 1416 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparat
ed(); | 1416 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); |
| 1417 for (const FillLayer* currLayer = &style.maskLayers(); currLayer; currLa
yer = currLayer->next()) | 1417 for (const FillLayer* currLayer = &style.maskLayers(); currLayer; currLa
yer = currLayer->next()) |
| 1418 list->append(valueForFillSourceType(currLayer->maskSourceType())); | 1418 list->append(valueForFillSourceType(currLayer->maskSourceType())); |
| 1419 return list.release(); | 1419 return list.release(); |
| 1420 } | 1420 } |
| 1421 case CSSPropertyWebkitBackgroundComposite: | 1421 case CSSPropertyWebkitBackgroundComposite: |
| 1422 case CSSPropertyWebkitMaskComposite: { | 1422 case CSSPropertyWebkitMaskComposite: { |
| 1423 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparat
ed(); | 1423 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); |
| 1424 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskComposit
e ? &style.maskLayers() : &style.backgroundLayers(); | 1424 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskComposit
e ? &style.maskLayers() : &style.backgroundLayers(); |
| 1425 for (; currLayer; currLayer = currLayer->next()) | 1425 for (; currLayer; currLayer = currLayer->next()) |
| 1426 list->append(cssValuePool().createValue(currLayer->composite())); | 1426 list->append(cssValuePool().createValue(currLayer->composite())); |
| 1427 return list.release(); | 1427 return list.release(); |
| 1428 } | 1428 } |
| 1429 case CSSPropertyBackgroundAttachment: { | 1429 case CSSPropertyBackgroundAttachment: { |
| 1430 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparat
ed(); | 1430 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); |
| 1431 for (const FillLayer* currLayer = &style.backgroundLayers(); currLayer;
currLayer = currLayer->next()) | 1431 for (const FillLayer* currLayer = &style.backgroundLayers(); currLayer;
currLayer = currLayer->next()) |
| 1432 list->append(cssValuePool().createValue(currLayer->attachment())); | 1432 list->append(cssValuePool().createValue(currLayer->attachment())); |
| 1433 return list.release(); | 1433 return list.release(); |
| 1434 } | 1434 } |
| 1435 case CSSPropertyBackgroundClip: | 1435 case CSSPropertyBackgroundClip: |
| 1436 case CSSPropertyBackgroundOrigin: | 1436 case CSSPropertyBackgroundOrigin: |
| 1437 case CSSPropertyWebkitBackgroundClip: | 1437 case CSSPropertyWebkitBackgroundClip: |
| 1438 case CSSPropertyWebkitBackgroundOrigin: | 1438 case CSSPropertyWebkitBackgroundOrigin: |
| 1439 case CSSPropertyWebkitMaskClip: | 1439 case CSSPropertyWebkitMaskClip: |
| 1440 case CSSPropertyWebkitMaskOrigin: { | 1440 case CSSPropertyWebkitMaskOrigin: { |
| 1441 bool isClip = propertyID == CSSPropertyBackgroundClip || propertyID == C
SSPropertyWebkitBackgroundClip || propertyID == CSSPropertyWebkitMaskClip; | 1441 bool isClip = propertyID == CSSPropertyBackgroundClip || propertyID == C
SSPropertyWebkitBackgroundClip || propertyID == CSSPropertyWebkitMaskClip; |
| 1442 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparat
ed(); | 1442 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); |
| 1443 const FillLayer* currLayer = (propertyID == CSSPropertyWebkitMaskClip ||
propertyID == CSSPropertyWebkitMaskOrigin) ? &style.maskLayers() : &style.backg
roundLayers(); | 1443 const FillLayer* currLayer = (propertyID == CSSPropertyWebkitMaskClip ||
propertyID == CSSPropertyWebkitMaskOrigin) ? &style.maskLayers() : &style.backg
roundLayers(); |
| 1444 for (; currLayer; currLayer = currLayer->next()) { | 1444 for (; currLayer; currLayer = currLayer->next()) { |
| 1445 EFillBox box = isClip ? currLayer->clip() : currLayer->origin(); | 1445 EFillBox box = isClip ? currLayer->clip() : currLayer->origin(); |
| 1446 list->append(cssValuePool().createValue(box)); | 1446 list->append(cssValuePool().createValue(box)); |
| 1447 } | 1447 } |
| 1448 return list.release(); | 1448 return list.release(); |
| 1449 } | 1449 } |
| 1450 case CSSPropertyBackgroundPosition: | 1450 case CSSPropertyBackgroundPosition: |
| 1451 case CSSPropertyWebkitMaskPosition: { | 1451 case CSSPropertyWebkitMaskPosition: { |
| 1452 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparat
ed(); | 1452 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); |
| 1453 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskPosition
? &style.maskLayers() : &style.backgroundLayers(); | 1453 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskPosition
? &style.maskLayers() : &style.backgroundLayers(); |
| 1454 for (; currLayer; currLayer = currLayer->next()) | 1454 for (; currLayer; currLayer = currLayer->next()) |
| 1455 list->append(createPositionListForLayer(propertyID, *currLayer, styl
e)); | 1455 list->append(createPositionListForLayer(propertyID, *currLayer, styl
e)); |
| 1456 return list.release(); | 1456 return list.release(); |
| 1457 } | 1457 } |
| 1458 case CSSPropertyBackgroundPositionX: | 1458 case CSSPropertyBackgroundPositionX: |
| 1459 case CSSPropertyWebkitMaskPositionX: { | 1459 case CSSPropertyWebkitMaskPositionX: { |
| 1460 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparat
ed(); | 1460 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); |
| 1461 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskPosition
X ? &style.maskLayers() : &style.backgroundLayers(); | 1461 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskPosition
X ? &style.maskLayers() : &style.backgroundLayers(); |
| 1462 for (; currLayer; currLayer = currLayer->next()) | 1462 for (; currLayer; currLayer = currLayer->next()) |
| 1463 list->append(zoomAdjustedPixelValueForLength(currLayer->xPosition(),
style)); | 1463 list->append(zoomAdjustedPixelValueForLength(currLayer->xPosition(),
style)); |
| 1464 return list.release(); | 1464 return list.release(); |
| 1465 } | 1465 } |
| 1466 case CSSPropertyBackgroundPositionY: | 1466 case CSSPropertyBackgroundPositionY: |
| 1467 case CSSPropertyWebkitMaskPositionY: { | 1467 case CSSPropertyWebkitMaskPositionY: { |
| 1468 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparat
ed(); | 1468 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); |
| 1469 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskPosition
Y ? &style.maskLayers() : &style.backgroundLayers(); | 1469 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskPosition
Y ? &style.maskLayers() : &style.backgroundLayers(); |
| 1470 for (; currLayer; currLayer = currLayer->next()) | 1470 for (; currLayer; currLayer = currLayer->next()) |
| 1471 list->append(zoomAdjustedPixelValueForLength(currLayer->yPosition(),
style)); | 1471 list->append(zoomAdjustedPixelValueForLength(currLayer->yPosition(),
style)); |
| 1472 return list.release(); | 1472 return list.release(); |
| 1473 } | 1473 } |
| 1474 case CSSPropertyBorderCollapse: | 1474 case CSSPropertyBorderCollapse: |
| 1475 if (style.borderCollapse()) | 1475 if (style.borderCollapse()) |
| 1476 return cssValuePool().createIdentifierValue(CSSValueCollapse); | 1476 return cssValuePool().createIdentifierValue(CSSValueCollapse); |
| 1477 return cssValuePool().createIdentifierValue(CSSValueSeparate); | 1477 return cssValuePool().createIdentifierValue(CSSValueSeparate); |
| 1478 case CSSPropertyBorderSpacing: { | 1478 case CSSPropertyBorderSpacing: { |
| 1479 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparat
ed(); | 1479 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); |
| 1480 list->append(zoomAdjustedPixelValue(style.horizontalBorderSpacing(), sty
le)); | 1480 list->append(zoomAdjustedPixelValue(style.horizontalBorderSpacing(), sty
le)); |
| 1481 list->append(zoomAdjustedPixelValue(style.verticalBorderSpacing(), style
)); | 1481 list->append(zoomAdjustedPixelValue(style.verticalBorderSpacing(), style
)); |
| 1482 return list.release(); | 1482 return list.release(); |
| 1483 } | 1483 } |
| 1484 case CSSPropertyWebkitBorderHorizontalSpacing: | 1484 case CSSPropertyWebkitBorderHorizontalSpacing: |
| 1485 return zoomAdjustedPixelValue(style.horizontalBorderSpacing(), style); | 1485 return zoomAdjustedPixelValue(style.horizontalBorderSpacing(), style); |
| 1486 case CSSPropertyWebkitBorderVerticalSpacing: | 1486 case CSSPropertyWebkitBorderVerticalSpacing: |
| 1487 return zoomAdjustedPixelValue(style.verticalBorderSpacing(), style); | 1487 return zoomAdjustedPixelValue(style.verticalBorderSpacing(), style); |
| 1488 case CSSPropertyBorderImageSource: | 1488 case CSSPropertyBorderImageSource: |
| 1489 if (style.borderImageSource()) | 1489 if (style.borderImageSource()) |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1573 case CSSPropertyWebkitColumnBreakInside: | 1573 case CSSPropertyWebkitColumnBreakInside: |
| 1574 return cssValuePool().createValue(style.columnBreakInside()); | 1574 return cssValuePool().createValue(style.columnBreakInside()); |
| 1575 case CSSPropertyWebkitColumnWidth: | 1575 case CSSPropertyWebkitColumnWidth: |
| 1576 if (style.hasAutoColumnWidth()) | 1576 if (style.hasAutoColumnWidth()) |
| 1577 return cssValuePool().createIdentifierValue(CSSValueAuto); | 1577 return cssValuePool().createIdentifierValue(CSSValueAuto); |
| 1578 return zoomAdjustedPixelValue(style.columnWidth(), style); | 1578 return zoomAdjustedPixelValue(style.columnWidth(), style); |
| 1579 case CSSPropertyTabSize: | 1579 case CSSPropertyTabSize: |
| 1580 return cssValuePool().createValue( | 1580 return cssValuePool().createValue( |
| 1581 style.tabSize().getPixelSize(1.0), style.tabSize().isSpaces() ? CSSP
rimitiveValue::UnitType::Number : CSSPrimitiveValue::UnitType::Pixels); | 1581 style.tabSize().getPixelSize(1.0), style.tabSize().isSpaces() ? CSSP
rimitiveValue::UnitType::Number : CSSPrimitiveValue::UnitType::Pixels); |
| 1582 case CSSPropertyCursor: { | 1582 case CSSPropertyCursor: { |
| 1583 RefPtrWillBeRawPtr<CSSValueList> list = nullptr; | 1583 RawPtr<CSSValueList> list = nullptr; |
| 1584 CursorList* cursors = style.cursors(); | 1584 CursorList* cursors = style.cursors(); |
| 1585 if (cursors && cursors->size() > 0) { | 1585 if (cursors && cursors->size() > 0) { |
| 1586 list = CSSValueList::createCommaSeparated(); | 1586 list = CSSValueList::createCommaSeparated(); |
| 1587 for (unsigned i = 0; i < cursors->size(); ++i) { | 1587 for (unsigned i = 0; i < cursors->size(); ++i) { |
| 1588 if (StyleImage* image = cursors->at(i).image()) | 1588 if (StyleImage* image = cursors->at(i).image()) |
| 1589 list->append(image->computedCSSValue()); | 1589 list->append(image->computedCSSValue()); |
| 1590 } | 1590 } |
| 1591 } | 1591 } |
| 1592 RefPtrWillBeRawPtr<CSSValue> value = cssValuePool().createValue(style.cu
rsor()); | 1592 RawPtr<CSSValue> value = cssValuePool().createValue(style.cursor()); |
| 1593 if (list) { | 1593 if (list) { |
| 1594 list->append(value.release()); | 1594 list->append(value.release()); |
| 1595 return list.release(); | 1595 return list.release(); |
| 1596 } | 1596 } |
| 1597 return value.release(); | 1597 return value.release(); |
| 1598 } | 1598 } |
| 1599 case CSSPropertyDirection: | 1599 case CSSPropertyDirection: |
| 1600 return cssValuePool().createValue(style.direction()); | 1600 return cssValuePool().createValue(style.direction()); |
| 1601 case CSSPropertyDisplay: | 1601 case CSSPropertyDisplay: |
| 1602 return cssValuePool().createValue(style.display()); | 1602 return cssValuePool().createValue(style.display()); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1652 case CSSPropertyFontStyle: | 1652 case CSSPropertyFontStyle: |
| 1653 return valueForFontStyle(style); | 1653 return valueForFontStyle(style); |
| 1654 case CSSPropertyFontVariant: | 1654 case CSSPropertyFontVariant: |
| 1655 return valueForFontVariant(style); | 1655 return valueForFontVariant(style); |
| 1656 case CSSPropertyFontWeight: | 1656 case CSSPropertyFontWeight: |
| 1657 return valueForFontWeight(style); | 1657 return valueForFontWeight(style); |
| 1658 case CSSPropertyFontFeatureSettings: { | 1658 case CSSPropertyFontFeatureSettings: { |
| 1659 const FontFeatureSettings* featureSettings = style.fontDescription().fea
tureSettings(); | 1659 const FontFeatureSettings* featureSettings = style.fontDescription().fea
tureSettings(); |
| 1660 if (!featureSettings || !featureSettings->size()) | 1660 if (!featureSettings || !featureSettings->size()) |
| 1661 return cssValuePool().createIdentifierValue(CSSValueNormal); | 1661 return cssValuePool().createIdentifierValue(CSSValueNormal); |
| 1662 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparat
ed(); | 1662 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); |
| 1663 for (unsigned i = 0; i < featureSettings->size(); ++i) { | 1663 for (unsigned i = 0; i < featureSettings->size(); ++i) { |
| 1664 const FontFeature& feature = featureSettings->at(i); | 1664 const FontFeature& feature = featureSettings->at(i); |
| 1665 RefPtrWillBeRawPtr<CSSFontFeatureValue> featureValue = CSSFontFeatur
eValue::create(feature.tag(), feature.value()); | 1665 RawPtr<CSSFontFeatureValue> featureValue = CSSFontFeatureValue::crea
te(feature.tag(), feature.value()); |
| 1666 list->append(featureValue.release()); | 1666 list->append(featureValue.release()); |
| 1667 } | 1667 } |
| 1668 return list.release(); | 1668 return list.release(); |
| 1669 } | 1669 } |
| 1670 case CSSPropertyGridAutoFlow: { | 1670 case CSSPropertyGridAutoFlow: { |
| 1671 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparat
ed(); | 1671 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); |
| 1672 switch (style.gridAutoFlow()) { | 1672 switch (style.gridAutoFlow()) { |
| 1673 case AutoFlowRow: | 1673 case AutoFlowRow: |
| 1674 case AutoFlowRowDense: | 1674 case AutoFlowRowDense: |
| 1675 list->append(cssValuePool().createIdentifierValue(CSSValueRow)); | 1675 list->append(cssValuePool().createIdentifierValue(CSSValueRow)); |
| 1676 break; | 1676 break; |
| 1677 case AutoFlowColumn: | 1677 case AutoFlowColumn: |
| 1678 case AutoFlowColumnDense: | 1678 case AutoFlowColumnDense: |
| 1679 list->append(cssValuePool().createIdentifierValue(CSSValueColumn)); | 1679 list->append(cssValuePool().createIdentifierValue(CSSValueColumn)); |
| 1680 break; | 1680 break; |
| 1681 default: | 1681 default: |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1926 return cssValuePool().createValue(style.pageBreakInside()); | 1926 return cssValuePool().createValue(style.pageBreakInside()); |
| 1927 } | 1927 } |
| 1928 case CSSPropertyPosition: | 1928 case CSSPropertyPosition: |
| 1929 return cssValuePool().createValue(style.position()); | 1929 return cssValuePool().createValue(style.position()); |
| 1930 case CSSPropertyQuotes: | 1930 case CSSPropertyQuotes: |
| 1931 if (!style.quotes()) { | 1931 if (!style.quotes()) { |
| 1932 // TODO(ramya.v): We should return the quote values that we're actua
lly using. | 1932 // TODO(ramya.v): We should return the quote values that we're actua
lly using. |
| 1933 return nullptr; | 1933 return nullptr; |
| 1934 } | 1934 } |
| 1935 if (style.quotes()->size()) { | 1935 if (style.quotes()->size()) { |
| 1936 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSep
arated(); | 1936 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); |
| 1937 for (int i = 0; i < style.quotes()->size(); i++) { | 1937 for (int i = 0; i < style.quotes()->size(); i++) { |
| 1938 list->append(CSSStringValue::create(style.quotes()->getOpenQuote
(i))); | 1938 list->append(CSSStringValue::create(style.quotes()->getOpenQuote
(i))); |
| 1939 list->append(CSSStringValue::create(style.quotes()->getCloseQuot
e(i))); | 1939 list->append(CSSStringValue::create(style.quotes()->getCloseQuot
e(i))); |
| 1940 } | 1940 } |
| 1941 return list.release(); | 1941 return list.release(); |
| 1942 } | 1942 } |
| 1943 return cssValuePool().createIdentifierValue(CSSValueNone); | 1943 return cssValuePool().createIdentifierValue(CSSValueNone); |
| 1944 case CSSPropertyRight: | 1944 case CSSPropertyRight: |
| 1945 return valueForPositionOffset(style, CSSPropertyRight, layoutObject); | 1945 return valueForPositionOffset(style, CSSPropertyRight, layoutObject); |
| 1946 case CSSPropertyWebkitRubyPosition: | 1946 case CSSPropertyWebkitRubyPosition: |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1982 case TextEmphasisMarkCustom: | 1982 case TextEmphasisMarkCustom: |
| 1983 return CSSStringValue::create(style.textEmphasisCustomMark()); | 1983 return CSSStringValue::create(style.textEmphasisCustomMark()); |
| 1984 case TextEmphasisMarkAuto: | 1984 case TextEmphasisMarkAuto: |
| 1985 ASSERT_NOT_REACHED(); | 1985 ASSERT_NOT_REACHED(); |
| 1986 // Fall through | 1986 // Fall through |
| 1987 case TextEmphasisMarkDot: | 1987 case TextEmphasisMarkDot: |
| 1988 case TextEmphasisMarkCircle: | 1988 case TextEmphasisMarkCircle: |
| 1989 case TextEmphasisMarkDoubleCircle: | 1989 case TextEmphasisMarkDoubleCircle: |
| 1990 case TextEmphasisMarkTriangle: | 1990 case TextEmphasisMarkTriangle: |
| 1991 case TextEmphasisMarkSesame: { | 1991 case TextEmphasisMarkSesame: { |
| 1992 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSep
arated(); | 1992 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); |
| 1993 list->append(cssValuePool().createValue(style.textEmphasisFill())); | 1993 list->append(cssValuePool().createValue(style.textEmphasisFill())); |
| 1994 list->append(cssValuePool().createValue(style.textEmphasisMark())); | 1994 list->append(cssValuePool().createValue(style.textEmphasisMark())); |
| 1995 return list.release(); | 1995 return list.release(); |
| 1996 } | 1996 } |
| 1997 } | 1997 } |
| 1998 case CSSPropertyTextIndent: { | 1998 case CSSPropertyTextIndent: { |
| 1999 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparat
ed(); | 1999 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); |
| 2000 list->append(zoomAdjustedPixelValueForLength(style.textIndent(), style))
; | 2000 list->append(zoomAdjustedPixelValueForLength(style.textIndent(), style))
; |
| 2001 if (RuntimeEnabledFeatures::css3TextEnabled() && (style.textIndentLine()
== TextIndentEachLine || style.textIndentType() == TextIndentHanging)) { | 2001 if (RuntimeEnabledFeatures::css3TextEnabled() && (style.textIndentLine()
== TextIndentEachLine || style.textIndentType() == TextIndentHanging)) { |
| 2002 if (style.textIndentLine() == TextIndentEachLine) | 2002 if (style.textIndentLine() == TextIndentEachLine) |
| 2003 list->append(cssValuePool().createIdentifierValue(CSSValueEachLi
ne)); | 2003 list->append(cssValuePool().createIdentifierValue(CSSValueEachLi
ne)); |
| 2004 if (style.textIndentType() == TextIndentHanging) | 2004 if (style.textIndentType() == TextIndentHanging) |
| 2005 list->append(cssValuePool().createIdentifierValue(CSSValueHangin
g)); | 2005 list->append(cssValuePool().createIdentifierValue(CSSValueHangin
g)); |
| 2006 } | 2006 } |
| 2007 return list.release(); | 2007 return list.release(); |
| 2008 } | 2008 } |
| 2009 case CSSPropertyTextShadow: | 2009 case CSSPropertyTextShadow: |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2086 return cssValuePool().createValue(style.fontDescription().fontSmoothing(
)); | 2086 return cssValuePool().createValue(style.fontDescription().fontSmoothing(
)); |
| 2087 case CSSPropertyFontVariantLigatures: { | 2087 case CSSPropertyFontVariantLigatures: { |
| 2088 FontDescription::LigaturesState commonLigaturesState = style.fontDescrip
tion().commonLigaturesState(); | 2088 FontDescription::LigaturesState commonLigaturesState = style.fontDescrip
tion().commonLigaturesState(); |
| 2089 FontDescription::LigaturesState discretionaryLigaturesState = style.font
Description().discretionaryLigaturesState(); | 2089 FontDescription::LigaturesState discretionaryLigaturesState = style.font
Description().discretionaryLigaturesState(); |
| 2090 FontDescription::LigaturesState historicalLigaturesState = style.fontDes
cription().historicalLigaturesState(); | 2090 FontDescription::LigaturesState historicalLigaturesState = style.fontDes
cription().historicalLigaturesState(); |
| 2091 FontDescription::LigaturesState contextualLigaturesState = style.fontDes
cription().contextualLigaturesState(); | 2091 FontDescription::LigaturesState contextualLigaturesState = style.fontDes
cription().contextualLigaturesState(); |
| 2092 if (commonLigaturesState == FontDescription::NormalLigaturesState && dis
cretionaryLigaturesState == FontDescription::NormalLigaturesState | 2092 if (commonLigaturesState == FontDescription::NormalLigaturesState && dis
cretionaryLigaturesState == FontDescription::NormalLigaturesState |
| 2093 && historicalLigaturesState == FontDescription::NormalLigaturesState
&& contextualLigaturesState == FontDescription::NormalLigaturesState) | 2093 && historicalLigaturesState == FontDescription::NormalLigaturesState
&& contextualLigaturesState == FontDescription::NormalLigaturesState) |
| 2094 return cssValuePool().createIdentifierValue(CSSValueNormal); | 2094 return cssValuePool().createIdentifierValue(CSSValueNormal); |
| 2095 | 2095 |
| 2096 RefPtrWillBeRawPtr<CSSValueList> valueList = CSSValueList::createSpaceSe
parated(); | 2096 RawPtr<CSSValueList> valueList = CSSValueList::createSpaceSeparated(); |
| 2097 if (commonLigaturesState != FontDescription::NormalLigaturesState) | 2097 if (commonLigaturesState != FontDescription::NormalLigaturesState) |
| 2098 valueList->append(cssValuePool().createIdentifierValue(commonLigatur
esState == FontDescription::DisabledLigaturesState ? CSSValueNoCommonLigatures :
CSSValueCommonLigatures)); | 2098 valueList->append(cssValuePool().createIdentifierValue(commonLigatur
esState == FontDescription::DisabledLigaturesState ? CSSValueNoCommonLigatures :
CSSValueCommonLigatures)); |
| 2099 if (discretionaryLigaturesState != FontDescription::NormalLigaturesState
) | 2099 if (discretionaryLigaturesState != FontDescription::NormalLigaturesState
) |
| 2100 valueList->append(cssValuePool().createIdentifierValue(discretionary
LigaturesState == FontDescription::DisabledLigaturesState ? CSSValueNoDiscretion
aryLigatures : CSSValueDiscretionaryLigatures)); | 2100 valueList->append(cssValuePool().createIdentifierValue(discretionary
LigaturesState == FontDescription::DisabledLigaturesState ? CSSValueNoDiscretion
aryLigatures : CSSValueDiscretionaryLigatures)); |
| 2101 if (historicalLigaturesState != FontDescription::NormalLigaturesState) | 2101 if (historicalLigaturesState != FontDescription::NormalLigaturesState) |
| 2102 valueList->append(cssValuePool().createIdentifierValue(historicalLig
aturesState == FontDescription::DisabledLigaturesState ? CSSValueNoHistoricalLig
atures : CSSValueHistoricalLigatures)); | 2102 valueList->append(cssValuePool().createIdentifierValue(historicalLig
aturesState == FontDescription::DisabledLigaturesState ? CSSValueNoHistoricalLig
atures : CSSValueHistoricalLigatures)); |
| 2103 if (contextualLigaturesState != FontDescription::NormalLigaturesState) | 2103 if (contextualLigaturesState != FontDescription::NormalLigaturesState) |
| 2104 valueList->append(cssValuePool().createIdentifierValue(contextualLig
aturesState == FontDescription::DisabledLigaturesState ? CSSValueNoContextual :
CSSValueContextual)); | 2104 valueList->append(cssValuePool().createIdentifierValue(contextualLig
aturesState == FontDescription::DisabledLigaturesState ? CSSValueNoContextual :
CSSValueContextual)); |
| 2105 return valueList; | 2105 return valueList; |
| 2106 } | 2106 } |
| 2107 case CSSPropertyZIndex: | 2107 case CSSPropertyZIndex: |
| 2108 if (style.hasAutoZIndex()) | 2108 if (style.hasAutoZIndex()) |
| 2109 return cssValuePool().createIdentifierValue(CSSValueAuto); | 2109 return cssValuePool().createIdentifierValue(CSSValueAuto); |
| 2110 return cssValuePool().createValue(style.zIndex(), CSSPrimitiveValue::Uni
tType::Integer); | 2110 return cssValuePool().createValue(style.zIndex(), CSSPrimitiveValue::Uni
tType::Integer); |
| 2111 case CSSPropertyZoom: | 2111 case CSSPropertyZoom: |
| 2112 return cssValuePool().createValue(style.zoom(), CSSPrimitiveValue::UnitT
ype::Number); | 2112 return cssValuePool().createValue(style.zoom(), CSSPrimitiveValue::UnitT
ype::Number); |
| 2113 case CSSPropertyBoxSizing: | 2113 case CSSPropertyBoxSizing: |
| 2114 if (style.boxSizing() == CONTENT_BOX) | 2114 if (style.boxSizing() == CONTENT_BOX) |
| 2115 return cssValuePool().createIdentifierValue(CSSValueContentBox); | 2115 return cssValuePool().createIdentifierValue(CSSValueContentBox); |
| 2116 return cssValuePool().createIdentifierValue(CSSValueBorderBox); | 2116 return cssValuePool().createIdentifierValue(CSSValueBorderBox); |
| 2117 case CSSPropertyWebkitAppRegion: | 2117 case CSSPropertyWebkitAppRegion: |
| 2118 return cssValuePool().createIdentifierValue(style.getDraggableRegionMode
() == DraggableRegionDrag ? CSSValueDrag : CSSValueNoDrag); | 2118 return cssValuePool().createIdentifierValue(style.getDraggableRegionMode
() == DraggableRegionDrag ? CSSValueDrag : CSSValueNoDrag); |
| 2119 case CSSPropertyAnimationDelay: | 2119 case CSSPropertyAnimationDelay: |
| 2120 return valueForAnimationDelay(style.animations()); | 2120 return valueForAnimationDelay(style.animations()); |
| 2121 case CSSPropertyAnimationDirection: { | 2121 case CSSPropertyAnimationDirection: { |
| 2122 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparat
ed(); | 2122 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); |
| 2123 const CSSAnimationData* animationData = style.animations(); | 2123 const CSSAnimationData* animationData = style.animations(); |
| 2124 if (animationData) { | 2124 if (animationData) { |
| 2125 for (size_t i = 0; i < animationData->directionList().size(); ++i) | 2125 for (size_t i = 0; i < animationData->directionList().size(); ++i) |
| 2126 list->append(valueForAnimationDirection(animationData->direction
List()[i])); | 2126 list->append(valueForAnimationDirection(animationData->direction
List()[i])); |
| 2127 } else { | 2127 } else { |
| 2128 list->append(cssValuePool().createIdentifierValue(CSSValueNormal)); | 2128 list->append(cssValuePool().createIdentifierValue(CSSValueNormal)); |
| 2129 } | 2129 } |
| 2130 return list.release(); | 2130 return list.release(); |
| 2131 } | 2131 } |
| 2132 case CSSPropertyAnimationDuration: | 2132 case CSSPropertyAnimationDuration: |
| 2133 return valueForAnimationDuration(style.animations()); | 2133 return valueForAnimationDuration(style.animations()); |
| 2134 case CSSPropertyAnimationFillMode: { | 2134 case CSSPropertyAnimationFillMode: { |
| 2135 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparat
ed(); | 2135 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); |
| 2136 const CSSAnimationData* animationData = style.animations(); | 2136 const CSSAnimationData* animationData = style.animations(); |
| 2137 if (animationData) { | 2137 if (animationData) { |
| 2138 for (size_t i = 0; i < animationData->fillModeList().size(); ++i) | 2138 for (size_t i = 0; i < animationData->fillModeList().size(); ++i) |
| 2139 list->append(valueForAnimationFillMode(animationData->fillModeLi
st()[i])); | 2139 list->append(valueForAnimationFillMode(animationData->fillModeLi
st()[i])); |
| 2140 } else { | 2140 } else { |
| 2141 list->append(cssValuePool().createIdentifierValue(CSSValueNone)); | 2141 list->append(cssValuePool().createIdentifierValue(CSSValueNone)); |
| 2142 } | 2142 } |
| 2143 return list.release(); | 2143 return list.release(); |
| 2144 } | 2144 } |
| 2145 case CSSPropertyAnimationIterationCount: { | 2145 case CSSPropertyAnimationIterationCount: { |
| 2146 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparat
ed(); | 2146 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); |
| 2147 const CSSAnimationData* animationData = style.animations(); | 2147 const CSSAnimationData* animationData = style.animations(); |
| 2148 if (animationData) { | 2148 if (animationData) { |
| 2149 for (size_t i = 0; i < animationData->iterationCountList().size(); +
+i) | 2149 for (size_t i = 0; i < animationData->iterationCountList().size(); +
+i) |
| 2150 list->append(valueForAnimationIterationCount(animationData->iter
ationCountList()[i])); | 2150 list->append(valueForAnimationIterationCount(animationData->iter
ationCountList()[i])); |
| 2151 } else { | 2151 } else { |
| 2152 list->append(cssValuePool().createValue(CSSAnimationData::initialIte
rationCount(), CSSPrimitiveValue::UnitType::Number)); | 2152 list->append(cssValuePool().createValue(CSSAnimationData::initialIte
rationCount(), CSSPrimitiveValue::UnitType::Number)); |
| 2153 } | 2153 } |
| 2154 return list.release(); | 2154 return list.release(); |
| 2155 } | 2155 } |
| 2156 case CSSPropertyAnimationName: { | 2156 case CSSPropertyAnimationName: { |
| 2157 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparat
ed(); | 2157 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); |
| 2158 const CSSAnimationData* animationData = style.animations(); | 2158 const CSSAnimationData* animationData = style.animations(); |
| 2159 if (animationData) { | 2159 if (animationData) { |
| 2160 for (size_t i = 0; i < animationData->nameList().size(); ++i) | 2160 for (size_t i = 0; i < animationData->nameList().size(); ++i) |
| 2161 list->append(CSSCustomIdentValue::create(animationData->nameList
()[i])); | 2161 list->append(CSSCustomIdentValue::create(animationData->nameList
()[i])); |
| 2162 } else { | 2162 } else { |
| 2163 list->append(cssValuePool().createIdentifierValue(CSSValueNone)); | 2163 list->append(cssValuePool().createIdentifierValue(CSSValueNone)); |
| 2164 } | 2164 } |
| 2165 return list.release(); | 2165 return list.release(); |
| 2166 } | 2166 } |
| 2167 case CSSPropertyAnimationPlayState: { | 2167 case CSSPropertyAnimationPlayState: { |
| 2168 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparat
ed(); | 2168 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); |
| 2169 const CSSAnimationData* animationData = style.animations(); | 2169 const CSSAnimationData* animationData = style.animations(); |
| 2170 if (animationData) { | 2170 if (animationData) { |
| 2171 for (size_t i = 0; i < animationData->playStateList().size(); ++i) | 2171 for (size_t i = 0; i < animationData->playStateList().size(); ++i) |
| 2172 list->append(valueForAnimationPlayState(animationData->playState
List()[i])); | 2172 list->append(valueForAnimationPlayState(animationData->playState
List()[i])); |
| 2173 } else { | 2173 } else { |
| 2174 list->append(cssValuePool().createIdentifierValue(CSSValueRunning)); | 2174 list->append(cssValuePool().createIdentifierValue(CSSValueRunning)); |
| 2175 } | 2175 } |
| 2176 return list.release(); | 2176 return list.release(); |
| 2177 } | 2177 } |
| 2178 case CSSPropertyAnimationTimingFunction: | 2178 case CSSPropertyAnimationTimingFunction: |
| 2179 return valueForAnimationTimingFunction(style.animations()); | 2179 return valueForAnimationTimingFunction(style.animations()); |
| 2180 case CSSPropertyAnimation: { | 2180 case CSSPropertyAnimation: { |
| 2181 const CSSAnimationData* animationData = style.animations(); | 2181 const CSSAnimationData* animationData = style.animations(); |
| 2182 if (animationData) { | 2182 if (animationData) { |
| 2183 RefPtrWillBeRawPtr<CSSValueList> animationsList = CSSValueList::crea
teCommaSeparated(); | 2183 RawPtr<CSSValueList> animationsList = CSSValueList::createCommaSepar
ated(); |
| 2184 for (size_t i = 0; i < animationData->nameList().size(); ++i) { | 2184 for (size_t i = 0; i < animationData->nameList().size(); ++i) { |
| 2185 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpac
eSeparated(); | 2185 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; |
| 2186 list->append(CSSCustomIdentValue::create(animationData->nameList
()[i])); | 2186 list->append(CSSCustomIdentValue::create(animationData->nameList
()[i])); |
| 2187 list->append(cssValuePool().createValue(CSSTimingData::getRepeat
ed(animationData->durationList(), i), CSSPrimitiveValue::UnitType::Seconds)); | 2187 list->append(cssValuePool().createValue(CSSTimingData::getRepeat
ed(animationData->durationList(), i), CSSPrimitiveValue::UnitType::Seconds)); |
| 2188 list->append(createTimingFunctionValue(CSSTimingData::getRepeate
d(animationData->timingFunctionList(), i).get())); | 2188 list->append(createTimingFunctionValue(CSSTimingData::getRepeate
d(animationData->timingFunctionList(), i).get())); |
| 2189 list->append(cssValuePool().createValue(CSSTimingData::getRepeat
ed(animationData->delayList(), i), CSSPrimitiveValue::UnitType::Seconds)); | 2189 list->append(cssValuePool().createValue(CSSTimingData::getRepeat
ed(animationData->delayList(), i), CSSPrimitiveValue::UnitType::Seconds)); |
| 2190 list->append(valueForAnimationIterationCount(CSSTimingData::getR
epeated(animationData->iterationCountList(), i))); | 2190 list->append(valueForAnimationIterationCount(CSSTimingData::getR
epeated(animationData->iterationCountList(), i))); |
| 2191 list->append(valueForAnimationDirection(CSSTimingData::getRepeat
ed(animationData->directionList(), i))); | 2191 list->append(valueForAnimationDirection(CSSTimingData::getRepeat
ed(animationData->directionList(), i))); |
| 2192 list->append(valueForAnimationFillMode(CSSTimingData::getRepeate
d(animationData->fillModeList(), i))); | 2192 list->append(valueForAnimationFillMode(CSSTimingData::getRepeate
d(animationData->fillModeList(), i))); |
| 2193 list->append(valueForAnimationPlayState(CSSTimingData::getRepeat
ed(animationData->playStateList(), i))); | 2193 list->append(valueForAnimationPlayState(CSSTimingData::getRepeat
ed(animationData->playStateList(), i))); |
| 2194 animationsList->append(list); | 2194 animationsList->append(list); |
| 2195 } | 2195 } |
| 2196 return animationsList.release(); | 2196 return animationsList.release(); |
| 2197 } | 2197 } |
| 2198 | 2198 |
| 2199 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparat
ed(); | 2199 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); |
| 2200 // animation-name default value. | 2200 // animation-name default value. |
| 2201 list->append(cssValuePool().createIdentifierValue(CSSValueNone)); | 2201 list->append(cssValuePool().createIdentifierValue(CSSValueNone)); |
| 2202 list->append(cssValuePool().createValue(CSSAnimationData::initialDuratio
n(), CSSPrimitiveValue::UnitType::Seconds)); | 2202 list->append(cssValuePool().createValue(CSSAnimationData::initialDuratio
n(), CSSPrimitiveValue::UnitType::Seconds)); |
| 2203 list->append(createTimingFunctionValue(CSSAnimationData::initialTimingFu
nction().get())); | 2203 list->append(createTimingFunctionValue(CSSAnimationData::initialTimingFu
nction().get())); |
| 2204 list->append(cssValuePool().createValue(CSSAnimationData::initialDelay()
, CSSPrimitiveValue::UnitType::Seconds)); | 2204 list->append(cssValuePool().createValue(CSSAnimationData::initialDelay()
, CSSPrimitiveValue::UnitType::Seconds)); |
| 2205 list->append(cssValuePool().createValue(CSSAnimationData::initialIterati
onCount(), CSSPrimitiveValue::UnitType::Number)); | 2205 list->append(cssValuePool().createValue(CSSAnimationData::initialIterati
onCount(), CSSPrimitiveValue::UnitType::Number)); |
| 2206 list->append(valueForAnimationDirection(CSSAnimationData::initialDirecti
on())); | 2206 list->append(valueForAnimationDirection(CSSAnimationData::initialDirecti
on())); |
| 2207 list->append(valueForAnimationFillMode(CSSAnimationData::initialFillMode
())); | 2207 list->append(valueForAnimationFillMode(CSSAnimationData::initialFillMode
())); |
| 2208 // Initial animation-play-state. | 2208 // Initial animation-play-state. |
| 2209 list->append(cssValuePool().createIdentifierValue(CSSValueRunning)); | 2209 list->append(cssValuePool().createIdentifierValue(CSSValueRunning)); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2244 case CSSPropertyWebkitMarginAfterCollapse: | 2244 case CSSPropertyWebkitMarginAfterCollapse: |
| 2245 return cssValuePool().createValue(style.marginAfterCollapse()); | 2245 return cssValuePool().createValue(style.marginAfterCollapse()); |
| 2246 case CSSPropertyWebkitMarginTopCollapse: | 2246 case CSSPropertyWebkitMarginTopCollapse: |
| 2247 case CSSPropertyWebkitMarginBeforeCollapse: | 2247 case CSSPropertyWebkitMarginBeforeCollapse: |
| 2248 return cssValuePool().createValue(style.marginBeforeCollapse()); | 2248 return cssValuePool().createValue(style.marginBeforeCollapse()); |
| 2249 case CSSPropertyPerspective: | 2249 case CSSPropertyPerspective: |
| 2250 if (!style.hasPerspective()) | 2250 if (!style.hasPerspective()) |
| 2251 return cssValuePool().createIdentifierValue(CSSValueNone); | 2251 return cssValuePool().createIdentifierValue(CSSValueNone); |
| 2252 return zoomAdjustedPixelValue(style.perspective(), style); | 2252 return zoomAdjustedPixelValue(style.perspective(), style); |
| 2253 case CSSPropertyPerspectiveOrigin: { | 2253 case CSSPropertyPerspectiveOrigin: { |
| 2254 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparat
ed(); | 2254 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); |
| 2255 if (layoutObject) { | 2255 if (layoutObject) { |
| 2256 LayoutRect box; | 2256 LayoutRect box; |
| 2257 if (layoutObject->isBox()) | 2257 if (layoutObject->isBox()) |
| 2258 box = toLayoutBox(layoutObject)->borderBoxRect(); | 2258 box = toLayoutBox(layoutObject)->borderBoxRect(); |
| 2259 | 2259 |
| 2260 list->append(zoomAdjustedPixelValue(minimumValueForLength(style.pers
pectiveOriginX(), box.width()), style)); | 2260 list->append(zoomAdjustedPixelValue(minimumValueForLength(style.pers
pectiveOriginX(), box.width()), style)); |
| 2261 list->append(zoomAdjustedPixelValue(minimumValueForLength(style.pers
pectiveOriginY(), box.height()), style)); | 2261 list->append(zoomAdjustedPixelValue(minimumValueForLength(style.pers
pectiveOriginY(), box.height()), style)); |
| 2262 } else { | 2262 } else { |
| 2263 list->append(zoomAdjustedPixelValueForLength(style.perspectiveOrigin
X(), style)); | 2263 list->append(zoomAdjustedPixelValueForLength(style.perspectiveOrigin
X(), style)); |
| 2264 list->append(zoomAdjustedPixelValueForLength(style.perspectiveOrigin
Y(), style)); | 2264 list->append(zoomAdjustedPixelValueForLength(style.perspectiveOrigin
Y(), style)); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 2277 return valueForBorderRadiusCorner(style.borderBottomLeftRadius(), style)
; | 2277 return valueForBorderRadiusCorner(style.borderBottomLeftRadius(), style)
; |
| 2278 case CSSPropertyBorderBottomRightRadius: | 2278 case CSSPropertyBorderBottomRightRadius: |
| 2279 return valueForBorderRadiusCorner(style.borderBottomRightRadius(), style
); | 2279 return valueForBorderRadiusCorner(style.borderBottomRightRadius(), style
); |
| 2280 case CSSPropertyBorderTopLeftRadius: | 2280 case CSSPropertyBorderTopLeftRadius: |
| 2281 return valueForBorderRadiusCorner(style.borderTopLeftRadius(), style); | 2281 return valueForBorderRadiusCorner(style.borderTopLeftRadius(), style); |
| 2282 case CSSPropertyBorderTopRightRadius: | 2282 case CSSPropertyBorderTopRightRadius: |
| 2283 return valueForBorderRadiusCorner(style.borderTopRightRadius(), style); | 2283 return valueForBorderRadiusCorner(style.borderTopRightRadius(), style); |
| 2284 case CSSPropertyClip: { | 2284 case CSSPropertyClip: { |
| 2285 if (style.hasAutoClip()) | 2285 if (style.hasAutoClip()) |
| 2286 return cssValuePool().createIdentifierValue(CSSValueAuto); | 2286 return cssValuePool().createIdentifierValue(CSSValueAuto); |
| 2287 RefPtrWillBeRawPtr<CSSPrimitiveValue> top = style.clip().top().isAuto() | 2287 RawPtr<CSSPrimitiveValue> top = style.clip().top().isAuto() |
| 2288 ? cssValuePool().createIdentifierValue(CSSValueAuto) | 2288 ? cssValuePool().createIdentifierValue(CSSValueAuto) |
| 2289 : zoomAdjustedPixelValue(style.clip().top().value(), style); | 2289 : zoomAdjustedPixelValue(style.clip().top().value(), style); |
| 2290 RefPtrWillBeRawPtr<CSSPrimitiveValue> right = style.clip().right().isAut
o() | 2290 RawPtr<CSSPrimitiveValue> right = style.clip().right().isAuto() |
| 2291 ? cssValuePool().createIdentifierValue(CSSValueAuto) | 2291 ? cssValuePool().createIdentifierValue(CSSValueAuto) |
| 2292 : zoomAdjustedPixelValue(style.clip().right().value(), style); | 2292 : zoomAdjustedPixelValue(style.clip().right().value(), style); |
| 2293 RefPtrWillBeRawPtr<CSSPrimitiveValue> bottom = style.clip().bottom().isA
uto() | 2293 RawPtr<CSSPrimitiveValue> bottom = style.clip().bottom().isAuto() |
| 2294 ? cssValuePool().createIdentifierValue(CSSValueAuto) | 2294 ? cssValuePool().createIdentifierValue(CSSValueAuto) |
| 2295 : zoomAdjustedPixelValue(style.clip().bottom().value(), style); | 2295 : zoomAdjustedPixelValue(style.clip().bottom().value(), style); |
| 2296 RefPtrWillBeRawPtr<CSSPrimitiveValue> left = style.clip().left().isAuto(
) | 2296 RawPtr<CSSPrimitiveValue> left = style.clip().left().isAuto() |
| 2297 ? cssValuePool().createIdentifierValue(CSSValueAuto) | 2297 ? cssValuePool().createIdentifierValue(CSSValueAuto) |
| 2298 : zoomAdjustedPixelValue(style.clip().left().value(), style); | 2298 : zoomAdjustedPixelValue(style.clip().left().value(), style); |
| 2299 return CSSQuadValue::create(top.release(), right.release(), bottom.relea
se(), left.release(), CSSQuadValue::SerializeAsRect); | 2299 return CSSQuadValue::create(top.release(), right.release(), bottom.relea
se(), left.release(), CSSQuadValue::SerializeAsRect); |
| 2300 } | 2300 } |
| 2301 case CSSPropertySpeak: | 2301 case CSSPropertySpeak: |
| 2302 return cssValuePool().createValue(style.speak()); | 2302 return cssValuePool().createValue(style.speak()); |
| 2303 case CSSPropertyTransform: | 2303 case CSSPropertyTransform: |
| 2304 return computedTransform(layoutObject, style); | 2304 return computedTransform(layoutObject, style); |
| 2305 case CSSPropertyTransformOrigin: { | 2305 case CSSPropertyTransformOrigin: { |
| 2306 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparat
ed(); | 2306 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); |
| 2307 if (layoutObject) { | 2307 if (layoutObject) { |
| 2308 LayoutRect box; | 2308 LayoutRect box; |
| 2309 if (layoutObject->isBox()) | 2309 if (layoutObject->isBox()) |
| 2310 box = toLayoutBox(layoutObject)->borderBoxRect(); | 2310 box = toLayoutBox(layoutObject)->borderBoxRect(); |
| 2311 | 2311 |
| 2312 list->append(zoomAdjustedPixelValue(minimumValueForLength(style.tran
sformOriginX(), box.width()), style)); | 2312 list->append(zoomAdjustedPixelValue(minimumValueForLength(style.tran
sformOriginX(), box.width()), style)); |
| 2313 list->append(zoomAdjustedPixelValue(minimumValueForLength(style.tran
sformOriginY(), box.height()), style)); | 2313 list->append(zoomAdjustedPixelValue(minimumValueForLength(style.tran
sformOriginY(), box.height()), style)); |
| 2314 if (style.transformOriginZ() != 0) | 2314 if (style.transformOriginZ() != 0) |
| 2315 list->append(zoomAdjustedPixelValue(style.transformOriginZ(), st
yle)); | 2315 list->append(zoomAdjustedPixelValue(style.transformOriginZ(), st
yle)); |
| 2316 } else { | 2316 } else { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 2327 return valueForAnimationDelay(style.transitions()); | 2327 return valueForAnimationDelay(style.transitions()); |
| 2328 case CSSPropertyTransitionDuration: | 2328 case CSSPropertyTransitionDuration: |
| 2329 return valueForAnimationDuration(style.transitions()); | 2329 return valueForAnimationDuration(style.transitions()); |
| 2330 case CSSPropertyTransitionProperty: | 2330 case CSSPropertyTransitionProperty: |
| 2331 return valueForTransitionProperty(style.transitions()); | 2331 return valueForTransitionProperty(style.transitions()); |
| 2332 case CSSPropertyTransitionTimingFunction: | 2332 case CSSPropertyTransitionTimingFunction: |
| 2333 return valueForAnimationTimingFunction(style.transitions()); | 2333 return valueForAnimationTimingFunction(style.transitions()); |
| 2334 case CSSPropertyTransition: { | 2334 case CSSPropertyTransition: { |
| 2335 const CSSTransitionData* transitionData = style.transitions(); | 2335 const CSSTransitionData* transitionData = style.transitions(); |
| 2336 if (transitionData) { | 2336 if (transitionData) { |
| 2337 RefPtrWillBeRawPtr<CSSValueList> transitionsList = CSSValueList::cre
ateCommaSeparated(); | 2337 RawPtr<CSSValueList> transitionsList = CSSValueList::createCommaSepa
rated(); |
| 2338 for (size_t i = 0; i < transitionData->propertyList().size(); ++i) { | 2338 for (size_t i = 0; i < transitionData->propertyList().size(); ++i) { |
| 2339 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpac
eSeparated(); | 2339 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; |
| 2340 list->append(createTransitionPropertyValue(transitionData->prope
rtyList()[i])); | 2340 list->append(createTransitionPropertyValue(transitionData->prope
rtyList()[i])); |
| 2341 list->append(cssValuePool().createValue(CSSTimingData::getRepeat
ed(transitionData->durationList(), i), CSSPrimitiveValue::UnitType::Seconds)); | 2341 list->append(cssValuePool().createValue(CSSTimingData::getRepeat
ed(transitionData->durationList(), i), CSSPrimitiveValue::UnitType::Seconds)); |
| 2342 list->append(createTimingFunctionValue(CSSTimingData::getRepeate
d(transitionData->timingFunctionList(), i).get())); | 2342 list->append(createTimingFunctionValue(CSSTimingData::getRepeate
d(transitionData->timingFunctionList(), i).get())); |
| 2343 list->append(cssValuePool().createValue(CSSTimingData::getRepeat
ed(transitionData->delayList(), i), CSSPrimitiveValue::UnitType::Seconds)); | 2343 list->append(cssValuePool().createValue(CSSTimingData::getRepeat
ed(transitionData->delayList(), i), CSSPrimitiveValue::UnitType::Seconds)); |
| 2344 transitionsList->append(list); | 2344 transitionsList->append(list); |
| 2345 } | 2345 } |
| 2346 return transitionsList.release(); | 2346 return transitionsList.release(); |
| 2347 } | 2347 } |
| 2348 | 2348 |
| 2349 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparat
ed(); | 2349 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); |
| 2350 // transition-property default value. | 2350 // transition-property default value. |
| 2351 list->append(cssValuePool().createIdentifierValue(CSSValueAll)); | 2351 list->append(cssValuePool().createIdentifierValue(CSSValueAll)); |
| 2352 list->append(cssValuePool().createValue(CSSTransitionData::initialDurati
on(), CSSPrimitiveValue::UnitType::Seconds)); | 2352 list->append(cssValuePool().createValue(CSSTransitionData::initialDurati
on(), CSSPrimitiveValue::UnitType::Seconds)); |
| 2353 list->append(createTimingFunctionValue(CSSTransitionData::initialTimingF
unction().get())); | 2353 list->append(createTimingFunctionValue(CSSTransitionData::initialTimingF
unction().get())); |
| 2354 list->append(cssValuePool().createValue(CSSTransitionData::initialDelay(
), CSSPrimitiveValue::UnitType::Seconds)); | 2354 list->append(cssValuePool().createValue(CSSTransitionData::initialDelay(
), CSSPrimitiveValue::UnitType::Seconds)); |
| 2355 return list.release(); | 2355 return list.release(); |
| 2356 } | 2356 } |
| 2357 case CSSPropertyPointerEvents: | 2357 case CSSPropertyPointerEvents: |
| 2358 return cssValuePool().createValue(style.pointerEvents()); | 2358 return cssValuePool().createValue(style.pointerEvents()); |
| 2359 case CSSPropertyWritingMode: | 2359 case CSSPropertyWritingMode: |
| (...skipping 30 matching lines...) Expand all Loading... |
| 2390 case CSSPropertyShapeOutside: | 2390 case CSSPropertyShapeOutside: |
| 2391 return valueForShape(style, style.shapeOutside()); | 2391 return valueForShape(style, style.shapeOutside()); |
| 2392 case CSSPropertyWebkitFilter: | 2392 case CSSPropertyWebkitFilter: |
| 2393 return valueForFilter(style, style.filter()); | 2393 return valueForFilter(style, style.filter()); |
| 2394 case CSSPropertyBackdropFilter: | 2394 case CSSPropertyBackdropFilter: |
| 2395 return valueForFilter(style, style.backdropFilter()); | 2395 return valueForFilter(style, style.backdropFilter()); |
| 2396 case CSSPropertyMixBlendMode: | 2396 case CSSPropertyMixBlendMode: |
| 2397 return cssValuePool().createValue(style.blendMode()); | 2397 return cssValuePool().createValue(style.blendMode()); |
| 2398 | 2398 |
| 2399 case CSSPropertyBackgroundBlendMode: { | 2399 case CSSPropertyBackgroundBlendMode: { |
| 2400 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparat
ed(); | 2400 RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); |
| 2401 for (const FillLayer* currLayer = &style.backgroundLayers(); currLayer;
currLayer = currLayer->next()) | 2401 for (const FillLayer* currLayer = &style.backgroundLayers(); currLayer;
currLayer = currLayer->next()) |
| 2402 list->append(cssValuePool().createValue(currLayer->blendMode())); | 2402 list->append(cssValuePool().createValue(currLayer->blendMode())); |
| 2403 return list.release(); | 2403 return list.release(); |
| 2404 } | 2404 } |
| 2405 case CSSPropertyBackground: | 2405 case CSSPropertyBackground: |
| 2406 return valuesForBackgroundShorthand(style, layoutObject, styledNode, all
owVisitedStyle); | 2406 return valuesForBackgroundShorthand(style, layoutObject, styledNode, all
owVisitedStyle); |
| 2407 case CSSPropertyBorder: { | 2407 case CSSPropertyBorder: { |
| 2408 RefPtrWillBeRawPtr<CSSValue> value = get(CSSPropertyBorderTop, style, la
youtObject, styledNode, allowVisitedStyle); | 2408 RawPtr<CSSValue> value = get(CSSPropertyBorderTop, style, layoutObject,
styledNode, allowVisitedStyle); |
| 2409 const CSSPropertyID properties[] = { | 2409 const CSSPropertyID properties[] = { |
| 2410 CSSPropertyBorderRight, | 2410 CSSPropertyBorderRight, |
| 2411 CSSPropertyBorderBottom, | 2411 CSSPropertyBorderBottom, |
| 2412 CSSPropertyBorderLeft | 2412 CSSPropertyBorderLeft |
| 2413 }; | 2413 }; |
| 2414 for (size_t i = 0; i < WTF_ARRAY_LENGTH(properties); ++i) { | 2414 for (size_t i = 0; i < WTF_ARRAY_LENGTH(properties); ++i) { |
| 2415 if (!compareCSSValuePtr<CSSValue>(value, get(properties[i], style, l
ayoutObject, styledNode, allowVisitedStyle))) | 2415 if (!compareCSSValuePtr<CSSValue>(value, get(properties[i], style, l
ayoutObject, styledNode, allowVisitedStyle))) |
| 2416 return nullptr; | 2416 return nullptr; |
| 2417 } | 2417 } |
| 2418 return value.release(); | 2418 return value.release(); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2457 | 2457 |
| 2458 case CSSPropertyMotionPath: | 2458 case CSSPropertyMotionPath: |
| 2459 if (const StylePath* styleMotionPath = style.motionPath()) | 2459 if (const StylePath* styleMotionPath = style.motionPath()) |
| 2460 return styleMotionPath->computedCSSValue(); | 2460 return styleMotionPath->computedCSSValue(); |
| 2461 return cssValuePool().createIdentifierValue(CSSValueNone); | 2461 return cssValuePool().createIdentifierValue(CSSValueNone); |
| 2462 | 2462 |
| 2463 case CSSPropertyMotionOffset: | 2463 case CSSPropertyMotionOffset: |
| 2464 return zoomAdjustedPixelValueForLength(style.motionOffset(), style); | 2464 return zoomAdjustedPixelValueForLength(style.motionOffset(), style); |
| 2465 | 2465 |
| 2466 case CSSPropertyMotionRotation: { | 2466 case CSSPropertyMotionRotation: { |
| 2467 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparat
ed(); | 2467 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); |
| 2468 if (style.motionRotation().type == MotionRotationAuto) | 2468 if (style.motionRotation().type == MotionRotationAuto) |
| 2469 list->append(cssValuePool().createIdentifierValue(CSSValueAuto)); | 2469 list->append(cssValuePool().createIdentifierValue(CSSValueAuto)); |
| 2470 list->append(cssValuePool().createValue(style.motionRotation().angle, CS
SPrimitiveValue::UnitType::Degrees)); | 2470 list->append(cssValuePool().createValue(style.motionRotation().angle, CS
SPrimitiveValue::UnitType::Degrees)); |
| 2471 return list.release(); | 2471 return list.release(); |
| 2472 } | 2472 } |
| 2473 | 2473 |
| 2474 // Unimplemented CSS 3 properties (including CSS3 shorthand properties). | 2474 // Unimplemented CSS 3 properties (including CSS3 shorthand properties). |
| 2475 case CSSPropertyWebkitTextEmphasis: | 2475 case CSSPropertyWebkitTextEmphasis: |
| 2476 return nullptr; | 2476 return nullptr; |
| 2477 | 2477 |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2658 case CSSPropertyScrollSnapPointsY: | 2658 case CSSPropertyScrollSnapPointsY: |
| 2659 return valueForScrollSnapPoints(style.scrollSnapPointsY(), style); | 2659 return valueForScrollSnapPoints(style.scrollSnapPointsY(), style); |
| 2660 case CSSPropertyScrollSnapCoordinate: | 2660 case CSSPropertyScrollSnapCoordinate: |
| 2661 return valueForScrollSnapCoordinate(style.scrollSnapCoordinate(), style)
; | 2661 return valueForScrollSnapCoordinate(style.scrollSnapCoordinate(), style)
; |
| 2662 case CSSPropertyScrollSnapDestination: | 2662 case CSSPropertyScrollSnapDestination: |
| 2663 return valueForScrollSnapDestination(style.scrollSnapDestination(), styl
e); | 2663 return valueForScrollSnapDestination(style.scrollSnapDestination(), styl
e); |
| 2664 case CSSPropertyTranslate: { | 2664 case CSSPropertyTranslate: { |
| 2665 if (!style.translate()) | 2665 if (!style.translate()) |
| 2666 return cssValuePool().createValue(0, CSSPrimitiveValue::UnitType::Pi
xels); | 2666 return cssValuePool().createValue(0, CSSPrimitiveValue::UnitType::Pi
xels); |
| 2667 | 2667 |
| 2668 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparat
ed(); | 2668 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); |
| 2669 if (layoutObject && layoutObject->isBox()) { | 2669 if (layoutObject && layoutObject->isBox()) { |
| 2670 LayoutRect box = toLayoutBox(layoutObject)->borderBoxRect(); | 2670 LayoutRect box = toLayoutBox(layoutObject)->borderBoxRect(); |
| 2671 list->append(zoomAdjustedPixelValue(floatValueForLength(style.transl
ate()->x(), box.width().toFloat()), style)); | 2671 list->append(zoomAdjustedPixelValue(floatValueForLength(style.transl
ate()->x(), box.width().toFloat()), style)); |
| 2672 | 2672 |
| 2673 if (!style.translate()->y().isZero() || style.translate()->z() != 0) | 2673 if (!style.translate()->y().isZero() || style.translate()->z() != 0) |
| 2674 list->append(zoomAdjustedPixelValue(floatValueForLength(style.tr
anslate()->y(), box.height().toFloat()), style)); | 2674 list->append(zoomAdjustedPixelValue(floatValueForLength(style.tr
anslate()->y(), box.height().toFloat()), style)); |
| 2675 | 2675 |
| 2676 } else { | 2676 } else { |
| 2677 // No box to resolve the percentage values | 2677 // No box to resolve the percentage values |
| 2678 list->append(zoomAdjustedPixelValueForLength(style.translate()->x(),
style)); | 2678 list->append(zoomAdjustedPixelValueForLength(style.translate()->x(),
style)); |
| 2679 | 2679 |
| 2680 if (!style.translate()->y().isZero() || style.translate()->z() != 0) | 2680 if (!style.translate()->y().isZero() || style.translate()->z() != 0) |
| 2681 list->append(zoomAdjustedPixelValueForLength(style.translate()->
y(), style)); | 2681 list->append(zoomAdjustedPixelValueForLength(style.translate()->
y(), style)); |
| 2682 } | 2682 } |
| 2683 | 2683 |
| 2684 if (style.translate()->z() != 0) | 2684 if (style.translate()->z() != 0) |
| 2685 list->append(zoomAdjustedPixelValue(style.translate()->z(), style)); | 2685 list->append(zoomAdjustedPixelValue(style.translate()->z(), style)); |
| 2686 | 2686 |
| 2687 return list.release(); | 2687 return list.release(); |
| 2688 } | 2688 } |
| 2689 case CSSPropertyRotate: { | 2689 case CSSPropertyRotate: { |
| 2690 if (!style.rotate()) | 2690 if (!style.rotate()) |
| 2691 return cssValuePool().createValue(0, CSSPrimitiveValue::UnitType::De
grees); | 2691 return cssValuePool().createValue(0, CSSPrimitiveValue::UnitType::De
grees); |
| 2692 | 2692 |
| 2693 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparat
ed(); | 2693 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); |
| 2694 list->append(cssValuePool().createValue(style.rotate()->angle(), CSSPrim
itiveValue::UnitType::Degrees)); | 2694 list->append(cssValuePool().createValue(style.rotate()->angle(), CSSPrim
itiveValue::UnitType::Degrees)); |
| 2695 if (style.rotate()->x() != 0 || style.rotate()->y() != 0 || style.rotate
()->z() != 1) { | 2695 if (style.rotate()->x() != 0 || style.rotate()->y() != 0 || style.rotate
()->z() != 1) { |
| 2696 list->append(cssValuePool().createValue(style.rotate()->x(), CSSPrim
itiveValue::UnitType::Number)); | 2696 list->append(cssValuePool().createValue(style.rotate()->x(), CSSPrim
itiveValue::UnitType::Number)); |
| 2697 list->append(cssValuePool().createValue(style.rotate()->y(), CSSPrim
itiveValue::UnitType::Number)); | 2697 list->append(cssValuePool().createValue(style.rotate()->y(), CSSPrim
itiveValue::UnitType::Number)); |
| 2698 list->append(cssValuePool().createValue(style.rotate()->z(), CSSPrim
itiveValue::UnitType::Number)); | 2698 list->append(cssValuePool().createValue(style.rotate()->z(), CSSPrim
itiveValue::UnitType::Number)); |
| 2699 } | 2699 } |
| 2700 return list.release(); | 2700 return list.release(); |
| 2701 } | 2701 } |
| 2702 case CSSPropertyScale: { | 2702 case CSSPropertyScale: { |
| 2703 if (!style.scale()) | 2703 if (!style.scale()) |
| 2704 return cssValuePool().createValue(1, CSSPrimitiveValue::UnitType::Nu
mber); | 2704 return cssValuePool().createValue(1, CSSPrimitiveValue::UnitType::Nu
mber); |
| 2705 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparat
ed(); | 2705 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); |
| 2706 list->append(cssValuePool().createValue(style.scale()->x(), CSSPrimitive
Value::UnitType::Number)); | 2706 list->append(cssValuePool().createValue(style.scale()->x(), CSSPrimitive
Value::UnitType::Number)); |
| 2707 if (style.scale()->y() == 1 && style.scale()->z() == 1) | 2707 if (style.scale()->y() == 1 && style.scale()->z() == 1) |
| 2708 return list.release(); | 2708 return list.release(); |
| 2709 list->append(cssValuePool().createValue(style.scale()->y(), CSSPrimitive
Value::UnitType::Number)); | 2709 list->append(cssValuePool().createValue(style.scale()->y(), CSSPrimitive
Value::UnitType::Number)); |
| 2710 if (style.scale()->z() != 1) | 2710 if (style.scale()->z() != 1) |
| 2711 list->append(cssValuePool().createValue(style.scale()->z(), CSSPrimi
tiveValue::UnitType::Number)); | 2711 list->append(cssValuePool().createValue(style.scale()->z(), CSSPrimi
tiveValue::UnitType::Number)); |
| 2712 return list.release(); | 2712 return list.release(); |
| 2713 } | 2713 } |
| 2714 case CSSPropertyContain: { | 2714 case CSSPropertyContain: { |
| 2715 if (!style.contain()) | 2715 if (!style.contain()) |
| 2716 return cssValuePool().createIdentifierValue(CSSValueNone); | 2716 return cssValuePool().createIdentifierValue(CSSValueNone); |
| 2717 if (style.contain() == ContainsStrict) | 2717 if (style.contain() == ContainsStrict) |
| 2718 return cssValuePool().createIdentifierValue(CSSValueStrict); | 2718 return cssValuePool().createIdentifierValue(CSSValueStrict); |
| 2719 | 2719 |
| 2720 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparat
ed(); | 2720 RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); |
| 2721 if (style.contain() & ContainsStyle) | 2721 if (style.contain() & ContainsStyle) |
| 2722 list->append(cssValuePool().createIdentifierValue(CSSValueStyle)); | 2722 list->append(cssValuePool().createIdentifierValue(CSSValueStyle)); |
| 2723 if (style.contain() & ContainsLayout) | 2723 if (style.contain() & ContainsLayout) |
| 2724 list->append(cssValuePool().createIdentifierValue(CSSValueLayout)); | 2724 list->append(cssValuePool().createIdentifierValue(CSSValueLayout)); |
| 2725 if (style.containsPaint()) | 2725 if (style.containsPaint()) |
| 2726 list->append(cssValuePool().createIdentifierValue(CSSValuePaint)); | 2726 list->append(cssValuePool().createIdentifierValue(CSSValuePaint)); |
| 2727 ASSERT(list->length()); | 2727 ASSERT(list->length()); |
| 2728 return list.release(); | 2728 return list.release(); |
| 2729 } | 2729 } |
| 2730 case CSSPropertyVariable: | 2730 case CSSPropertyVariable: |
| 2731 // Variables are retrieved via get(AtomicString). | 2731 // Variables are retrieved via get(AtomicString). |
| 2732 ASSERT_NOT_REACHED(); | 2732 ASSERT_NOT_REACHED(); |
| 2733 return nullptr; | 2733 return nullptr; |
| 2734 case CSSPropertyAll: | 2734 case CSSPropertyAll: |
| 2735 return nullptr; | 2735 return nullptr; |
| 2736 default: | 2736 default: |
| 2737 break; | 2737 break; |
| 2738 } | 2738 } |
| 2739 ASSERT_NOT_REACHED(); | 2739 ASSERT_NOT_REACHED(); |
| 2740 return nullptr; | 2740 return nullptr; |
| 2741 } | 2741 } |
| 2742 | 2742 |
| 2743 } // namespace blink | 2743 } // namespace blink |
| OLD | NEW |