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