| 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 19 matching lines...) Expand all Loading... |
| 73 return style && style->isDisplayFlexibleOrGridBox(); | 74 return style && style->isDisplayFlexibleOrGridBox(); |
| 74 } | 75 } |
| 75 | 76 |
| 76 inline static CSSPrimitiveValue* zoomAdjustedPixelValue( | 77 inline static CSSPrimitiveValue* zoomAdjustedPixelValue( |
| 77 double value, | 78 double value, |
| 78 const ComputedStyle& style) { | 79 const ComputedStyle& style) { |
| 79 return CSSPrimitiveValue::create(adjustFloatForAbsoluteZoom(value, style), | 80 return CSSPrimitiveValue::create(adjustFloatForAbsoluteZoom(value, style), |
| 80 CSSPrimitiveValue::UnitType::Pixels); | 81 CSSPrimitiveValue::UnitType::Pixels); |
| 81 } | 82 } |
| 82 | 83 |
| 84 inline static CSSValue* zoomAdjustedPixelValueOrAuto( |
| 85 const Length& length, |
| 86 const ComputedStyle& style) { |
| 87 if (length.isAuto()) |
| 88 return CSSIdentifierValue::create(CSSValueAuto); |
| 89 return zoomAdjustedPixelValue(length.value(), style); |
| 90 } |
| 91 |
| 83 inline static CSSPrimitiveValue* zoomAdjustedNumberValue( | 92 inline static CSSPrimitiveValue* zoomAdjustedNumberValue( |
| 84 double value, | 93 double value, |
| 85 const ComputedStyle& style) { | 94 const ComputedStyle& style) { |
| 86 return CSSPrimitiveValue::create(value / style.effectiveZoom(), | 95 return CSSPrimitiveValue::create(value / style.effectiveZoom(), |
| 87 CSSPrimitiveValue::UnitType::Number); | 96 CSSPrimitiveValue::UnitType::Number); |
| 88 } | 97 } |
| 89 | 98 |
| 90 static CSSPrimitiveValue* zoomAdjustedPixelValueForLength( | 99 static CSSValue* zoomAdjustedPixelValueForLength(const Length& length, |
| 91 const Length& length, | 100 const ComputedStyle& style) { |
| 92 const ComputedStyle& style) { | |
| 93 if (length.isFixed()) | 101 if (length.isFixed()) |
| 94 return zoomAdjustedPixelValue(length.value(), style); | 102 return zoomAdjustedPixelValue(length.value(), style); |
| 95 return CSSPrimitiveValue::create(length, style.effectiveZoom()); | 103 return CSSValue::create(length, style.effectiveZoom()); |
| 96 } | 104 } |
| 97 | 105 |
| 98 static CSSPrimitiveValue* pixelValueForUnzoomedLength( | 106 static CSSValue* pixelValueForUnzoomedLength( |
| 99 const UnzoomedLength& unzoomedLength, | 107 const UnzoomedLength& unzoomedLength, |
| 100 const ComputedStyle& style) { | 108 const ComputedStyle& style) { |
| 101 const Length& length = unzoomedLength.length(); | 109 const Length& length = unzoomedLength.length(); |
| 102 if (length.isFixed()) | 110 if (length.isFixed()) |
| 103 return CSSPrimitiveValue::create(length.value(), | 111 return CSSPrimitiveValue::create(length.value(), |
| 104 CSSPrimitiveValue::UnitType::Pixels); | 112 CSSPrimitiveValue::UnitType::Pixels); |
| 105 return CSSPrimitiveValue::create(length, style.effectiveZoom()); | 113 return CSSValue::create(length, style.effectiveZoom()); |
| 106 } | 114 } |
| 107 | 115 |
| 108 static CSSValueList* createPositionListForLayer(CSSPropertyID propertyID, | 116 static CSSValueList* createPositionListForLayer(CSSPropertyID propertyID, |
| 109 const FillLayer& layer, | 117 const FillLayer& layer, |
| 110 const ComputedStyle& style) { | 118 const ComputedStyle& style) { |
| 111 CSSValueList* positionList = CSSValueList::createSpaceSeparated(); | 119 CSSValueList* positionList = CSSValueList::createSpaceSeparated(); |
| 112 if (layer.isBackgroundXOriginSet()) { | 120 if (layer.isBackgroundXOriginSet()) { |
| 113 ASSERT_UNUSED(propertyID, propertyID == CSSPropertyBackgroundPosition || | 121 ASSERT_UNUSED(propertyID, propertyID == CSSPropertyBackgroundPosition || |
| 114 propertyID == CSSPropertyWebkitMaskPosition); | 122 propertyID == CSSPropertyWebkitMaskPosition); |
| 115 positionList->append(*CSSPrimitiveValue::create(layer.backgroundXOrigin())); | 123 positionList->append( |
| 124 *CSSIdentifierValue::create(layer.backgroundXOrigin())); |
| 116 } | 125 } |
| 117 positionList->append( | 126 positionList->append( |
| 118 *zoomAdjustedPixelValueForLength(layer.xPosition(), style)); | 127 *zoomAdjustedPixelValueForLength(layer.xPosition(), style)); |
| 119 if (layer.isBackgroundYOriginSet()) { | 128 if (layer.isBackgroundYOriginSet()) { |
| 120 ASSERT(propertyID == CSSPropertyBackgroundPosition || | 129 ASSERT(propertyID == CSSPropertyBackgroundPosition || |
| 121 propertyID == CSSPropertyWebkitMaskPosition); | 130 propertyID == CSSPropertyWebkitMaskPosition); |
| 122 positionList->append(*CSSPrimitiveValue::create(layer.backgroundYOrigin())); | 131 positionList->append( |
| 132 *CSSIdentifierValue::create(layer.backgroundYOrigin())); |
| 123 } | 133 } |
| 124 positionList->append( | 134 positionList->append( |
| 125 *zoomAdjustedPixelValueForLength(layer.yPosition(), style)); | 135 *zoomAdjustedPixelValueForLength(layer.yPosition(), style)); |
| 126 return positionList; | 136 return positionList; |
| 127 } | 137 } |
| 128 | 138 |
| 129 CSSValue* ComputedStyleCSSValueMapping::currentColorOrValidColor( | 139 CSSValue* ComputedStyleCSSValueMapping::currentColorOrValidColor( |
| 130 const ComputedStyle& style, | 140 const ComputedStyle& style, |
| 131 const StyleColor& color) { | 141 const StyleColor& color) { |
| 132 // This function does NOT look at visited information, so that computed style
doesn't expose that. | 142 // This function does NOT look at visited information, so that computed style
doesn't expose that. |
| 133 return CSSColorValue::create(color.resolve(style.color()).rgb()); | 143 return CSSColorValue::create(color.resolve(style.color()).rgb()); |
| 134 } | 144 } |
| 135 | 145 |
| 136 static CSSValue* valueForFillSize(const FillSize& fillSize, | 146 static CSSValue* valueForFillSize(const FillSize& fillSize, |
| 137 const ComputedStyle& style) { | 147 const ComputedStyle& style) { |
| 138 if (fillSize.type == Contain) | 148 if (fillSize.type == Contain) |
| 139 return CSSPrimitiveValue::createIdentifier(CSSValueContain); | 149 return CSSIdentifierValue::create(CSSValueContain); |
| 140 | 150 |
| 141 if (fillSize.type == Cover) | 151 if (fillSize.type == Cover) |
| 142 return CSSPrimitiveValue::createIdentifier(CSSValueCover); | 152 return CSSIdentifierValue::create(CSSValueCover); |
| 143 | 153 |
| 144 if (fillSize.size.height().isAuto()) | 154 if (fillSize.size.height().isAuto()) |
| 145 return zoomAdjustedPixelValueForLength(fillSize.size.width(), style); | 155 return zoomAdjustedPixelValueForLength(fillSize.size.width(), style); |
| 146 | 156 |
| 147 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 157 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
| 148 list->append(*zoomAdjustedPixelValueForLength(fillSize.size.width(), style)); | 158 list->append(*zoomAdjustedPixelValueForLength(fillSize.size.width(), style)); |
| 149 list->append(*zoomAdjustedPixelValueForLength(fillSize.size.height(), style)); | 159 list->append(*zoomAdjustedPixelValueForLength(fillSize.size.height(), style)); |
| 150 return list; | 160 return list; |
| 151 } | 161 } |
| 152 | 162 |
| 153 static CSSValue* valueForFillRepeat(EFillRepeat xRepeat, EFillRepeat yRepeat) { | 163 static CSSValue* valueForFillRepeat(EFillRepeat xRepeat, EFillRepeat yRepeat) { |
| 154 // For backwards compatibility, if both values are equal, just return one of t
hem. And | 164 // For backwards compatibility, if both values are equal, just return one of t
hem. And |
| 155 // if the two values are equivalent to repeat-x or repeat-y, just return the s
horthand. | 165 // if the two values are equivalent to repeat-x or repeat-y, just return the s
horthand. |
| 156 if (xRepeat == yRepeat) | 166 if (xRepeat == yRepeat) |
| 157 return CSSPrimitiveValue::create(xRepeat); | 167 return CSSIdentifierValue::create(xRepeat); |
| 158 if (xRepeat == RepeatFill && yRepeat == NoRepeatFill) | 168 if (xRepeat == RepeatFill && yRepeat == NoRepeatFill) |
| 159 return CSSPrimitiveValue::createIdentifier(CSSValueRepeatX); | 169 return CSSIdentifierValue::create(CSSValueRepeatX); |
| 160 if (xRepeat == NoRepeatFill && yRepeat == RepeatFill) | 170 if (xRepeat == NoRepeatFill && yRepeat == RepeatFill) |
| 161 return CSSPrimitiveValue::createIdentifier(CSSValueRepeatY); | 171 return CSSIdentifierValue::create(CSSValueRepeatY); |
| 162 | 172 |
| 163 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 173 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
| 164 list->append(*CSSPrimitiveValue::create(xRepeat)); | 174 list->append(*CSSIdentifierValue::create(xRepeat)); |
| 165 list->append(*CSSPrimitiveValue::create(yRepeat)); | 175 list->append(*CSSIdentifierValue::create(yRepeat)); |
| 166 return list; | 176 return list; |
| 167 } | 177 } |
| 168 | 178 |
| 169 static CSSValue* valueForFillSourceType(EMaskSourceType type) { | 179 static CSSValue* valueForFillSourceType(EMaskSourceType type) { |
| 170 switch (type) { | 180 switch (type) { |
| 171 case MaskAlpha: | 181 case MaskAlpha: |
| 172 return CSSPrimitiveValue::createIdentifier(CSSValueAlpha); | 182 return CSSIdentifierValue::create(CSSValueAlpha); |
| 173 case MaskLuminance: | 183 case MaskLuminance: |
| 174 return CSSPrimitiveValue::createIdentifier(CSSValueLuminance); | 184 return CSSIdentifierValue::create(CSSValueLuminance); |
| 175 } | 185 } |
| 176 | 186 |
| 177 ASSERT_NOT_REACHED(); | 187 ASSERT_NOT_REACHED(); |
| 178 | 188 |
| 179 return nullptr; | 189 return nullptr; |
| 180 } | 190 } |
| 181 | 191 |
| 182 static CSSValue* valueForPositionOffset(const ComputedStyle& style, | 192 static CSSValue* valueForPositionOffset(const ComputedStyle& style, |
| 183 CSSPropertyID propertyID, | 193 CSSPropertyID propertyID, |
| 184 const LayoutObject* layoutObject) { | 194 const LayoutObject* layoutObject) { |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 LayoutUnit containingBlockSize = | 240 LayoutUnit containingBlockSize = |
| 231 (propertyID == CSSPropertyLeft || propertyID == CSSPropertyRight) | 241 (propertyID == CSSPropertyLeft || propertyID == CSSPropertyRight) |
| 232 ? toLayoutBox(layoutObject) | 242 ? toLayoutBox(layoutObject) |
| 233 ->containingBlockLogicalWidthForContent() | 243 ->containingBlockLogicalWidthForContent() |
| 234 : toLayoutBox(layoutObject) | 244 : toLayoutBox(layoutObject) |
| 235 ->containingBlockLogicalHeightForGetComputedStyle(); | 245 ->containingBlockLogicalHeightForGetComputedStyle(); |
| 236 return zoomAdjustedPixelValue( | 246 return zoomAdjustedPixelValue( |
| 237 -floatValueForLength(opposite, containingBlockSize), style); | 247 -floatValueForLength(opposite, containingBlockSize), style); |
| 238 } | 248 } |
| 239 // FIXME: fall back to auto for position:relative, display:inline | 249 // FIXME: fall back to auto for position:relative, display:inline |
| 240 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); | 250 return CSSIdentifierValue::create(CSSValueAuto); |
| 241 } | 251 } |
| 242 | 252 |
| 243 // Length doesn't provide operator -, so multiply by -1. | 253 // Length doesn't provide operator -, so multiply by -1. |
| 244 opposite *= -1.f; | 254 opposite *= -1.f; |
| 245 return zoomAdjustedPixelValueForLength(opposite, style); | 255 return zoomAdjustedPixelValueForLength(opposite, style); |
| 246 } | 256 } |
| 247 | 257 |
| 248 if (layoutObject->isOutOfFlowPositioned() && layoutObject->isBox()) { | 258 if (layoutObject->isOutOfFlowPositioned() && layoutObject->isBox()) { |
| 249 // For fixed and absolute positioned elements, the top, left, bottom, and
right | 259 // For fixed and absolute positioned elements, the top, left, bottom, and
right |
| 250 // are defined relative to the corresponding sides of the containing block
. | 260 // are defined relative to the corresponding sides of the containing block
. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 274 (layoutBox->offsetHeight() + clientOffset.height()); | 284 (layoutBox->offsetHeight() + clientOffset.height()); |
| 275 break; | 285 break; |
| 276 default: | 286 default: |
| 277 ASSERT_NOT_REACHED(); | 287 ASSERT_NOT_REACHED(); |
| 278 } | 288 } |
| 279 return zoomAdjustedPixelValue(position, style); | 289 return zoomAdjustedPixelValue(position, style); |
| 280 } | 290 } |
| 281 } | 291 } |
| 282 | 292 |
| 283 if (offset.isAuto()) | 293 if (offset.isAuto()) |
| 284 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); | 294 return CSSIdentifierValue::create(CSSValueAuto); |
| 285 | 295 |
| 286 return zoomAdjustedPixelValueForLength(offset, style); | 296 return zoomAdjustedPixelValueForLength(offset, style); |
| 287 } | 297 } |
| 288 | 298 |
| 289 static CSSBorderImageSliceValue* valueForNinePieceImageSlice( | 299 static CSSBorderImageSliceValue* valueForNinePieceImageSlice( |
| 290 const NinePieceImage& image) { | 300 const NinePieceImage& image) { |
| 291 // Create the slices. | 301 // Create the slices. |
| 292 CSSPrimitiveValue* top = nullptr; | 302 CSSPrimitiveValue* top = nullptr; |
| 293 CSSPrimitiveValue* right = nullptr; | 303 CSSPrimitiveValue* right = nullptr; |
| 294 CSSPrimitiveValue* bottom = nullptr; | 304 CSSPrimitiveValue* bottom = nullptr; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 } | 353 } |
| 344 } | 354 } |
| 345 } | 355 } |
| 346 | 356 |
| 347 return CSSBorderImageSliceValue::create( | 357 return CSSBorderImageSliceValue::create( |
| 348 CSSQuadValue::create(top, right, bottom, left, | 358 CSSQuadValue::create(top, right, bottom, left, |
| 349 CSSQuadValue::SerializeAsQuad), | 359 CSSQuadValue::SerializeAsQuad), |
| 350 image.fill()); | 360 image.fill()); |
| 351 } | 361 } |
| 352 | 362 |
| 353 static CSSPrimitiveValue* valueForBorderImageLength( | 363 static CSSValue* valueForBorderImageLength( |
| 354 const BorderImageLength& borderImageLength, | 364 const BorderImageLength& borderImageLength, |
| 355 const ComputedStyle& style) { | 365 const ComputedStyle& style) { |
| 356 if (borderImageLength.isNumber()) | 366 if (borderImageLength.isNumber()) |
| 357 return CSSPrimitiveValue::create(borderImageLength.number(), | 367 return CSSPrimitiveValue::create(borderImageLength.number(), |
| 358 CSSPrimitiveValue::UnitType::Number); | 368 CSSPrimitiveValue::UnitType::Number); |
| 359 return CSSPrimitiveValue::create(borderImageLength.length(), | 369 return CSSValue::create(borderImageLength.length(), style.effectiveZoom()); |
| 360 style.effectiveZoom()); | |
| 361 } | 370 } |
| 362 | 371 |
| 363 static CSSQuadValue* valueForNinePieceImageQuad(const BorderImageLengthBox& box, | 372 static CSSQuadValue* valueForNinePieceImageQuad(const BorderImageLengthBox& box, |
| 364 const ComputedStyle& style) { | 373 const ComputedStyle& style) { |
| 365 // Create the slices. | 374 // Create the slices. |
| 366 CSSPrimitiveValue* top = nullptr; | 375 CSSValue* top = nullptr; |
| 367 CSSPrimitiveValue* right = nullptr; | 376 CSSValue* right = nullptr; |
| 368 CSSPrimitiveValue* bottom = nullptr; | 377 CSSValue* bottom = nullptr; |
| 369 CSSPrimitiveValue* left = nullptr; | 378 CSSValue* left = nullptr; |
| 370 | 379 |
| 371 top = valueForBorderImageLength(box.top(), style); | 380 top = valueForBorderImageLength(box.top(), style); |
| 372 | 381 |
| 373 if (box.right() == box.top() && box.bottom() == box.top() && | 382 if (box.right() == box.top() && box.bottom() == box.top() && |
| 374 box.left() == box.top()) { | 383 box.left() == box.top()) { |
| 375 right = top; | 384 right = top; |
| 376 bottom = top; | 385 bottom = top; |
| 377 left = top; | 386 left = top; |
| 378 } else { | 387 } else { |
| 379 right = valueForBorderImageLength(box.right(), style); | 388 right = valueForBorderImageLength(box.right(), style); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 401 case RoundImageRule: | 410 case RoundImageRule: |
| 402 return CSSValueRound; | 411 return CSSValueRound; |
| 403 case SpaceImageRule: | 412 case SpaceImageRule: |
| 404 return CSSValueSpace; | 413 return CSSValueSpace; |
| 405 default: | 414 default: |
| 406 return CSSValueStretch; | 415 return CSSValueStretch; |
| 407 } | 416 } |
| 408 } | 417 } |
| 409 | 418 |
| 410 static CSSValue* valueForNinePieceImageRepeat(const NinePieceImage& image) { | 419 static CSSValue* valueForNinePieceImageRepeat(const NinePieceImage& image) { |
| 411 CSSPrimitiveValue* horizontalRepeat = nullptr; | 420 CSSIdentifierValue* horizontalRepeat = nullptr; |
| 412 CSSPrimitiveValue* verticalRepeat = nullptr; | 421 CSSIdentifierValue* verticalRepeat = nullptr; |
| 413 | 422 |
| 414 horizontalRepeat = CSSPrimitiveValue::createIdentifier( | 423 horizontalRepeat = |
| 415 valueForRepeatRule(image.horizontalRule())); | 424 CSSIdentifierValue::create(valueForRepeatRule(image.horizontalRule())); |
| 416 if (image.horizontalRule() == image.verticalRule()) | 425 if (image.horizontalRule() == image.verticalRule()) { |
| 417 verticalRepeat = horizontalRepeat; | 426 verticalRepeat = horizontalRepeat; |
| 418 else | 427 } else { |
| 419 verticalRepeat = CSSPrimitiveValue::createIdentifier( | 428 verticalRepeat = |
| 420 valueForRepeatRule(image.verticalRule())); | 429 CSSIdentifierValue::create(valueForRepeatRule(image.verticalRule())); |
| 430 } |
| 421 return CSSValuePair::create(horizontalRepeat, verticalRepeat, | 431 return CSSValuePair::create(horizontalRepeat, verticalRepeat, |
| 422 CSSValuePair::DropIdenticalValues); | 432 CSSValuePair::DropIdenticalValues); |
| 423 } | 433 } |
| 424 | 434 |
| 425 static CSSValue* valueForNinePieceImage(const NinePieceImage& image, | 435 static CSSValue* valueForNinePieceImage(const NinePieceImage& image, |
| 426 const ComputedStyle& style) { | 436 const ComputedStyle& style) { |
| 427 if (!image.hasImage()) | 437 if (!image.hasImage()) |
| 428 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 438 return CSSIdentifierValue::create(CSSValueNone); |
| 429 | 439 |
| 430 // Image first. | 440 // Image first. |
| 431 CSSValue* imageValue = nullptr; | 441 CSSValue* imageValue = nullptr; |
| 432 if (image.image()) | 442 if (image.image()) |
| 433 imageValue = image.image()->computedCSSValue(); | 443 imageValue = image.image()->computedCSSValue(); |
| 434 | 444 |
| 435 // Create the image slice. | 445 // Create the image slice. |
| 436 CSSBorderImageSliceValue* imageSlices = valueForNinePieceImageSlice(image); | 446 CSSBorderImageSliceValue* imageSlices = valueForNinePieceImageSlice(image); |
| 437 | 447 |
| 438 // Create the border area slices. | 448 // Create the border area slices. |
| 439 CSSValue* borderSlices = | 449 CSSValue* borderSlices = |
| 440 valueForNinePieceImageQuad(image.borderSlices(), style); | 450 valueForNinePieceImageQuad(image.borderSlices(), style); |
| 441 | 451 |
| 442 // Create the border outset. | 452 // Create the border outset. |
| 443 CSSValue* outset = valueForNinePieceImageQuad(image.outset(), style); | 453 CSSValue* outset = valueForNinePieceImageQuad(image.outset(), style); |
| 444 | 454 |
| 445 // Create the repeat rules. | 455 // Create the repeat rules. |
| 446 CSSValue* repeat = valueForNinePieceImageRepeat(image); | 456 CSSValue* repeat = valueForNinePieceImageRepeat(image); |
| 447 | 457 |
| 448 return createBorderImageValue(imageValue, imageSlices, borderSlices, outset, | 458 return createBorderImageValue(imageValue, imageSlices, borderSlices, outset, |
| 449 repeat); | 459 repeat); |
| 450 } | 460 } |
| 451 | 461 |
| 452 static CSSValue* valueForReflection(const StyleReflection* reflection, | 462 static CSSValue* valueForReflection(const StyleReflection* reflection, |
| 453 const ComputedStyle& style) { | 463 const ComputedStyle& style) { |
| 454 if (!reflection) | 464 if (!reflection) |
| 455 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 465 return CSSIdentifierValue::create(CSSValueNone); |
| 456 | 466 |
| 457 CSSPrimitiveValue* offset = nullptr; | 467 CSSPrimitiveValue* offset = nullptr; |
| 458 // TODO(alancutter): Make this work correctly for calc lengths. | 468 // TODO(alancutter): Make this work correctly for calc lengths. |
| 459 if (reflection->offset().isPercentOrCalc()) | 469 if (reflection->offset().isPercentOrCalc()) |
| 460 offset = CSSPrimitiveValue::create(reflection->offset().percent(), | 470 offset = CSSPrimitiveValue::create(reflection->offset().percent(), |
| 461 CSSPrimitiveValue::UnitType::Percentage); | 471 CSSPrimitiveValue::UnitType::Percentage); |
| 462 else | 472 else |
| 463 offset = zoomAdjustedPixelValue(reflection->offset().value(), style); | 473 offset = zoomAdjustedPixelValue(reflection->offset().value(), style); |
| 464 | 474 |
| 465 CSSPrimitiveValue* direction = nullptr; | 475 CSSIdentifierValue* direction = nullptr; |
| 466 switch (reflection->direction()) { | 476 switch (reflection->direction()) { |
| 467 case ReflectionBelow: | 477 case ReflectionBelow: |
| 468 direction = CSSPrimitiveValue::createIdentifier(CSSValueBelow); | 478 direction = CSSIdentifierValue::create(CSSValueBelow); |
| 469 break; | 479 break; |
| 470 case ReflectionAbove: | 480 case ReflectionAbove: |
| 471 direction = CSSPrimitiveValue::createIdentifier(CSSValueAbove); | 481 direction = CSSIdentifierValue::create(CSSValueAbove); |
| 472 break; | 482 break; |
| 473 case ReflectionLeft: | 483 case ReflectionLeft: |
| 474 direction = CSSPrimitiveValue::createIdentifier(CSSValueLeft); | 484 direction = CSSIdentifierValue::create(CSSValueLeft); |
| 475 break; | 485 break; |
| 476 case ReflectionRight: | 486 case ReflectionRight: |
| 477 direction = CSSPrimitiveValue::createIdentifier(CSSValueRight); | 487 direction = CSSIdentifierValue::create(CSSValueRight); |
| 478 break; | 488 break; |
| 479 } | 489 } |
| 480 | 490 |
| 481 return CSSReflectValue::create( | 491 return CSSReflectValue::create( |
| 482 direction, offset, valueForNinePieceImage(reflection->mask(), style)); | 492 direction, offset, valueForNinePieceImage(reflection->mask(), style)); |
| 483 } | 493 } |
| 484 | 494 |
| 485 static CSSValueList* valueForItemPositionWithOverflowAlignment( | 495 static CSSValueList* valueForItemPositionWithOverflowAlignment( |
| 486 const StyleSelfAlignmentData& data) { | 496 const StyleSelfAlignmentData& data) { |
| 487 CSSValueList* result = CSSValueList::createSpaceSeparated(); | 497 CSSValueList* result = CSSValueList::createSpaceSeparated(); |
| 488 if (data.positionType() == LegacyPosition) | 498 if (data.positionType() == LegacyPosition) |
| 489 result->append(*CSSPrimitiveValue::createIdentifier(CSSValueLegacy)); | 499 result->append(*CSSIdentifierValue::create(CSSValueLegacy)); |
| 490 // 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 'n
ormal' after running it. | 500 // 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 'n
ormal' after running it. |
| 491 result->append(*CSSPrimitiveValue::create( | 501 result->append(*CSSIdentifierValue::create( |
| 492 data.position() == ItemPositionAuto | 502 data.position() == ItemPositionAuto |
| 493 ? ComputedStyle::initialDefaultAlignment().position() | 503 ? ComputedStyle::initialDefaultAlignment().position() |
| 494 : data.position())); | 504 : data.position())); |
| 495 if (data.position() >= ItemPositionCenter && | 505 if (data.position() >= ItemPositionCenter && |
| 496 data.overflow() != OverflowAlignmentDefault) | 506 data.overflow() != OverflowAlignmentDefault) |
| 497 result->append(*CSSPrimitiveValue::create(data.overflow())); | 507 result->append(*CSSIdentifierValue::create(data.overflow())); |
| 498 ASSERT(result->length() <= 2); | 508 ASSERT(result->length() <= 2); |
| 499 return result; | 509 return result; |
| 500 } | 510 } |
| 501 | 511 |
| 502 static CSSValueList* valuesForGridShorthand( | 512 static CSSValueList* valuesForGridShorthand( |
| 503 const StylePropertyShorthand& shorthand, | 513 const StylePropertyShorthand& shorthand, |
| 504 const ComputedStyle& style, | 514 const ComputedStyle& style, |
| 505 const LayoutObject* layoutObject, | 515 const LayoutObject* layoutObject, |
| 506 Node* styledNode, | 516 Node* styledNode, |
| 507 bool allowVisitedStyle) { | 517 bool allowVisitedStyle) { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 528 shorthand.properties()[i], style, layoutObject, styledNode, | 538 shorthand.properties()[i], style, layoutObject, styledNode, |
| 529 allowVisitedStyle); | 539 allowVisitedStyle); |
| 530 ASSERT(value); | 540 ASSERT(value); |
| 531 list->append(*value); | 541 list->append(*value); |
| 532 } | 542 } |
| 533 return list; | 543 return list; |
| 534 } | 544 } |
| 535 | 545 |
| 536 static CSSValue* expandNoneLigaturesValue() { | 546 static CSSValue* expandNoneLigaturesValue() { |
| 537 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 547 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
| 538 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueNoCommonLigatures)); | 548 list->append(*CSSIdentifierValue::create(CSSValueNoCommonLigatures)); |
| 539 list->append( | 549 list->append(*CSSIdentifierValue::create(CSSValueNoDiscretionaryLigatures)); |
| 540 *CSSPrimitiveValue::createIdentifier(CSSValueNoDiscretionaryLigatures)); | 550 list->append(*CSSIdentifierValue::create(CSSValueNoHistoricalLigatures)); |
| 541 list->append( | 551 list->append(*CSSIdentifierValue::create(CSSValueNoContextual)); |
| 542 *CSSPrimitiveValue::createIdentifier(CSSValueNoHistoricalLigatures)); | |
| 543 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueNoContextual)); | |
| 544 return list; | 552 return list; |
| 545 } | 553 } |
| 546 | 554 |
| 547 static CSSValue* valuesForFontVariantProperty(const ComputedStyle& style, | 555 static CSSValue* valuesForFontVariantProperty(const ComputedStyle& style, |
| 548 const LayoutObject* layoutObject, | 556 const LayoutObject* layoutObject, |
| 549 Node* styledNode, | 557 Node* styledNode, |
| 550 bool allowVisitedStyle) { | 558 bool allowVisitedStyle) { |
| 551 enum VariantShorthandCases { AllNormal, NoneLigatures, ConcatenateNonNormal }; | 559 enum VariantShorthandCases { AllNormal, NoneLigatures, ConcatenateNonNormal }; |
| 552 VariantShorthandCases shorthandCase = AllNormal; | 560 VariantShorthandCases shorthandCase = AllNormal; |
| 553 for (size_t i = 0; i < fontVariantShorthand().length(); ++i) { | 561 for (size_t i = 0; i < fontVariantShorthand().length(); ++i) { |
| 554 const CSSValue* value = ComputedStyleCSSValueMapping::get( | 562 const CSSValue* value = ComputedStyleCSSValueMapping::get( |
| 555 fontVariantShorthand().properties()[i], style, layoutObject, styledNode, | 563 fontVariantShorthand().properties()[i], style, layoutObject, styledNode, |
| 556 allowVisitedStyle); | 564 allowVisitedStyle); |
| 557 | 565 |
| 558 if (shorthandCase == AllNormal && value->isPrimitiveValue() && | 566 if (shorthandCase == AllNormal && value->isIdentifierValue() && |
| 559 toCSSPrimitiveValue(value)->getValueID() == CSSValueNone && | 567 toCSSIdentifierValue(value)->getValueID() == CSSValueNone && |
| 560 fontVariantShorthand().properties()[i] == | 568 fontVariantShorthand().properties()[i] == |
| 561 CSSPropertyFontVariantLigatures) { | 569 CSSPropertyFontVariantLigatures) { |
| 562 shorthandCase = NoneLigatures; | 570 shorthandCase = NoneLigatures; |
| 563 } else if (!(value->isPrimitiveValue() && | 571 } else if (!(value->isIdentifierValue() && |
| 564 toCSSPrimitiveValue(value)->getValueID() == CSSValueNormal)) { | 572 toCSSIdentifierValue(value)->getValueID() == CSSValueNormal)) { |
| 565 shorthandCase = ConcatenateNonNormal; | 573 shorthandCase = ConcatenateNonNormal; |
| 566 break; | 574 break; |
| 567 } | 575 } |
| 568 } | 576 } |
| 569 | 577 |
| 570 switch (shorthandCase) { | 578 switch (shorthandCase) { |
| 571 case AllNormal: | 579 case AllNormal: |
| 572 return CSSPrimitiveValue::createIdentifier(CSSValueNormal); | 580 return CSSIdentifierValue::create(CSSValueNormal); |
| 573 case NoneLigatures: | 581 case NoneLigatures: |
| 574 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 582 return CSSIdentifierValue::create(CSSValueNone); |
| 575 case ConcatenateNonNormal: { | 583 case ConcatenateNonNormal: { |
| 576 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 584 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
| 577 for (size_t i = 0; i < fontVariantShorthand().length(); ++i) { | 585 for (size_t i = 0; i < fontVariantShorthand().length(); ++i) { |
| 578 const CSSValue* value = ComputedStyleCSSValueMapping::get( | 586 const CSSValue* value = ComputedStyleCSSValueMapping::get( |
| 579 fontVariantShorthand().properties()[i], style, layoutObject, | 587 fontVariantShorthand().properties()[i], style, layoutObject, |
| 580 styledNode, allowVisitedStyle); | 588 styledNode, allowVisitedStyle); |
| 581 ASSERT(value); | 589 ASSERT(value); |
| 582 if (value->isPrimitiveValue() && | 590 if (value->isIdentifierValue() && |
| 583 toCSSPrimitiveValue(value)->getValueID() == CSSValueNone) { | 591 toCSSIdentifierValue(value)->getValueID() == CSSValueNone) { |
| 584 list->append(*expandNoneLigaturesValue()); | 592 list->append(*expandNoneLigaturesValue()); |
| 585 } else if (!(value->isPrimitiveValue() && | 593 } else if (!(value->isIdentifierValue() && |
| 586 toCSSPrimitiveValue(value)->getValueID() == | 594 toCSSIdentifierValue(value)->getValueID() == |
| 587 CSSValueNormal)) { | 595 CSSValueNormal)) { |
| 588 list->append(*value); | 596 list->append(*value); |
| 589 } | 597 } |
| 590 } | 598 } |
| 591 return list; | 599 return list; |
| 592 } | 600 } |
| 593 default: | 601 default: |
| 594 NOTREACHED(); | 602 NOTREACHED(); |
| 595 return nullptr; | 603 return nullptr; |
| 596 } | 604 } |
| 597 } | 605 } |
| 598 | 606 |
| 599 static CSSValueList* valuesForBackgroundShorthand( | 607 static CSSValueList* valuesForBackgroundShorthand( |
| 600 const ComputedStyle& style, | 608 const ComputedStyle& style, |
| 601 const LayoutObject* layoutObject, | 609 const LayoutObject* layoutObject, |
| 602 Node* styledNode, | 610 Node* styledNode, |
| 603 bool allowVisitedStyle) { | 611 bool allowVisitedStyle) { |
| 604 CSSValueList* ret = CSSValueList::createCommaSeparated(); | 612 CSSValueList* ret = CSSValueList::createCommaSeparated(); |
| 605 const FillLayer* currLayer = &style.backgroundLayers(); | 613 const FillLayer* currLayer = &style.backgroundLayers(); |
| 606 for (; currLayer; currLayer = currLayer->next()) { | 614 for (; currLayer; currLayer = currLayer->next()) { |
| 607 CSSValueList* list = CSSValueList::createSlashSeparated(); | 615 CSSValueList* list = CSSValueList::createSlashSeparated(); |
| 608 CSSValueList* beforeSlash = CSSValueList::createSpaceSeparated(); | 616 CSSValueList* beforeSlash = CSSValueList::createSpaceSeparated(); |
| 609 if (!currLayer->next()) { // color only for final layer | 617 if (!currLayer->next()) { // color only for final layer |
| 610 const CSSValue* value = ComputedStyleCSSValueMapping::get( | 618 const CSSValue* value = ComputedStyleCSSValueMapping::get( |
| 611 CSSPropertyBackgroundColor, style, layoutObject, styledNode, | 619 CSSPropertyBackgroundColor, style, layoutObject, styledNode, |
| 612 allowVisitedStyle); | 620 allowVisitedStyle); |
| 613 ASSERT(value); | 621 ASSERT(value); |
| 614 beforeSlash->append(*value); | 622 beforeSlash->append(*value); |
| 615 } | 623 } |
| 616 beforeSlash->append( | 624 beforeSlash->append(currLayer->image() |
| 617 currLayer->image() | 625 ? *currLayer->image()->computedCSSValue() |
| 618 ? *currLayer->image()->computedCSSValue() | 626 : *CSSIdentifierValue::create(CSSValueNone)); |
| 619 : *CSSPrimitiveValue::createIdentifier(CSSValueNone)); | |
| 620 beforeSlash->append( | 627 beforeSlash->append( |
| 621 *valueForFillRepeat(currLayer->repeatX(), currLayer->repeatY())); | 628 *valueForFillRepeat(currLayer->repeatX(), currLayer->repeatY())); |
| 622 beforeSlash->append(*CSSPrimitiveValue::create(currLayer->attachment())); | 629 beforeSlash->append(*CSSIdentifierValue::create(currLayer->attachment())); |
| 623 beforeSlash->append(*createPositionListForLayer( | 630 beforeSlash->append(*createPositionListForLayer( |
| 624 CSSPropertyBackgroundPosition, *currLayer, style)); | 631 CSSPropertyBackgroundPosition, *currLayer, style)); |
| 625 list->append(*beforeSlash); | 632 list->append(*beforeSlash); |
| 626 CSSValueList* afterSlash = CSSValueList::createSpaceSeparated(); | 633 CSSValueList* afterSlash = CSSValueList::createSpaceSeparated(); |
| 627 afterSlash->append(*valueForFillSize(currLayer->size(), style)); | 634 afterSlash->append(*valueForFillSize(currLayer->size(), style)); |
| 628 afterSlash->append(*CSSPrimitiveValue::create(currLayer->origin())); | 635 afterSlash->append(*CSSIdentifierValue::create(currLayer->origin())); |
| 629 afterSlash->append(*CSSPrimitiveValue::create(currLayer->clip())); | 636 afterSlash->append(*CSSIdentifierValue::create(currLayer->clip())); |
| 630 list->append(*afterSlash); | 637 list->append(*afterSlash); |
| 631 ret->append(*list); | 638 ret->append(*list); |
| 632 } | 639 } |
| 633 return ret; | 640 return ret; |
| 634 } | 641 } |
| 635 | 642 |
| 636 static CSSValueList* | 643 static CSSValueList* |
| 637 valueForContentPositionAndDistributionWithOverflowAlignment( | 644 valueForContentPositionAndDistributionWithOverflowAlignment( |
| 638 const StyleContentAlignmentData& data, | 645 const StyleContentAlignmentData& data, |
| 639 CSSValueID normalBehaviorValueID) { | 646 CSSValueID normalBehaviorValueID) { |
| 640 CSSValueList* result = CSSValueList::createSpaceSeparated(); | 647 CSSValueList* result = CSSValueList::createSpaceSeparated(); |
| 641 if (data.distribution() != ContentDistributionDefault) | 648 if (data.distribution() != ContentDistributionDefault) |
| 642 result->append(*CSSPrimitiveValue::create(data.distribution())); | 649 result->append(*CSSIdentifierValue::create(data.distribution())); |
| 643 if (data.distribution() == ContentDistributionDefault || | 650 if (data.distribution() == ContentDistributionDefault || |
| 644 data.position() != ContentPositionNormal) { | 651 data.position() != ContentPositionNormal) { |
| 645 if (!RuntimeEnabledFeatures::cssGridLayoutEnabled() && | 652 if (!RuntimeEnabledFeatures::cssGridLayoutEnabled() && |
| 646 data.position() == ContentPositionNormal) | 653 data.position() == ContentPositionNormal) |
| 647 result->append( | 654 result->append(*CSSIdentifierValue::create(normalBehaviorValueID)); |
| 648 *CSSPrimitiveValue::createIdentifier(normalBehaviorValueID)); | |
| 649 else | 655 else |
| 650 result->append(*CSSPrimitiveValue::create(data.position())); | 656 result->append(*CSSIdentifierValue::create(data.position())); |
| 651 } | 657 } |
| 652 if ((data.position() >= ContentPositionCenter || | 658 if ((data.position() >= ContentPositionCenter || |
| 653 data.distribution() != ContentDistributionDefault) && | 659 data.distribution() != ContentDistributionDefault) && |
| 654 data.overflow() != OverflowAlignmentDefault) | 660 data.overflow() != OverflowAlignmentDefault) |
| 655 result->append(*CSSPrimitiveValue::create(data.overflow())); | 661 result->append(*CSSIdentifierValue::create(data.overflow())); |
| 656 ASSERT(result->length() > 0); | 662 ASSERT(result->length() > 0); |
| 657 ASSERT(result->length() <= 3); | 663 ASSERT(result->length() <= 3); |
| 658 return result; | 664 return result; |
| 659 } | 665 } |
| 660 | 666 |
| 661 static CSSPrimitiveValue* valueForLineHeight(const ComputedStyle& style) { | 667 static CSSValue* valueForLineHeight(const ComputedStyle& style) { |
| 662 Length length = style.lineHeight(); | 668 Length length = style.lineHeight(); |
| 663 if (length.isNegative()) | 669 if (length.isNegative()) |
| 664 return CSSPrimitiveValue::createIdentifier(CSSValueNormal); | 670 return CSSIdentifierValue::create(CSSValueNormal); |
| 665 | 671 |
| 666 return zoomAdjustedPixelValue( | 672 return zoomAdjustedPixelValue( |
| 667 floatValueForLength(length, style.getFontDescription().computedSize()), | 673 floatValueForLength(length, style.getFontDescription().computedSize()), |
| 668 style); | 674 style); |
| 669 } | 675 } |
| 670 | 676 |
| 671 static CSSValue* valueForPosition(const LengthPoint& position, | 677 static CSSValue* valueForPosition(const LengthPoint& position, |
| 672 const ComputedStyle& style) { | 678 const ComputedStyle& style) { |
| 673 DCHECK((position.x() == Auto) == (position.y() == Auto)); | 679 DCHECK((position.x() == Auto) == (position.y() == Auto)); |
| 674 if (position.x() == Auto) { | 680 if (position.x() == Auto) { |
| 675 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); | 681 return CSSIdentifierValue::create(CSSValueAuto); |
| 676 } | 682 } |
| 677 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 683 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
| 678 list->append(*zoomAdjustedPixelValueForLength(position.x(), style)); | 684 list->append(*zoomAdjustedPixelValueForLength(position.x(), style)); |
| 679 list->append(*zoomAdjustedPixelValueForLength(position.y(), style)); | 685 list->append(*zoomAdjustedPixelValueForLength(position.y(), style)); |
| 680 return list; | 686 return list; |
| 681 } | 687 } |
| 682 | 688 |
| 683 static CSSValueID identifierForFamily(const AtomicString& family) { | 689 static CSSValueID identifierForFamily(const AtomicString& family) { |
| 684 if (family == FontFamilyNames::webkit_cursive) | 690 if (family == FontFamilyNames::webkit_cursive) |
| 685 return CSSValueCursive; | 691 return CSSValueCursive; |
| 686 if (family == FontFamilyNames::webkit_fantasy) | 692 if (family == FontFamilyNames::webkit_fantasy) |
| 687 return CSSValueFantasy; | 693 return CSSValueFantasy; |
| 688 if (family == FontFamilyNames::webkit_monospace) | 694 if (family == FontFamilyNames::webkit_monospace) |
| 689 return CSSValueMonospace; | 695 return CSSValueMonospace; |
| 690 if (family == FontFamilyNames::webkit_pictograph) | 696 if (family == FontFamilyNames::webkit_pictograph) |
| 691 return CSSValueWebkitPictograph; | 697 return CSSValueWebkitPictograph; |
| 692 if (family == FontFamilyNames::webkit_sans_serif) | 698 if (family == FontFamilyNames::webkit_sans_serif) |
| 693 return CSSValueSansSerif; | 699 return CSSValueSansSerif; |
| 694 if (family == FontFamilyNames::webkit_serif) | 700 if (family == FontFamilyNames::webkit_serif) |
| 695 return CSSValueSerif; | 701 return CSSValueSerif; |
| 696 return CSSValueInvalid; | 702 return CSSValueInvalid; |
| 697 } | 703 } |
| 698 | 704 |
| 699 static CSSValue* valueForFamily(const AtomicString& family) { | 705 static CSSValue* valueForFamily(const AtomicString& family) { |
| 700 if (CSSValueID familyIdentifier = identifierForFamily(family)) | 706 if (CSSValueID familyIdentifier = identifierForFamily(family)) |
| 701 return CSSPrimitiveValue::createIdentifier(familyIdentifier); | 707 return CSSIdentifierValue::create(familyIdentifier); |
| 702 return CSSFontFamilyValue::create(family.getString()); | 708 return CSSFontFamilyValue::create(family.getString()); |
| 703 } | 709 } |
| 704 | 710 |
| 705 static CSSValueList* valueForFontFamily(const ComputedStyle& style) { | 711 static CSSValueList* valueForFontFamily(const ComputedStyle& style) { |
| 706 const FontFamily& firstFamily = style.getFontDescription().family(); | 712 const FontFamily& firstFamily = style.getFontDescription().family(); |
| 707 CSSValueList* list = CSSValueList::createCommaSeparated(); | 713 CSSValueList* list = CSSValueList::createCommaSeparated(); |
| 708 for (const FontFamily* family = &firstFamily; family; family = family->next()) | 714 for (const FontFamily* family = &firstFamily; family; family = family->next()) |
| 709 list->append(*valueForFamily(family->family())); | 715 list->append(*valueForFamily(family->family())); |
| 710 return list; | 716 return list; |
| 711 } | 717 } |
| 712 | 718 |
| 713 static CSSPrimitiveValue* valueForFontSize(const ComputedStyle& style) { | 719 static CSSPrimitiveValue* valueForFontSize(const ComputedStyle& style) { |
| 714 return zoomAdjustedPixelValue(style.getFontDescription().computedSize(), | 720 return zoomAdjustedPixelValue(style.getFontDescription().computedSize(), |
| 715 style); | 721 style); |
| 716 } | 722 } |
| 717 | 723 |
| 718 static CSSPrimitiveValue* valueForFontStretch(const ComputedStyle& style) { | 724 static CSSIdentifierValue* valueForFontStretch(const ComputedStyle& style) { |
| 719 return CSSPrimitiveValue::create(style.getFontDescription().stretch()); | 725 return CSSIdentifierValue::create(style.getFontDescription().stretch()); |
| 720 } | 726 } |
| 721 | 727 |
| 722 static CSSPrimitiveValue* valueForFontStyle(const ComputedStyle& style) { | 728 static CSSIdentifierValue* valueForFontStyle(const ComputedStyle& style) { |
| 723 return CSSPrimitiveValue::create(style.getFontDescription().style()); | 729 return CSSIdentifierValue::create(style.getFontDescription().style()); |
| 724 } | 730 } |
| 725 | 731 |
| 726 static CSSPrimitiveValue* valueForFontWeight(const ComputedStyle& style) { | 732 static CSSIdentifierValue* valueForFontWeight(const ComputedStyle& style) { |
| 727 return CSSPrimitiveValue::create(style.getFontDescription().weight()); | 733 return CSSIdentifierValue::create(style.getFontDescription().weight()); |
| 728 } | 734 } |
| 729 | 735 |
| 730 static CSSPrimitiveValue* valueForFontVariantCaps(const ComputedStyle& style) { | 736 static CSSIdentifierValue* valueForFontVariantCaps(const ComputedStyle& style) { |
| 731 FontDescription::FontVariantCaps variantCaps = | 737 FontDescription::FontVariantCaps variantCaps = |
| 732 style.getFontDescription().variantCaps(); | 738 style.getFontDescription().variantCaps(); |
| 733 switch (variantCaps) { | 739 switch (variantCaps) { |
| 734 case FontDescription::CapsNormal: | 740 case FontDescription::CapsNormal: |
| 735 return CSSPrimitiveValue::createIdentifier(CSSValueNormal); | 741 return CSSIdentifierValue::create(CSSValueNormal); |
| 736 case FontDescription::SmallCaps: | 742 case FontDescription::SmallCaps: |
| 737 return CSSPrimitiveValue::createIdentifier(CSSValueSmallCaps); | 743 return CSSIdentifierValue::create(CSSValueSmallCaps); |
| 738 case FontDescription::AllSmallCaps: | 744 case FontDescription::AllSmallCaps: |
| 739 return CSSPrimitiveValue::createIdentifier(CSSValueAllSmallCaps); | 745 return CSSIdentifierValue::create(CSSValueAllSmallCaps); |
| 740 case FontDescription::PetiteCaps: | 746 case FontDescription::PetiteCaps: |
| 741 return CSSPrimitiveValue::createIdentifier(CSSValuePetiteCaps); | 747 return CSSIdentifierValue::create(CSSValuePetiteCaps); |
| 742 case FontDescription::AllPetiteCaps: | 748 case FontDescription::AllPetiteCaps: |
| 743 return CSSPrimitiveValue::createIdentifier(CSSValueAllPetiteCaps); | 749 return CSSIdentifierValue::create(CSSValueAllPetiteCaps); |
| 744 case FontDescription::Unicase: | 750 case FontDescription::Unicase: |
| 745 return CSSPrimitiveValue::createIdentifier(CSSValueUnicase); | 751 return CSSIdentifierValue::create(CSSValueUnicase); |
| 746 case FontDescription::TitlingCaps: | 752 case FontDescription::TitlingCaps: |
| 747 return CSSPrimitiveValue::createIdentifier(CSSValueTitlingCaps); | 753 return CSSIdentifierValue::create(CSSValueTitlingCaps); |
| 748 default: | 754 default: |
| 749 NOTREACHED(); | 755 NOTREACHED(); |
| 750 return nullptr; | 756 return nullptr; |
| 751 } | 757 } |
| 752 } | 758 } |
| 753 | 759 |
| 754 static CSSValue* valueForFontVariantLigatures(const ComputedStyle& style) { | 760 static CSSValue* valueForFontVariantLigatures(const ComputedStyle& style) { |
| 755 FontDescription::LigaturesState commonLigaturesState = | 761 FontDescription::LigaturesState commonLigaturesState = |
| 756 style.getFontDescription().commonLigaturesState(); | 762 style.getFontDescription().commonLigaturesState(); |
| 757 FontDescription::LigaturesState discretionaryLigaturesState = | 763 FontDescription::LigaturesState discretionaryLigaturesState = |
| 758 style.getFontDescription().discretionaryLigaturesState(); | 764 style.getFontDescription().discretionaryLigaturesState(); |
| 759 FontDescription::LigaturesState historicalLigaturesState = | 765 FontDescription::LigaturesState historicalLigaturesState = |
| 760 style.getFontDescription().historicalLigaturesState(); | 766 style.getFontDescription().historicalLigaturesState(); |
| 761 FontDescription::LigaturesState contextualLigaturesState = | 767 FontDescription::LigaturesState contextualLigaturesState = |
| 762 style.getFontDescription().contextualLigaturesState(); | 768 style.getFontDescription().contextualLigaturesState(); |
| 763 if (commonLigaturesState == FontDescription::NormalLigaturesState && | 769 if (commonLigaturesState == FontDescription::NormalLigaturesState && |
| 764 discretionaryLigaturesState == FontDescription::NormalLigaturesState && | 770 discretionaryLigaturesState == FontDescription::NormalLigaturesState && |
| 765 historicalLigaturesState == FontDescription::NormalLigaturesState && | 771 historicalLigaturesState == FontDescription::NormalLigaturesState && |
| 766 contextualLigaturesState == FontDescription::NormalLigaturesState) | 772 contextualLigaturesState == FontDescription::NormalLigaturesState) |
| 767 return CSSPrimitiveValue::createIdentifier(CSSValueNormal); | 773 return CSSIdentifierValue::create(CSSValueNormal); |
| 768 | 774 |
| 769 if (commonLigaturesState == FontDescription::DisabledLigaturesState && | 775 if (commonLigaturesState == FontDescription::DisabledLigaturesState && |
| 770 discretionaryLigaturesState == FontDescription::DisabledLigaturesState && | 776 discretionaryLigaturesState == FontDescription::DisabledLigaturesState && |
| 771 historicalLigaturesState == FontDescription::DisabledLigaturesState && | 777 historicalLigaturesState == FontDescription::DisabledLigaturesState && |
| 772 contextualLigaturesState == FontDescription::DisabledLigaturesState) | 778 contextualLigaturesState == FontDescription::DisabledLigaturesState) |
| 773 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 779 return CSSIdentifierValue::create(CSSValueNone); |
| 774 | 780 |
| 775 CSSValueList* valueList = CSSValueList::createSpaceSeparated(); | 781 CSSValueList* valueList = CSSValueList::createSpaceSeparated(); |
| 776 if (commonLigaturesState != FontDescription::NormalLigaturesState) | 782 if (commonLigaturesState != FontDescription::NormalLigaturesState) |
| 777 valueList->append(*CSSPrimitiveValue::createIdentifier( | 783 valueList->append(*CSSIdentifierValue::create( |
| 778 commonLigaturesState == FontDescription::DisabledLigaturesState | 784 commonLigaturesState == FontDescription::DisabledLigaturesState |
| 779 ? CSSValueNoCommonLigatures | 785 ? CSSValueNoCommonLigatures |
| 780 : CSSValueCommonLigatures)); | 786 : CSSValueCommonLigatures)); |
| 781 if (discretionaryLigaturesState != FontDescription::NormalLigaturesState) | 787 if (discretionaryLigaturesState != FontDescription::NormalLigaturesState) |
| 782 valueList->append(*CSSPrimitiveValue::createIdentifier( | 788 valueList->append(*CSSIdentifierValue::create( |
| 783 discretionaryLigaturesState == FontDescription::DisabledLigaturesState | 789 discretionaryLigaturesState == FontDescription::DisabledLigaturesState |
| 784 ? CSSValueNoDiscretionaryLigatures | 790 ? CSSValueNoDiscretionaryLigatures |
| 785 : CSSValueDiscretionaryLigatures)); | 791 : CSSValueDiscretionaryLigatures)); |
| 786 if (historicalLigaturesState != FontDescription::NormalLigaturesState) | 792 if (historicalLigaturesState != FontDescription::NormalLigaturesState) |
| 787 valueList->append(*CSSPrimitiveValue::createIdentifier( | 793 valueList->append(*CSSIdentifierValue::create( |
| 788 historicalLigaturesState == FontDescription::DisabledLigaturesState | 794 historicalLigaturesState == FontDescription::DisabledLigaturesState |
| 789 ? CSSValueNoHistoricalLigatures | 795 ? CSSValueNoHistoricalLigatures |
| 790 : CSSValueHistoricalLigatures)); | 796 : CSSValueHistoricalLigatures)); |
| 791 if (contextualLigaturesState != FontDescription::NormalLigaturesState) | 797 if (contextualLigaturesState != FontDescription::NormalLigaturesState) |
| 792 valueList->append(*CSSPrimitiveValue::createIdentifier( | 798 valueList->append(*CSSIdentifierValue::create( |
| 793 contextualLigaturesState == FontDescription::DisabledLigaturesState | 799 contextualLigaturesState == FontDescription::DisabledLigaturesState |
| 794 ? CSSValueNoContextual | 800 ? CSSValueNoContextual |
| 795 : CSSValueContextual)); | 801 : CSSValueContextual)); |
| 796 return valueList; | 802 return valueList; |
| 797 } | 803 } |
| 798 | 804 |
| 799 static CSSValue* valueForFontVariantNumeric(const ComputedStyle& style) { | 805 static CSSValue* valueForFontVariantNumeric(const ComputedStyle& style) { |
| 800 FontVariantNumeric variantNumeric = | 806 FontVariantNumeric variantNumeric = |
| 801 style.getFontDescription().variantNumeric(); | 807 style.getFontDescription().variantNumeric(); |
| 802 if (variantNumeric.isAllNormal()) | 808 if (variantNumeric.isAllNormal()) |
| 803 return CSSPrimitiveValue::createIdentifier(CSSValueNormal); | 809 return CSSIdentifierValue::create(CSSValueNormal); |
| 804 | 810 |
| 805 CSSValueList* valueList = CSSValueList::createSpaceSeparated(); | 811 CSSValueList* valueList = CSSValueList::createSpaceSeparated(); |
| 806 if (variantNumeric.numericFigureValue() != FontVariantNumeric::NormalFigure) | 812 if (variantNumeric.numericFigureValue() != FontVariantNumeric::NormalFigure) |
| 807 valueList->append(*CSSPrimitiveValue::createIdentifier( | 813 valueList->append(*CSSIdentifierValue::create( |
| 808 variantNumeric.numericFigureValue() == FontVariantNumeric::LiningNums | 814 variantNumeric.numericFigureValue() == FontVariantNumeric::LiningNums |
| 809 ? CSSValueLiningNums | 815 ? CSSValueLiningNums |
| 810 : CSSValueOldstyleNums)); | 816 : CSSValueOldstyleNums)); |
| 811 if (variantNumeric.numericSpacingValue() != FontVariantNumeric::NormalSpacing) | 817 if (variantNumeric.numericSpacingValue() != |
| 812 valueList->append(*CSSPrimitiveValue::createIdentifier( | 818 FontVariantNumeric::NormalSpacing) { |
| 813 variantNumeric.numericSpacingValue() == | 819 valueList->append( |
| 814 FontVariantNumeric::ProportionalNums | 820 *CSSIdentifierValue::create(variantNumeric.numericSpacingValue() == |
| 815 ? CSSValueProportionalNums | 821 FontVariantNumeric::ProportionalNums |
| 816 : CSSValueTabularNums)); | 822 ? CSSValueProportionalNums |
| 823 : CSSValueTabularNums)); |
| 824 } |
| 817 if (variantNumeric.numericFractionValue() != | 825 if (variantNumeric.numericFractionValue() != |
| 818 FontVariantNumeric::NormalFraction) | 826 FontVariantNumeric::NormalFraction) |
| 819 valueList->append(*CSSPrimitiveValue::createIdentifier( | 827 valueList->append(*CSSIdentifierValue::create( |
| 820 variantNumeric.numericFractionValue() == | 828 variantNumeric.numericFractionValue() == |
| 821 FontVariantNumeric::DiagonalFractions | 829 FontVariantNumeric::DiagonalFractions |
| 822 ? CSSValueDiagonalFractions | 830 ? CSSValueDiagonalFractions |
| 823 : CSSValueStackedFractions)); | 831 : CSSValueStackedFractions)); |
| 824 if (variantNumeric.ordinalValue() == FontVariantNumeric::OrdinalOn) | 832 if (variantNumeric.ordinalValue() == FontVariantNumeric::OrdinalOn) |
| 825 valueList->append(*CSSPrimitiveValue::createIdentifier(CSSValueOrdinal)); | 833 valueList->append(*CSSIdentifierValue::create(CSSValueOrdinal)); |
| 826 if (variantNumeric.slashedZeroValue() == FontVariantNumeric::SlashedZeroOn) | 834 if (variantNumeric.slashedZeroValue() == FontVariantNumeric::SlashedZeroOn) |
| 827 valueList->append( | 835 valueList->append(*CSSIdentifierValue::create(CSSValueSlashedZero)); |
| 828 *CSSPrimitiveValue::createIdentifier(CSSValueSlashedZero)); | |
| 829 | 836 |
| 830 return valueList; | 837 return valueList; |
| 831 } | 838 } |
| 832 | 839 |
| 833 static CSSValue* specifiedValueForGridTrackBreadth( | 840 static CSSValue* specifiedValueForGridTrackBreadth( |
| 834 const GridLength& trackBreadth, | 841 const GridLength& trackBreadth, |
| 835 const ComputedStyle& style) { | 842 const ComputedStyle& style) { |
| 836 if (!trackBreadth.isLength()) | 843 if (!trackBreadth.isLength()) |
| 837 return CSSPrimitiveValue::create(trackBreadth.flex(), | 844 return CSSPrimitiveValue::create(trackBreadth.flex(), |
| 838 CSSPrimitiveValue::UnitType::Fraction); | 845 CSSPrimitiveValue::UnitType::Fraction); |
| 839 | 846 |
| 840 const Length& trackBreadthLength = trackBreadth.length(); | 847 const Length& trackBreadthLength = trackBreadth.length(); |
| 841 if (trackBreadthLength.isAuto()) | 848 if (trackBreadthLength.isAuto()) |
| 842 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); | 849 return CSSIdentifierValue::create(CSSValueAuto); |
| 843 return zoomAdjustedPixelValueForLength(trackBreadthLength, style); | 850 return zoomAdjustedPixelValueForLength(trackBreadthLength, style); |
| 844 } | 851 } |
| 845 | 852 |
| 846 static CSSValue* specifiedValueForGridTrackSize(const GridTrackSize& trackSize, | 853 static CSSValue* specifiedValueForGridTrackSize(const GridTrackSize& trackSize, |
| 847 const ComputedStyle& style) { | 854 const ComputedStyle& style) { |
| 848 switch (trackSize.type()) { | 855 switch (trackSize.type()) { |
| 849 case LengthTrackSizing: | 856 case LengthTrackSizing: |
| 850 return specifiedValueForGridTrackBreadth(trackSize.minTrackBreadth(), | 857 return specifiedValueForGridTrackBreadth(trackSize.minTrackBreadth(), |
| 851 style); | 858 style); |
| 852 case MinMaxTrackSizing: { | 859 case MinMaxTrackSizing: { |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 999 trackSizes.isEmpty() && autoRepeatTrackSizes.isEmpty(); | 1006 trackSizes.isEmpty() && autoRepeatTrackSizes.isEmpty(); |
| 1000 if (isLayoutGrid && trackListIsEmpty) { | 1007 if (isLayoutGrid && trackListIsEmpty) { |
| 1001 // For grids we should consider every listed track, whether implicitly or ex
plicitly | 1008 // For grids we should consider every listed track, whether implicitly or ex
plicitly |
| 1002 // created. Empty grids have a sole grid line per axis. | 1009 // created. Empty grids have a sole grid line per axis. |
| 1003 auto& positions = isRowAxis ? toLayoutGrid(layoutObject)->columnPositions() | 1010 auto& positions = isRowAxis ? toLayoutGrid(layoutObject)->columnPositions() |
| 1004 : toLayoutGrid(layoutObject)->rowPositions(); | 1011 : toLayoutGrid(layoutObject)->rowPositions(); |
| 1005 trackListIsEmpty = positions.size() == 1; | 1012 trackListIsEmpty = positions.size() == 1; |
| 1006 } | 1013 } |
| 1007 | 1014 |
| 1008 if (trackListIsEmpty) | 1015 if (trackListIsEmpty) |
| 1009 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 1016 return CSSIdentifierValue::create(CSSValueNone); |
| 1010 | 1017 |
| 1011 size_t autoRepeatTotalTracks = | 1018 size_t autoRepeatTotalTracks = |
| 1012 isLayoutGrid | 1019 isLayoutGrid |
| 1013 ? toLayoutGrid(layoutObject)->autoRepeatCountForDirection(direction) | 1020 ? toLayoutGrid(layoutObject)->autoRepeatCountForDirection(direction) |
| 1014 : 0; | 1021 : 0; |
| 1015 OrderedNamedLinesCollector collector(style, isRowAxis, autoRepeatTotalTracks); | 1022 OrderedNamedLinesCollector collector(style, isRowAxis, autoRepeatTotalTracks); |
| 1016 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 1023 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
| 1017 size_t insertionIndex; | 1024 size_t insertionIndex; |
| 1018 if (isLayoutGrid) { | 1025 if (isLayoutGrid) { |
| 1019 const auto* grid = toLayoutGrid(layoutObject); | 1026 const auto* grid = toLayoutGrid(layoutObject); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1035 } | 1042 } |
| 1036 insertionIndex = trackSizes.size(); | 1043 insertionIndex = trackSizes.size(); |
| 1037 } | 1044 } |
| 1038 // Those are the trailing <string>* allowed in the syntax. | 1045 // Those are the trailing <string>* allowed in the syntax. |
| 1039 addValuesForNamedGridLinesAtIndex(collector, insertionIndex, *list); | 1046 addValuesForNamedGridLinesAtIndex(collector, insertionIndex, *list); |
| 1040 return list; | 1047 return list; |
| 1041 } | 1048 } |
| 1042 | 1049 |
| 1043 static CSSValue* valueForGridPosition(const GridPosition& position) { | 1050 static CSSValue* valueForGridPosition(const GridPosition& position) { |
| 1044 if (position.isAuto()) | 1051 if (position.isAuto()) |
| 1045 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); | 1052 return CSSIdentifierValue::create(CSSValueAuto); |
| 1046 | 1053 |
| 1047 if (position.isNamedGridArea()) | 1054 if (position.isNamedGridArea()) |
| 1048 return CSSCustomIdentValue::create(position.namedGridLine()); | 1055 return CSSCustomIdentValue::create(position.namedGridLine()); |
| 1049 | 1056 |
| 1050 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 1057 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
| 1051 if (position.isSpan()) { | 1058 if (position.isSpan()) { |
| 1052 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueSpan)); | 1059 list->append(*CSSIdentifierValue::create(CSSValueSpan)); |
| 1053 list->append(*CSSPrimitiveValue::create( | 1060 list->append(*CSSPrimitiveValue::create( |
| 1054 position.spanPosition(), CSSPrimitiveValue::UnitType::Number)); | 1061 position.spanPosition(), CSSPrimitiveValue::UnitType::Number)); |
| 1055 } else { | 1062 } else { |
| 1056 list->append(*CSSPrimitiveValue::create( | 1063 list->append(*CSSPrimitiveValue::create( |
| 1057 position.integerPosition(), CSSPrimitiveValue::UnitType::Number)); | 1064 position.integerPosition(), CSSPrimitiveValue::UnitType::Number)); |
| 1058 } | 1065 } |
| 1059 | 1066 |
| 1060 if (!position.namedGridLine().isNull()) | 1067 if (!position.namedGridLine().isNull()) |
| 1061 list->append(*CSSCustomIdentValue::create(position.namedGridLine())); | 1068 list->append(*CSSCustomIdentValue::create(position.namedGridLine())); |
| 1062 return list; | 1069 return list; |
| 1063 } | 1070 } |
| 1064 | 1071 |
| 1065 static LayoutRect sizingBox(const LayoutObject* layoutObject) { | 1072 static LayoutRect sizingBox(const LayoutObject* layoutObject) { |
| 1066 if (!layoutObject->isBox()) | 1073 if (!layoutObject->isBox()) |
| 1067 return LayoutRect(); | 1074 return LayoutRect(); |
| 1068 | 1075 |
| 1069 const LayoutBox* box = toLayoutBox(layoutObject); | 1076 const LayoutBox* box = toLayoutBox(layoutObject); |
| 1070 return box->style()->boxSizing() == BoxSizingBorderBox | 1077 return box->style()->boxSizing() == BoxSizingBorderBox |
| 1071 ? box->borderBoxRect() | 1078 ? box->borderBoxRect() |
| 1072 : box->computedCSSContentBoxRect(); | 1079 : box->computedCSSContentBoxRect(); |
| 1073 } | 1080 } |
| 1074 | 1081 |
| 1075 static CSSValue* renderTextDecorationFlagsToCSSValue(int textDecoration) { | 1082 static CSSValue* renderTextDecorationFlagsToCSSValue(int textDecoration) { |
| 1076 // Blink value is ignored. | 1083 // Blink value is ignored. |
| 1077 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 1084 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
| 1078 if (textDecoration & TextDecorationUnderline) | 1085 if (textDecoration & TextDecorationUnderline) |
| 1079 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueUnderline)); | 1086 list->append(*CSSIdentifierValue::create(CSSValueUnderline)); |
| 1080 if (textDecoration & TextDecorationOverline) | 1087 if (textDecoration & TextDecorationOverline) |
| 1081 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueOverline)); | 1088 list->append(*CSSIdentifierValue::create(CSSValueOverline)); |
| 1082 if (textDecoration & TextDecorationLineThrough) | 1089 if (textDecoration & TextDecorationLineThrough) |
| 1083 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueLineThrough)); | 1090 list->append(*CSSIdentifierValue::create(CSSValueLineThrough)); |
| 1084 | 1091 |
| 1085 if (!list->length()) | 1092 if (!list->length()) |
| 1086 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 1093 return CSSIdentifierValue::create(CSSValueNone); |
| 1087 return list; | 1094 return list; |
| 1088 } | 1095 } |
| 1089 | 1096 |
| 1090 static CSSValue* valueForTextDecorationStyle( | 1097 static CSSValue* valueForTextDecorationStyle( |
| 1091 TextDecorationStyle textDecorationStyle) { | 1098 TextDecorationStyle textDecorationStyle) { |
| 1092 switch (textDecorationStyle) { | 1099 switch (textDecorationStyle) { |
| 1093 case TextDecorationStyleSolid: | 1100 case TextDecorationStyleSolid: |
| 1094 return CSSPrimitiveValue::createIdentifier(CSSValueSolid); | 1101 return CSSIdentifierValue::create(CSSValueSolid); |
| 1095 case TextDecorationStyleDouble: | 1102 case TextDecorationStyleDouble: |
| 1096 return CSSPrimitiveValue::createIdentifier(CSSValueDouble); | 1103 return CSSIdentifierValue::create(CSSValueDouble); |
| 1097 case TextDecorationStyleDotted: | 1104 case TextDecorationStyleDotted: |
| 1098 return CSSPrimitiveValue::createIdentifier(CSSValueDotted); | 1105 return CSSIdentifierValue::create(CSSValueDotted); |
| 1099 case TextDecorationStyleDashed: | 1106 case TextDecorationStyleDashed: |
| 1100 return CSSPrimitiveValue::createIdentifier(CSSValueDashed); | 1107 return CSSIdentifierValue::create(CSSValueDashed); |
| 1101 case TextDecorationStyleWavy: | 1108 case TextDecorationStyleWavy: |
| 1102 return CSSPrimitiveValue::createIdentifier(CSSValueWavy); | 1109 return CSSIdentifierValue::create(CSSValueWavy); |
| 1103 } | 1110 } |
| 1104 | 1111 |
| 1105 ASSERT_NOT_REACHED(); | 1112 ASSERT_NOT_REACHED(); |
| 1106 return CSSInitialValue::create(); | 1113 return CSSInitialValue::create(); |
| 1107 } | 1114 } |
| 1108 | 1115 |
| 1109 static CSSValue* touchActionFlagsToCSSValue(TouchAction touchAction) { | 1116 static CSSValue* touchActionFlagsToCSSValue(TouchAction touchAction) { |
| 1110 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 1117 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
| 1111 if (touchAction == TouchActionAuto) { | 1118 if (touchAction == TouchActionAuto) { |
| 1112 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueAuto)); | 1119 list->append(*CSSIdentifierValue::create(CSSValueAuto)); |
| 1113 } else if (touchAction == TouchActionNone) { | 1120 } else if (touchAction == TouchActionNone) { |
| 1114 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueNone)); | 1121 list->append(*CSSIdentifierValue::create(CSSValueNone)); |
| 1115 } else if (touchAction == TouchActionManipulation) { | 1122 } else if (touchAction == TouchActionManipulation) { |
| 1116 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueManipulation)); | 1123 list->append(*CSSIdentifierValue::create(CSSValueManipulation)); |
| 1117 } else { | 1124 } else { |
| 1118 if ((touchAction & TouchActionPanX) == TouchActionPanX) | 1125 if ((touchAction & TouchActionPanX) == TouchActionPanX) |
| 1119 list->append(*CSSPrimitiveValue::createIdentifier(CSSValuePanX)); | 1126 list->append(*CSSIdentifierValue::create(CSSValuePanX)); |
| 1120 else if (touchAction & TouchActionPanLeft) | 1127 else if (touchAction & TouchActionPanLeft) |
| 1121 list->append(*CSSPrimitiveValue::createIdentifier(CSSValuePanLeft)); | 1128 list->append(*CSSIdentifierValue::create(CSSValuePanLeft)); |
| 1122 else if (touchAction & TouchActionPanRight) | 1129 else if (touchAction & TouchActionPanRight) |
| 1123 list->append(*CSSPrimitiveValue::createIdentifier(CSSValuePanRight)); | 1130 list->append(*CSSIdentifierValue::create(CSSValuePanRight)); |
| 1124 if ((touchAction & TouchActionPanY) == TouchActionPanY) | 1131 if ((touchAction & TouchActionPanY) == TouchActionPanY) |
| 1125 list->append(*CSSPrimitiveValue::createIdentifier(CSSValuePanY)); | 1132 list->append(*CSSIdentifierValue::create(CSSValuePanY)); |
| 1126 else if (touchAction & TouchActionPanUp) | 1133 else if (touchAction & TouchActionPanUp) |
| 1127 list->append(*CSSPrimitiveValue::createIdentifier(CSSValuePanUp)); | 1134 list->append(*CSSIdentifierValue::create(CSSValuePanUp)); |
| 1128 else if (touchAction & TouchActionPanDown) | 1135 else if (touchAction & TouchActionPanDown) |
| 1129 list->append(*CSSPrimitiveValue::createIdentifier(CSSValuePanDown)); | 1136 list->append(*CSSIdentifierValue::create(CSSValuePanDown)); |
| 1130 | 1137 |
| 1131 if ((touchAction & TouchActionPinchZoom) == TouchActionPinchZoom) | 1138 if ((touchAction & TouchActionPinchZoom) == TouchActionPinchZoom) |
| 1132 list->append(*CSSPrimitiveValue::createIdentifier(CSSValuePinchZoom)); | 1139 list->append(*CSSIdentifierValue::create(CSSValuePinchZoom)); |
| 1133 } | 1140 } |
| 1134 | 1141 |
| 1135 ASSERT(list->length()); | 1142 ASSERT(list->length()); |
| 1136 return list; | 1143 return list; |
| 1137 } | 1144 } |
| 1138 | 1145 |
| 1139 static CSSValue* valueForWillChange( | 1146 static CSSValue* valueForWillChange( |
| 1140 const Vector<CSSPropertyID>& willChangeProperties, | 1147 const Vector<CSSPropertyID>& willChangeProperties, |
| 1141 bool willChangeContents, | 1148 bool willChangeContents, |
| 1142 bool willChangeScrollPosition) { | 1149 bool willChangeScrollPosition) { |
| 1143 CSSValueList* list = CSSValueList::createCommaSeparated(); | 1150 CSSValueList* list = CSSValueList::createCommaSeparated(); |
| 1144 if (willChangeContents) | 1151 if (willChangeContents) |
| 1145 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueContents)); | 1152 list->append(*CSSIdentifierValue::create(CSSValueContents)); |
| 1146 if (willChangeScrollPosition) | 1153 if (willChangeScrollPosition) |
| 1147 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueScrollPosition)); | 1154 list->append(*CSSIdentifierValue::create(CSSValueScrollPosition)); |
| 1148 for (size_t i = 0; i < willChangeProperties.size(); ++i) | 1155 for (size_t i = 0; i < willChangeProperties.size(); ++i) |
| 1149 list->append(*CSSCustomIdentValue::create(willChangeProperties[i])); | 1156 list->append(*CSSCustomIdentValue::create(willChangeProperties[i])); |
| 1150 if (!list->length()) | 1157 if (!list->length()) |
| 1151 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueAuto)); | 1158 list->append(*CSSIdentifierValue::create(CSSValueAuto)); |
| 1152 return list; | 1159 return list; |
| 1153 } | 1160 } |
| 1154 | 1161 |
| 1155 static CSSValue* valueForAnimationDelay(const CSSTimingData* timingData) { | 1162 static CSSValue* valueForAnimationDelay(const CSSTimingData* timingData) { |
| 1156 CSSValueList* list = CSSValueList::createCommaSeparated(); | 1163 CSSValueList* list = CSSValueList::createCommaSeparated(); |
| 1157 if (timingData) { | 1164 if (timingData) { |
| 1158 for (size_t i = 0; i < timingData->delayList().size(); ++i) | 1165 for (size_t i = 0; i < timingData->delayList().size(); ++i) |
| 1159 list->append(*CSSPrimitiveValue::create( | 1166 list->append(*CSSPrimitiveValue::create( |
| 1160 timingData->delayList()[i], CSSPrimitiveValue::UnitType::Seconds)); | 1167 timingData->delayList()[i], CSSPrimitiveValue::UnitType::Seconds)); |
| 1161 } else { | 1168 } else { |
| 1162 list->append(*CSSPrimitiveValue::create( | 1169 list->append(*CSSPrimitiveValue::create( |
| 1163 CSSTimingData::initialDelay(), CSSPrimitiveValue::UnitType::Seconds)); | 1170 CSSTimingData::initialDelay(), CSSPrimitiveValue::UnitType::Seconds)); |
| 1164 } | 1171 } |
| 1165 return list; | 1172 return list; |
| 1166 } | 1173 } |
| 1167 | 1174 |
| 1168 static CSSValue* valueForAnimationDirection( | 1175 static CSSValue* valueForAnimationDirection( |
| 1169 Timing::PlaybackDirection direction) { | 1176 Timing::PlaybackDirection direction) { |
| 1170 switch (direction) { | 1177 switch (direction) { |
| 1171 case Timing::PlaybackDirection::NORMAL: | 1178 case Timing::PlaybackDirection::NORMAL: |
| 1172 return CSSPrimitiveValue::createIdentifier(CSSValueNormal); | 1179 return CSSIdentifierValue::create(CSSValueNormal); |
| 1173 case Timing::PlaybackDirection::ALTERNATE_NORMAL: | 1180 case Timing::PlaybackDirection::ALTERNATE_NORMAL: |
| 1174 return CSSPrimitiveValue::createIdentifier(CSSValueAlternate); | 1181 return CSSIdentifierValue::create(CSSValueAlternate); |
| 1175 case Timing::PlaybackDirection::REVERSE: | 1182 case Timing::PlaybackDirection::REVERSE: |
| 1176 return CSSPrimitiveValue::createIdentifier(CSSValueReverse); | 1183 return CSSIdentifierValue::create(CSSValueReverse); |
| 1177 case Timing::PlaybackDirection::ALTERNATE_REVERSE: | 1184 case Timing::PlaybackDirection::ALTERNATE_REVERSE: |
| 1178 return CSSPrimitiveValue::createIdentifier(CSSValueAlternateReverse); | 1185 return CSSIdentifierValue::create(CSSValueAlternateReverse); |
| 1179 default: | 1186 default: |
| 1180 ASSERT_NOT_REACHED(); | 1187 ASSERT_NOT_REACHED(); |
| 1181 return nullptr; | 1188 return nullptr; |
| 1182 } | 1189 } |
| 1183 } | 1190 } |
| 1184 | 1191 |
| 1185 static CSSValue* valueForAnimationDuration(const CSSTimingData* timingData) { | 1192 static CSSValue* valueForAnimationDuration(const CSSTimingData* timingData) { |
| 1186 CSSValueList* list = CSSValueList::createCommaSeparated(); | 1193 CSSValueList* list = CSSValueList::createCommaSeparated(); |
| 1187 if (timingData) { | 1194 if (timingData) { |
| 1188 for (size_t i = 0; i < timingData->durationList().size(); ++i) | 1195 for (size_t i = 0; i < timingData->durationList().size(); ++i) |
| 1189 list->append(*CSSPrimitiveValue::create( | 1196 list->append(*CSSPrimitiveValue::create( |
| 1190 timingData->durationList()[i], CSSPrimitiveValue::UnitType::Seconds)); | 1197 timingData->durationList()[i], CSSPrimitiveValue::UnitType::Seconds)); |
| 1191 } else { | 1198 } else { |
| 1192 list->append( | 1199 list->append( |
| 1193 *CSSPrimitiveValue::create(CSSTimingData::initialDuration(), | 1200 *CSSPrimitiveValue::create(CSSTimingData::initialDuration(), |
| 1194 CSSPrimitiveValue::UnitType::Seconds)); | 1201 CSSPrimitiveValue::UnitType::Seconds)); |
| 1195 } | 1202 } |
| 1196 return list; | 1203 return list; |
| 1197 } | 1204 } |
| 1198 | 1205 |
| 1199 static CSSValue* valueForAnimationFillMode(Timing::FillMode fillMode) { | 1206 static CSSValue* valueForAnimationFillMode(Timing::FillMode fillMode) { |
| 1200 switch (fillMode) { | 1207 switch (fillMode) { |
| 1201 case Timing::FillMode::NONE: | 1208 case Timing::FillMode::NONE: |
| 1202 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 1209 return CSSIdentifierValue::create(CSSValueNone); |
| 1203 case Timing::FillMode::FORWARDS: | 1210 case Timing::FillMode::FORWARDS: |
| 1204 return CSSPrimitiveValue::createIdentifier(CSSValueForwards); | 1211 return CSSIdentifierValue::create(CSSValueForwards); |
| 1205 case Timing::FillMode::BACKWARDS: | 1212 case Timing::FillMode::BACKWARDS: |
| 1206 return CSSPrimitiveValue::createIdentifier(CSSValueBackwards); | 1213 return CSSIdentifierValue::create(CSSValueBackwards); |
| 1207 case Timing::FillMode::BOTH: | 1214 case Timing::FillMode::BOTH: |
| 1208 return CSSPrimitiveValue::createIdentifier(CSSValueBoth); | 1215 return CSSIdentifierValue::create(CSSValueBoth); |
| 1209 default: | 1216 default: |
| 1210 ASSERT_NOT_REACHED(); | 1217 ASSERT_NOT_REACHED(); |
| 1211 return nullptr; | 1218 return nullptr; |
| 1212 } | 1219 } |
| 1213 } | 1220 } |
| 1214 | 1221 |
| 1215 static CSSValue* valueForAnimationIterationCount(double iterationCount) { | 1222 static CSSValue* valueForAnimationIterationCount(double iterationCount) { |
| 1216 if (iterationCount == std::numeric_limits<double>::infinity()) | 1223 if (iterationCount == std::numeric_limits<double>::infinity()) |
| 1217 return CSSPrimitiveValue::createIdentifier(CSSValueInfinite); | 1224 return CSSIdentifierValue::create(CSSValueInfinite); |
| 1218 return CSSPrimitiveValue::create(iterationCount, | 1225 return CSSPrimitiveValue::create(iterationCount, |
| 1219 CSSPrimitiveValue::UnitType::Number); | 1226 CSSPrimitiveValue::UnitType::Number); |
| 1220 } | 1227 } |
| 1221 | 1228 |
| 1222 static CSSValue* valueForAnimationPlayState(EAnimPlayState playState) { | 1229 static CSSValue* valueForAnimationPlayState(EAnimPlayState playState) { |
| 1223 if (playState == AnimPlayStatePlaying) | 1230 if (playState == AnimPlayStatePlaying) |
| 1224 return CSSPrimitiveValue::createIdentifier(CSSValueRunning); | 1231 return CSSIdentifierValue::create(CSSValueRunning); |
| 1225 ASSERT(playState == AnimPlayStatePaused); | 1232 ASSERT(playState == AnimPlayStatePaused); |
| 1226 return CSSPrimitiveValue::createIdentifier(CSSValuePaused); | 1233 return CSSIdentifierValue::create(CSSValuePaused); |
| 1227 } | 1234 } |
| 1228 | 1235 |
| 1229 static CSSValue* createTimingFunctionValue( | 1236 static CSSValue* createTimingFunctionValue( |
| 1230 const TimingFunction* timingFunction) { | 1237 const TimingFunction* timingFunction) { |
| 1231 switch (timingFunction->getType()) { | 1238 switch (timingFunction->getType()) { |
| 1232 case TimingFunction::Type::CUBIC_BEZIER: { | 1239 case TimingFunction::Type::CUBIC_BEZIER: { |
| 1233 const CubicBezierTimingFunction* bezierTimingFunction = | 1240 const CubicBezierTimingFunction* bezierTimingFunction = |
| 1234 toCubicBezierTimingFunction(timingFunction); | 1241 toCubicBezierTimingFunction(timingFunction); |
| 1235 if (bezierTimingFunction->getEaseType() != | 1242 if (bezierTimingFunction->getEaseType() != |
| 1236 CubicBezierTimingFunction::EaseType::CUSTOM) { | 1243 CubicBezierTimingFunction::EaseType::CUSTOM) { |
| 1237 CSSValueID valueId = CSSValueInvalid; | 1244 CSSValueID valueId = CSSValueInvalid; |
| 1238 switch (bezierTimingFunction->getEaseType()) { | 1245 switch (bezierTimingFunction->getEaseType()) { |
| 1239 case CubicBezierTimingFunction::EaseType::EASE: | 1246 case CubicBezierTimingFunction::EaseType::EASE: |
| 1240 valueId = CSSValueEase; | 1247 valueId = CSSValueEase; |
| 1241 break; | 1248 break; |
| 1242 case CubicBezierTimingFunction::EaseType::EASE_IN: | 1249 case CubicBezierTimingFunction::EaseType::EASE_IN: |
| 1243 valueId = CSSValueEaseIn; | 1250 valueId = CSSValueEaseIn; |
| 1244 break; | 1251 break; |
| 1245 case CubicBezierTimingFunction::EaseType::EASE_OUT: | 1252 case CubicBezierTimingFunction::EaseType::EASE_OUT: |
| 1246 valueId = CSSValueEaseOut; | 1253 valueId = CSSValueEaseOut; |
| 1247 break; | 1254 break; |
| 1248 case CubicBezierTimingFunction::EaseType::EASE_IN_OUT: | 1255 case CubicBezierTimingFunction::EaseType::EASE_IN_OUT: |
| 1249 valueId = CSSValueEaseInOut; | 1256 valueId = CSSValueEaseInOut; |
| 1250 break; | 1257 break; |
| 1251 default: | 1258 default: |
| 1252 ASSERT_NOT_REACHED(); | 1259 ASSERT_NOT_REACHED(); |
| 1253 return nullptr; | 1260 return nullptr; |
| 1254 } | 1261 } |
| 1255 return CSSPrimitiveValue::createIdentifier(valueId); | 1262 return CSSIdentifierValue::create(valueId); |
| 1256 } | 1263 } |
| 1257 return CSSCubicBezierTimingFunctionValue::create( | 1264 return CSSCubicBezierTimingFunctionValue::create( |
| 1258 bezierTimingFunction->x1(), bezierTimingFunction->y1(), | 1265 bezierTimingFunction->x1(), bezierTimingFunction->y1(), |
| 1259 bezierTimingFunction->x2(), bezierTimingFunction->y2()); | 1266 bezierTimingFunction->x2(), bezierTimingFunction->y2()); |
| 1260 } | 1267 } |
| 1261 | 1268 |
| 1262 case TimingFunction::Type::STEPS: { | 1269 case TimingFunction::Type::STEPS: { |
| 1263 const StepsTimingFunction* stepsTimingFunction = | 1270 const StepsTimingFunction* stepsTimingFunction = |
| 1264 toStepsTimingFunction(timingFunction); | 1271 toStepsTimingFunction(timingFunction); |
| 1265 StepsTimingFunction::StepPosition position = | 1272 StepsTimingFunction::StepPosition position = |
| 1266 stepsTimingFunction->getStepPosition(); | 1273 stepsTimingFunction->getStepPosition(); |
| 1267 int steps = stepsTimingFunction->numberOfSteps(); | 1274 int steps = stepsTimingFunction->numberOfSteps(); |
| 1268 DCHECK(position == StepsTimingFunction::StepPosition::START || | 1275 DCHECK(position == StepsTimingFunction::StepPosition::START || |
| 1269 position == StepsTimingFunction::StepPosition::END); | 1276 position == StepsTimingFunction::StepPosition::END); |
| 1270 | 1277 |
| 1271 if (steps > 1) | 1278 if (steps > 1) |
| 1272 return CSSStepsTimingFunctionValue::create(steps, position); | 1279 return CSSStepsTimingFunctionValue::create(steps, position); |
| 1273 CSSValueID valueId = position == StepsTimingFunction::StepPosition::START | 1280 CSSValueID valueId = position == StepsTimingFunction::StepPosition::START |
| 1274 ? CSSValueStepStart | 1281 ? CSSValueStepStart |
| 1275 : CSSValueStepEnd; | 1282 : CSSValueStepEnd; |
| 1276 return CSSPrimitiveValue::createIdentifier(valueId); | 1283 return CSSIdentifierValue::create(valueId); |
| 1277 } | 1284 } |
| 1278 | 1285 |
| 1279 default: | 1286 default: |
| 1280 return CSSPrimitiveValue::createIdentifier(CSSValueLinear); | 1287 return CSSIdentifierValue::create(CSSValueLinear); |
| 1281 } | 1288 } |
| 1282 } | 1289 } |
| 1283 | 1290 |
| 1284 static CSSValue* valueForAnimationTimingFunction( | 1291 static CSSValue* valueForAnimationTimingFunction( |
| 1285 const CSSTimingData* timingData) { | 1292 const CSSTimingData* timingData) { |
| 1286 CSSValueList* list = CSSValueList::createCommaSeparated(); | 1293 CSSValueList* list = CSSValueList::createCommaSeparated(); |
| 1287 if (timingData) { | 1294 if (timingData) { |
| 1288 for (size_t i = 0; i < timingData->timingFunctionList().size(); ++i) | 1295 for (size_t i = 0; i < timingData->timingFunctionList().size(); ++i) |
| 1289 list->append(*createTimingFunctionValue( | 1296 list->append(*createTimingFunctionValue( |
| 1290 timingData->timingFunctionList()[i].get())); | 1297 timingData->timingFunctionList()[i].get())); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1372 transformValue->append(*CSSPrimitiveValue::create( | 1379 transformValue->append(*CSSPrimitiveValue::create( |
| 1373 transform.m44(), CSSPrimitiveValue::UnitType::Number)); | 1380 transform.m44(), CSSPrimitiveValue::UnitType::Number)); |
| 1374 } | 1381 } |
| 1375 | 1382 |
| 1376 return transformValue; | 1383 return transformValue; |
| 1377 } | 1384 } |
| 1378 | 1385 |
| 1379 static CSSValue* computedTransform(const LayoutObject* layoutObject, | 1386 static CSSValue* computedTransform(const LayoutObject* layoutObject, |
| 1380 const ComputedStyle& style) { | 1387 const ComputedStyle& style) { |
| 1381 if (!layoutObject || !style.hasTransform()) | 1388 if (!layoutObject || !style.hasTransform()) |
| 1382 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 1389 return CSSIdentifierValue::create(CSSValueNone); |
| 1383 | 1390 |
| 1384 IntRect box; | 1391 IntRect box; |
| 1385 if (layoutObject->isBox()) | 1392 if (layoutObject->isBox()) |
| 1386 box = pixelSnappedIntRect(toLayoutBox(layoutObject)->borderBoxRect()); | 1393 box = pixelSnappedIntRect(toLayoutBox(layoutObject)->borderBoxRect()); |
| 1387 | 1394 |
| 1388 TransformationMatrix transform; | 1395 TransformationMatrix transform; |
| 1389 style.applyTransform(transform, LayoutSize(box.size()), | 1396 style.applyTransform(transform, LayoutSize(box.size()), |
| 1390 ComputedStyle::ExcludeTransformOrigin, | 1397 ComputedStyle::ExcludeTransformOrigin, |
| 1391 ComputedStyle::ExcludeMotionPath, | 1398 ComputedStyle::ExcludeMotionPath, |
| 1392 ComputedStyle::ExcludeIndependentTransformProperties); | 1399 ComputedStyle::ExcludeIndependentTransformProperties); |
| 1393 | 1400 |
| 1394 // FIXME: Need to print out individual functions (https://bugs.webkit.org/show
_bug.cgi?id=23924) | 1401 // FIXME: Need to print out individual functions (https://bugs.webkit.org/show
_bug.cgi?id=23924) |
| 1395 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 1402 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
| 1396 list->append(*valueForMatrixTransform(transform, style)); | 1403 list->append(*valueForMatrixTransform(transform, style)); |
| 1397 | 1404 |
| 1398 return list; | 1405 return list; |
| 1399 } | 1406 } |
| 1400 | 1407 |
| 1401 static CSSValue* createTransitionPropertyValue( | 1408 static CSSValue* createTransitionPropertyValue( |
| 1402 const CSSTransitionData::TransitionProperty& property) { | 1409 const CSSTransitionData::TransitionProperty& property) { |
| 1403 if (property.propertyType == CSSTransitionData::TransitionNone) | 1410 if (property.propertyType == CSSTransitionData::TransitionNone) |
| 1404 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 1411 return CSSIdentifierValue::create(CSSValueNone); |
| 1405 if (property.propertyType == CSSTransitionData::TransitionUnknownProperty) | 1412 if (property.propertyType == CSSTransitionData::TransitionUnknownProperty) |
| 1406 return CSSCustomIdentValue::create(property.propertyString); | 1413 return CSSCustomIdentValue::create(property.propertyString); |
| 1407 ASSERT(property.propertyType == CSSTransitionData::TransitionKnownProperty); | 1414 ASSERT(property.propertyType == CSSTransitionData::TransitionKnownProperty); |
| 1408 return CSSCustomIdentValue::create( | 1415 return CSSCustomIdentValue::create( |
| 1409 getPropertyNameAtomicString(property.unresolvedProperty)); | 1416 getPropertyNameAtomicString(property.unresolvedProperty)); |
| 1410 } | 1417 } |
| 1411 | 1418 |
| 1412 static CSSValue* valueForTransitionProperty( | 1419 static CSSValue* valueForTransitionProperty( |
| 1413 const CSSTransitionData* transitionData) { | 1420 const CSSTransitionData* transitionData) { |
| 1414 CSSValueList* list = CSSValueList::createCommaSeparated(); | 1421 CSSValueList* list = CSSValueList::createCommaSeparated(); |
| 1415 if (transitionData) { | 1422 if (transitionData) { |
| 1416 for (size_t i = 0; i < transitionData->propertyList().size(); ++i) | 1423 for (size_t i = 0; i < transitionData->propertyList().size(); ++i) |
| 1417 list->append( | 1424 list->append( |
| 1418 *createTransitionPropertyValue(transitionData->propertyList()[i])); | 1425 *createTransitionPropertyValue(transitionData->propertyList()[i])); |
| 1419 } else { | 1426 } else { |
| 1420 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueAll)); | 1427 list->append(*CSSIdentifierValue::create(CSSValueAll)); |
| 1421 } | 1428 } |
| 1422 return list; | 1429 return list; |
| 1423 } | 1430 } |
| 1424 | 1431 |
| 1425 CSSValueID valueForQuoteType(const QuoteType quoteType) { | 1432 CSSValueID valueForQuoteType(const QuoteType quoteType) { |
| 1426 switch (quoteType) { | 1433 switch (quoteType) { |
| 1427 case NO_OPEN_QUOTE: | 1434 case NO_OPEN_QUOTE: |
| 1428 return CSSValueNoOpenQuote; | 1435 return CSSValueNoOpenQuote; |
| 1429 case NO_CLOSE_QUOTE: | 1436 case NO_CLOSE_QUOTE: |
| 1430 return CSSValueNoCloseQuote; | 1437 return CSSValueNoCloseQuote; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1445 const CounterContent* counter = | 1452 const CounterContent* counter = |
| 1446 toCounterContentData(contentData)->counter(); | 1453 toCounterContentData(contentData)->counter(); |
| 1447 ASSERT(counter); | 1454 ASSERT(counter); |
| 1448 CSSCustomIdentValue* identifier = | 1455 CSSCustomIdentValue* identifier = |
| 1449 CSSCustomIdentValue::create(counter->identifier()); | 1456 CSSCustomIdentValue::create(counter->identifier()); |
| 1450 CSSStringValue* separator = CSSStringValue::create(counter->separator()); | 1457 CSSStringValue* separator = CSSStringValue::create(counter->separator()); |
| 1451 CSSValueID listStyleIdent = CSSValueNone; | 1458 CSSValueID listStyleIdent = CSSValueNone; |
| 1452 if (counter->listStyle() != NoneListStyle) | 1459 if (counter->listStyle() != NoneListStyle) |
| 1453 listStyleIdent = | 1460 listStyleIdent = |
| 1454 static_cast<CSSValueID>(CSSValueDisc + counter->listStyle()); | 1461 static_cast<CSSValueID>(CSSValueDisc + counter->listStyle()); |
| 1455 CSSPrimitiveValue* listStyle = | 1462 CSSIdentifierValue* listStyle = |
| 1456 CSSPrimitiveValue::createIdentifier(listStyleIdent); | 1463 CSSIdentifierValue::create(listStyleIdent); |
| 1457 list->append(*CSSCounterValue::create(identifier, listStyle, separator)); | 1464 list->append(*CSSCounterValue::create(identifier, listStyle, separator)); |
| 1458 } else if (contentData->isImage()) { | 1465 } else if (contentData->isImage()) { |
| 1459 const StyleImage* image = toImageContentData(contentData)->image(); | 1466 const StyleImage* image = toImageContentData(contentData)->image(); |
| 1460 ASSERT(image); | 1467 ASSERT(image); |
| 1461 list->append(*image->computedCSSValue()); | 1468 list->append(*image->computedCSSValue()); |
| 1462 } else if (contentData->isText()) { | 1469 } else if (contentData->isText()) { |
| 1463 list->append( | 1470 list->append( |
| 1464 *CSSStringValue::create(toTextContentData(contentData)->text())); | 1471 *CSSStringValue::create(toTextContentData(contentData)->text())); |
| 1465 } else if (contentData->isQuote()) { | 1472 } else if (contentData->isQuote()) { |
| 1466 const QuoteType quoteType = toQuoteContentData(contentData)->quote(); | 1473 const QuoteType quoteType = toQuoteContentData(contentData)->quote(); |
| 1467 list->append( | 1474 list->append(*CSSIdentifierValue::create(valueForQuoteType(quoteType))); |
| 1468 *CSSPrimitiveValue::createIdentifier(valueForQuoteType(quoteType))); | |
| 1469 } else { | 1475 } else { |
| 1470 ASSERT_NOT_REACHED(); | 1476 ASSERT_NOT_REACHED(); |
| 1471 } | 1477 } |
| 1472 } | 1478 } |
| 1473 return list; | 1479 return list; |
| 1474 } | 1480 } |
| 1475 | 1481 |
| 1476 static CSSValue* valueForCounterDirectives(const ComputedStyle& style, | 1482 static CSSValue* valueForCounterDirectives(const ComputedStyle& style, |
| 1477 CSSPropertyID propertyID) { | 1483 CSSPropertyID propertyID) { |
| 1478 const CounterDirectiveMap* map = style.counterDirectives(); | 1484 const CounterDirectiveMap* map = style.counterDirectives(); |
| 1479 if (!map) | 1485 if (!map) |
| 1480 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 1486 return CSSIdentifierValue::create(CSSValueNone); |
| 1481 | 1487 |
| 1482 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 1488 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
| 1483 for (const auto& item : *map) { | 1489 for (const auto& item : *map) { |
| 1484 bool isValidCounterValue = propertyID == CSSPropertyCounterIncrement | 1490 bool isValidCounterValue = propertyID == CSSPropertyCounterIncrement |
| 1485 ? item.value.isIncrement() | 1491 ? item.value.isIncrement() |
| 1486 : item.value.isReset(); | 1492 : item.value.isReset(); |
| 1487 if (!isValidCounterValue) | 1493 if (!isValidCounterValue) |
| 1488 continue; | 1494 continue; |
| 1489 | 1495 |
| 1490 list->append(*CSSCustomIdentValue::create(item.key)); | 1496 list->append(*CSSCustomIdentValue::create(item.key)); |
| 1491 short number = propertyID == CSSPropertyCounterIncrement | 1497 short number = propertyID == CSSPropertyCounterIncrement |
| 1492 ? item.value.incrementValue() | 1498 ? item.value.incrementValue() |
| 1493 : item.value.resetValue(); | 1499 : item.value.resetValue(); |
| 1494 list->append(*CSSPrimitiveValue::create( | 1500 list->append(*CSSPrimitiveValue::create( |
| 1495 (double)number, CSSPrimitiveValue::UnitType::Integer)); | 1501 (double)number, CSSPrimitiveValue::UnitType::Integer)); |
| 1496 } | 1502 } |
| 1497 | 1503 |
| 1498 if (!list->length()) | 1504 if (!list->length()) |
| 1499 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 1505 return CSSIdentifierValue::create(CSSValueNone); |
| 1500 | 1506 |
| 1501 return list; | 1507 return list; |
| 1502 } | 1508 } |
| 1503 | 1509 |
| 1504 static CSSValue* valueForShape(const ComputedStyle& style, | 1510 static CSSValue* valueForShape(const ComputedStyle& style, |
| 1505 ShapeValue* shapeValue) { | 1511 ShapeValue* shapeValue) { |
| 1506 if (!shapeValue) | 1512 if (!shapeValue) |
| 1507 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 1513 return CSSIdentifierValue::create(CSSValueNone); |
| 1508 if (shapeValue->type() == ShapeValue::Box) | 1514 if (shapeValue->type() == ShapeValue::Box) |
| 1509 return CSSPrimitiveValue::create(shapeValue->cssBox()); | 1515 return CSSIdentifierValue::create(shapeValue->cssBox()); |
| 1510 if (shapeValue->type() == ShapeValue::Image) { | 1516 if (shapeValue->type() == ShapeValue::Image) { |
| 1511 if (shapeValue->image()) | 1517 if (shapeValue->image()) |
| 1512 return shapeValue->image()->computedCSSValue(); | 1518 return shapeValue->image()->computedCSSValue(); |
| 1513 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 1519 return CSSIdentifierValue::create(CSSValueNone); |
| 1514 } | 1520 } |
| 1515 | 1521 |
| 1516 ASSERT(shapeValue->type() == ShapeValue::Shape); | 1522 ASSERT(shapeValue->type() == ShapeValue::Shape); |
| 1517 | 1523 |
| 1518 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 1524 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
| 1519 list->append(*valueForBasicShape(style, shapeValue->shape())); | 1525 list->append(*valueForBasicShape(style, shapeValue->shape())); |
| 1520 if (shapeValue->cssBox() != BoxMissing) | 1526 if (shapeValue->cssBox() != BoxMissing) |
| 1521 list->append(*CSSPrimitiveValue::create(shapeValue->cssBox())); | 1527 list->append(*CSSIdentifierValue::create(shapeValue->cssBox())); |
| 1522 return list; | 1528 return list; |
| 1523 } | 1529 } |
| 1524 | 1530 |
| 1525 static CSSValueList* valuesForSidesShorthand( | 1531 static CSSValueList* valuesForSidesShorthand( |
| 1526 const StylePropertyShorthand& shorthand, | 1532 const StylePropertyShorthand& shorthand, |
| 1527 const ComputedStyle& style, | 1533 const ComputedStyle& style, |
| 1528 const LayoutObject* layoutObject, | 1534 const LayoutObject* layoutObject, |
| 1529 Node* styledNode, | 1535 Node* styledNode, |
| 1530 bool allowVisitedStyle) { | 1536 bool allowVisitedStyle) { |
| 1531 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 1537 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1614 | 1620 |
| 1615 if (!verticalRadii->equals(toCSSValueList(list->item(0)))) | 1621 if (!verticalRadii->equals(toCSSValueList(list->item(0)))) |
| 1616 list->append(*verticalRadii); | 1622 list->append(*verticalRadii); |
| 1617 | 1623 |
| 1618 return list; | 1624 return list; |
| 1619 } | 1625 } |
| 1620 | 1626 |
| 1621 static CSSValue* strokeDashArrayToCSSValueList(const SVGDashArray& dashes, | 1627 static CSSValue* strokeDashArrayToCSSValueList(const SVGDashArray& dashes, |
| 1622 const ComputedStyle& style) { | 1628 const ComputedStyle& style) { |
| 1623 if (dashes.isEmpty()) | 1629 if (dashes.isEmpty()) |
| 1624 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 1630 return CSSIdentifierValue::create(CSSValueNone); |
| 1625 | 1631 |
| 1626 CSSValueList* list = CSSValueList::createCommaSeparated(); | 1632 CSSValueList* list = CSSValueList::createCommaSeparated(); |
| 1627 for (const Length& dashLength : dashes.vector()) | 1633 for (const Length& dashLength : dashes.vector()) |
| 1628 list->append(*zoomAdjustedPixelValueForLength(dashLength, style)); | 1634 list->append(*zoomAdjustedPixelValueForLength(dashLength, style)); |
| 1629 | 1635 |
| 1630 return list; | 1636 return list; |
| 1631 } | 1637 } |
| 1632 | 1638 |
| 1633 static CSSValue* paintOrderToCSSValueList(const SVGComputedStyle& svgStyle) { | 1639 static CSSValue* paintOrderToCSSValueList(const SVGComputedStyle& svgStyle) { |
| 1634 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 1640 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
| 1635 for (int i = 0; i < 3; i++) { | 1641 for (int i = 0; i < 3; i++) { |
| 1636 EPaintOrderType paintOrderType = svgStyle.paintOrderType(i); | 1642 EPaintOrderType paintOrderType = svgStyle.paintOrderType(i); |
| 1637 switch (paintOrderType) { | 1643 switch (paintOrderType) { |
| 1638 case PT_FILL: | 1644 case PT_FILL: |
| 1639 case PT_STROKE: | 1645 case PT_STROKE: |
| 1640 case PT_MARKERS: | 1646 case PT_MARKERS: |
| 1641 list->append(*CSSPrimitiveValue::create(paintOrderType)); | 1647 list->append(*CSSIdentifierValue::create(paintOrderType)); |
| 1642 break; | 1648 break; |
| 1643 case PT_NONE: | 1649 case PT_NONE: |
| 1644 default: | 1650 default: |
| 1645 ASSERT_NOT_REACHED(); | 1651 ASSERT_NOT_REACHED(); |
| 1646 break; | 1652 break; |
| 1647 } | 1653 } |
| 1648 } | 1654 } |
| 1649 | 1655 |
| 1650 return list; | 1656 return list; |
| 1651 } | 1657 } |
| 1652 | 1658 |
| 1653 static CSSValue* adjustSVGPaintForCurrentColor(SVGPaintType paintType, | 1659 static CSSValue* adjustSVGPaintForCurrentColor(SVGPaintType paintType, |
| 1654 const String& url, | 1660 const String& url, |
| 1655 const Color& color, | 1661 const Color& color, |
| 1656 const Color& currentColor) { | 1662 const Color& currentColor) { |
| 1657 if (paintType >= SVG_PAINTTYPE_URI_NONE) { | 1663 if (paintType >= SVG_PAINTTYPE_URI_NONE) { |
| 1658 CSSValueList* values = CSSValueList::createSpaceSeparated(); | 1664 CSSValueList* values = CSSValueList::createSpaceSeparated(); |
| 1659 values->append(*CSSURIValue::create(url)); | 1665 values->append(*CSSURIValue::create(url)); |
| 1660 if (paintType == SVG_PAINTTYPE_URI_NONE) | 1666 if (paintType == SVG_PAINTTYPE_URI_NONE) |
| 1661 values->append(*CSSPrimitiveValue::createIdentifier(CSSValueNone)); | 1667 values->append(*CSSIdentifierValue::create(CSSValueNone)); |
| 1662 else if (paintType == SVG_PAINTTYPE_URI_CURRENTCOLOR) | 1668 else if (paintType == SVG_PAINTTYPE_URI_CURRENTCOLOR) |
| 1663 values->append(*CSSColorValue::create(currentColor.rgb())); | 1669 values->append(*CSSColorValue::create(currentColor.rgb())); |
| 1664 else if (paintType == SVG_PAINTTYPE_URI_RGBCOLOR) | 1670 else if (paintType == SVG_PAINTTYPE_URI_RGBCOLOR) |
| 1665 values->append(*CSSColorValue::create(color.rgb())); | 1671 values->append(*CSSColorValue::create(color.rgb())); |
| 1666 return values; | 1672 return values; |
| 1667 } | 1673 } |
| 1668 if (paintType == SVG_PAINTTYPE_NONE) | 1674 if (paintType == SVG_PAINTTYPE_NONE) |
| 1669 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 1675 return CSSIdentifierValue::create(CSSValueNone); |
| 1670 if (paintType == SVG_PAINTTYPE_CURRENTCOLOR) | 1676 if (paintType == SVG_PAINTTYPE_CURRENTCOLOR) |
| 1671 return CSSColorValue::create(currentColor.rgb()); | 1677 return CSSColorValue::create(currentColor.rgb()); |
| 1672 | 1678 |
| 1673 return CSSColorValue::create(color.rgb()); | 1679 return CSSColorValue::create(color.rgb()); |
| 1674 } | 1680 } |
| 1675 | 1681 |
| 1676 static inline String serializeAsFragmentIdentifier( | 1682 static inline String serializeAsFragmentIdentifier( |
| 1677 const AtomicString& resource) { | 1683 const AtomicString& resource) { |
| 1678 return "#" + resource; | 1684 return "#" + resource; |
| 1679 } | 1685 } |
| 1680 | 1686 |
| 1681 CSSValue* ComputedStyleCSSValueMapping::valueForShadowData( | 1687 CSSValue* ComputedStyleCSSValueMapping::valueForShadowData( |
| 1682 const ShadowData& shadow, | 1688 const ShadowData& shadow, |
| 1683 const ComputedStyle& style, | 1689 const ComputedStyle& style, |
| 1684 bool useSpread) { | 1690 bool useSpread) { |
| 1685 CSSPrimitiveValue* x = zoomAdjustedPixelValue(shadow.x(), style); | 1691 CSSPrimitiveValue* x = zoomAdjustedPixelValue(shadow.x(), style); |
| 1686 CSSPrimitiveValue* y = zoomAdjustedPixelValue(shadow.y(), style); | 1692 CSSPrimitiveValue* y = zoomAdjustedPixelValue(shadow.y(), style); |
| 1687 CSSPrimitiveValue* blur = zoomAdjustedPixelValue(shadow.blur(), style); | 1693 CSSPrimitiveValue* blur = zoomAdjustedPixelValue(shadow.blur(), style); |
| 1688 CSSPrimitiveValue* spread = | 1694 CSSPrimitiveValue* spread = |
| 1689 useSpread ? zoomAdjustedPixelValue(shadow.spread(), style) : nullptr; | 1695 useSpread ? zoomAdjustedPixelValue(shadow.spread(), style) : nullptr; |
| 1690 CSSPrimitiveValue* shadowStyle = | 1696 CSSIdentifierValue* shadowStyle = |
| 1691 shadow.style() == Normal | 1697 shadow.style() == Normal ? nullptr |
| 1692 ? nullptr | 1698 : CSSIdentifierValue::create(CSSValueInset); |
| 1693 : CSSPrimitiveValue::createIdentifier(CSSValueInset); | |
| 1694 CSSValue* color = currentColorOrValidColor(style, shadow.color()); | 1699 CSSValue* color = currentColorOrValidColor(style, shadow.color()); |
| 1695 return CSSShadowValue::create(x, y, blur, spread, shadowStyle, color); | 1700 return CSSShadowValue::create(x, y, blur, spread, shadowStyle, color); |
| 1696 } | 1701 } |
| 1697 | 1702 |
| 1698 CSSValue* ComputedStyleCSSValueMapping::valueForShadowList( | 1703 CSSValue* ComputedStyleCSSValueMapping::valueForShadowList( |
| 1699 const ShadowList* shadowList, | 1704 const ShadowList* shadowList, |
| 1700 const ComputedStyle& style, | 1705 const ComputedStyle& style, |
| 1701 bool useSpread) { | 1706 bool useSpread) { |
| 1702 if (!shadowList) | 1707 if (!shadowList) |
| 1703 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 1708 return CSSIdentifierValue::create(CSSValueNone); |
| 1704 | 1709 |
| 1705 CSSValueList* list = CSSValueList::createCommaSeparated(); | 1710 CSSValueList* list = CSSValueList::createCommaSeparated(); |
| 1706 size_t shadowCount = shadowList->shadows().size(); | 1711 size_t shadowCount = shadowList->shadows().size(); |
| 1707 for (size_t i = 0; i < shadowCount; ++i) | 1712 for (size_t i = 0; i < shadowCount; ++i) |
| 1708 list->append( | 1713 list->append( |
| 1709 *valueForShadowData(shadowList->shadows()[i], style, useSpread)); | 1714 *valueForShadowData(shadowList->shadows()[i], style, useSpread)); |
| 1710 return list; | 1715 return list; |
| 1711 } | 1716 } |
| 1712 | 1717 |
| 1713 CSSValue* ComputedStyleCSSValueMapping::valueForFilter( | 1718 CSSValue* ComputedStyleCSSValueMapping::valueForFilter( |
| 1714 const ComputedStyle& style, | 1719 const ComputedStyle& style, |
| 1715 const FilterOperations& filterOperations) { | 1720 const FilterOperations& filterOperations) { |
| 1716 if (filterOperations.operations().isEmpty()) | 1721 if (filterOperations.operations().isEmpty()) |
| 1717 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 1722 return CSSIdentifierValue::create(CSSValueNone); |
| 1718 | 1723 |
| 1719 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 1724 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
| 1720 | 1725 |
| 1721 CSSFunctionValue* filterValue = nullptr; | 1726 CSSFunctionValue* filterValue = nullptr; |
| 1722 | 1727 |
| 1723 for (const auto& operation : filterOperations.operations()) { | 1728 for (const auto& operation : filterOperations.operations()) { |
| 1724 FilterOperation* filterOperation = operation.get(); | 1729 FilterOperation* filterOperation = operation.get(); |
| 1725 switch (filterOperation->type()) { | 1730 switch (filterOperation->type()) { |
| 1726 case FilterOperation::REFERENCE: | 1731 case FilterOperation::REFERENCE: |
| 1727 filterValue = CSSFunctionValue::create(CSSValueUrl); | 1732 filterValue = CSSFunctionValue::create(CSSValueUrl); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1809 CSSValueList* sizeAndLineHeight = CSSValueList::createSlashSeparated(); | 1814 CSSValueList* sizeAndLineHeight = CSSValueList::createSlashSeparated(); |
| 1810 sizeAndLineHeight->append(*valueForFontSize(style)); | 1815 sizeAndLineHeight->append(*valueForFontSize(style)); |
| 1811 sizeAndLineHeight->append(*valueForLineHeight(style)); | 1816 sizeAndLineHeight->append(*valueForLineHeight(style)); |
| 1812 | 1817 |
| 1813 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 1818 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
| 1814 list->append(*valueForFontStyle(style)); | 1819 list->append(*valueForFontStyle(style)); |
| 1815 | 1820 |
| 1816 // Check that non-initial font-variant subproperties are not conflicting with
this serialization. | 1821 // Check that non-initial font-variant subproperties are not conflicting with
this serialization. |
| 1817 CSSValue* ligaturesValue = valueForFontVariantLigatures(style); | 1822 CSSValue* ligaturesValue = valueForFontVariantLigatures(style); |
| 1818 CSSValue* numericValue = valueForFontVariantNumeric(style); | 1823 CSSValue* numericValue = valueForFontVariantNumeric(style); |
| 1819 if (!ligaturesValue->equals( | 1824 if (!ligaturesValue->equals(*CSSIdentifierValue::create(CSSValueNormal)) || |
| 1820 *CSSPrimitiveValue::createIdentifier(CSSValueNormal)) || | 1825 !numericValue->equals(*CSSIdentifierValue::create(CSSValueNormal))) |
| 1821 !numericValue->equals( | |
| 1822 *CSSPrimitiveValue::createIdentifier(CSSValueNormal))) | |
| 1823 return nullptr; | 1826 return nullptr; |
| 1824 | 1827 |
| 1825 CSSPrimitiveValue* capsValue = valueForFontVariantCaps(style); | 1828 CSSIdentifierValue* capsValue = valueForFontVariantCaps(style); |
| 1826 if (!capsValue->equals( | 1829 if (capsValue->getValueID() != CSSValueNormal && |
| 1827 *CSSPrimitiveValue::createIdentifier(CSSValueNormal)) && | 1830 capsValue->getValueID() != CSSValueSmallCaps) |
| 1828 !capsValue->equals( | |
| 1829 *CSSPrimitiveValue::createIdentifier(CSSValueSmallCaps))) | |
| 1830 return nullptr; | 1831 return nullptr; |
| 1831 list->append(*capsValue); | 1832 list->append(*capsValue); |
| 1832 | 1833 |
| 1833 list->append(*valueForFontWeight(style)); | 1834 list->append(*valueForFontWeight(style)); |
| 1834 list->append(*valueForFontStretch(style)); | 1835 list->append(*valueForFontStretch(style)); |
| 1835 list->append(*sizeAndLineHeight); | 1836 list->append(*sizeAndLineHeight); |
| 1836 list->append(*valueForFontFamily(style)); | 1837 list->append(*valueForFontFamily(style)); |
| 1837 | 1838 |
| 1838 return list; | 1839 return list; |
| 1839 } | 1840 } |
| 1840 | 1841 |
| 1841 static CSSValue* valueForScrollSnapDestination(const LengthPoint& destination, | 1842 static CSSValue* valueForScrollSnapDestination(const LengthPoint& destination, |
| 1842 const ComputedStyle& style) { | 1843 const ComputedStyle& style) { |
| 1843 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 1844 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
| 1844 list->append(*zoomAdjustedPixelValueForLength(destination.x(), style)); | 1845 list->append(*zoomAdjustedPixelValueForLength(destination.x(), style)); |
| 1845 list->append(*zoomAdjustedPixelValueForLength(destination.y(), style)); | 1846 list->append(*zoomAdjustedPixelValueForLength(destination.y(), style)); |
| 1846 return list; | 1847 return list; |
| 1847 } | 1848 } |
| 1848 | 1849 |
| 1849 static CSSValue* valueForScrollSnapPoints(const ScrollSnapPoints& points, | 1850 static CSSValue* valueForScrollSnapPoints(const ScrollSnapPoints& points, |
| 1850 const ComputedStyle& style) { | 1851 const ComputedStyle& style) { |
| 1851 if (points.hasRepeat) { | 1852 if (points.hasRepeat) { |
| 1852 CSSFunctionValue* repeat = CSSFunctionValue::create(CSSValueRepeat); | 1853 CSSFunctionValue* repeat = CSSFunctionValue::create(CSSValueRepeat); |
| 1853 repeat->append( | 1854 repeat->append( |
| 1854 *zoomAdjustedPixelValueForLength(points.repeatOffset, style)); | 1855 *zoomAdjustedPixelValueForLength(points.repeatOffset, style)); |
| 1855 return repeat; | 1856 return repeat; |
| 1856 } | 1857 } |
| 1857 | 1858 |
| 1858 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 1859 return CSSIdentifierValue::create(CSSValueNone); |
| 1859 } | 1860 } |
| 1860 | 1861 |
| 1861 static CSSValue* valueForScrollSnapCoordinate( | 1862 static CSSValue* valueForScrollSnapCoordinate( |
| 1862 const Vector<LengthPoint>& coordinates, | 1863 const Vector<LengthPoint>& coordinates, |
| 1863 const ComputedStyle& style) { | 1864 const ComputedStyle& style) { |
| 1864 if (coordinates.isEmpty()) | 1865 if (coordinates.isEmpty()) |
| 1865 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 1866 return CSSIdentifierValue::create(CSSValueNone); |
| 1866 | 1867 |
| 1867 CSSValueList* list = CSSValueList::createCommaSeparated(); | 1868 CSSValueList* list = CSSValueList::createCommaSeparated(); |
| 1868 | 1869 |
| 1869 for (auto& coordinate : coordinates) { | 1870 for (auto& coordinate : coordinates) { |
| 1870 auto pair = CSSValueList::createSpaceSeparated(); | 1871 auto pair = CSSValueList::createSpaceSeparated(); |
| 1871 pair->append(*zoomAdjustedPixelValueForLength(coordinate.x(), style)); | 1872 pair->append(*zoomAdjustedPixelValueForLength(coordinate.x(), style)); |
| 1872 pair->append(*zoomAdjustedPixelValueForLength(coordinate.y(), style)); | 1873 pair->append(*zoomAdjustedPixelValueForLength(coordinate.y(), style)); |
| 1873 list->append(*pair); | 1874 list->append(*pair); |
| 1874 } | 1875 } |
| 1875 | 1876 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1975 case CSSPropertyBackgroundImage: | 1976 case CSSPropertyBackgroundImage: |
| 1976 case CSSPropertyWebkitMaskImage: { | 1977 case CSSPropertyWebkitMaskImage: { |
| 1977 CSSValueList* list = CSSValueList::createCommaSeparated(); | 1978 CSSValueList* list = CSSValueList::createCommaSeparated(); |
| 1978 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskImage | 1979 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskImage |
| 1979 ? &style.maskLayers() | 1980 ? &style.maskLayers() |
| 1980 : &style.backgroundLayers(); | 1981 : &style.backgroundLayers(); |
| 1981 for (; currLayer; currLayer = currLayer->next()) { | 1982 for (; currLayer; currLayer = currLayer->next()) { |
| 1982 if (currLayer->image()) | 1983 if (currLayer->image()) |
| 1983 list->append(*currLayer->image()->computedCSSValue()); | 1984 list->append(*currLayer->image()->computedCSSValue()); |
| 1984 else | 1985 else |
| 1985 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueNone)); | 1986 list->append(*CSSIdentifierValue::create(CSSValueNone)); |
| 1986 } | 1987 } |
| 1987 return list; | 1988 return list; |
| 1988 } | 1989 } |
| 1989 case CSSPropertyBackgroundSize: | 1990 case CSSPropertyBackgroundSize: |
| 1990 case CSSPropertyWebkitMaskSize: { | 1991 case CSSPropertyWebkitMaskSize: { |
| 1991 CSSValueList* list = CSSValueList::createCommaSeparated(); | 1992 CSSValueList* list = CSSValueList::createCommaSeparated(); |
| 1992 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskSize | 1993 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskSize |
| 1993 ? &style.maskLayers() | 1994 ? &style.maskLayers() |
| 1994 : &style.backgroundLayers(); | 1995 : &style.backgroundLayers(); |
| 1995 for (; currLayer; currLayer = currLayer->next()) | 1996 for (; currLayer; currLayer = currLayer->next()) |
| (...skipping 17 matching lines...) Expand all Loading... |
| 2013 currLayer = currLayer->next()) | 2014 currLayer = currLayer->next()) |
| 2014 list->append(*valueForFillSourceType(currLayer->maskSourceType())); | 2015 list->append(*valueForFillSourceType(currLayer->maskSourceType())); |
| 2015 return list; | 2016 return list; |
| 2016 } | 2017 } |
| 2017 case CSSPropertyWebkitMaskComposite: { | 2018 case CSSPropertyWebkitMaskComposite: { |
| 2018 CSSValueList* list = CSSValueList::createCommaSeparated(); | 2019 CSSValueList* list = CSSValueList::createCommaSeparated(); |
| 2019 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskComposite | 2020 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskComposite |
| 2020 ? &style.maskLayers() | 2021 ? &style.maskLayers() |
| 2021 : &style.backgroundLayers(); | 2022 : &style.backgroundLayers(); |
| 2022 for (; currLayer; currLayer = currLayer->next()) | 2023 for (; currLayer; currLayer = currLayer->next()) |
| 2023 list->append(*CSSPrimitiveValue::create(currLayer->composite())); | 2024 list->append(*CSSIdentifierValue::create(currLayer->composite())); |
| 2024 return list; | 2025 return list; |
| 2025 } | 2026 } |
| 2026 case CSSPropertyBackgroundAttachment: { | 2027 case CSSPropertyBackgroundAttachment: { |
| 2027 CSSValueList* list = CSSValueList::createCommaSeparated(); | 2028 CSSValueList* list = CSSValueList::createCommaSeparated(); |
| 2028 for (const FillLayer* currLayer = &style.backgroundLayers(); currLayer; | 2029 for (const FillLayer* currLayer = &style.backgroundLayers(); currLayer; |
| 2029 currLayer = currLayer->next()) | 2030 currLayer = currLayer->next()) |
| 2030 list->append(*CSSPrimitiveValue::create(currLayer->attachment())); | 2031 list->append(*CSSIdentifierValue::create(currLayer->attachment())); |
| 2031 return list; | 2032 return list; |
| 2032 } | 2033 } |
| 2033 case CSSPropertyBackgroundClip: | 2034 case CSSPropertyBackgroundClip: |
| 2034 case CSSPropertyBackgroundOrigin: | 2035 case CSSPropertyBackgroundOrigin: |
| 2035 case CSSPropertyWebkitBackgroundClip: | 2036 case CSSPropertyWebkitBackgroundClip: |
| 2036 case CSSPropertyWebkitBackgroundOrigin: | 2037 case CSSPropertyWebkitBackgroundOrigin: |
| 2037 case CSSPropertyWebkitMaskClip: | 2038 case CSSPropertyWebkitMaskClip: |
| 2038 case CSSPropertyWebkitMaskOrigin: { | 2039 case CSSPropertyWebkitMaskOrigin: { |
| 2039 bool isClip = propertyID == CSSPropertyBackgroundClip || | 2040 bool isClip = propertyID == CSSPropertyBackgroundClip || |
| 2040 propertyID == CSSPropertyWebkitBackgroundClip || | 2041 propertyID == CSSPropertyWebkitBackgroundClip || |
| 2041 propertyID == CSSPropertyWebkitMaskClip; | 2042 propertyID == CSSPropertyWebkitMaskClip; |
| 2042 CSSValueList* list = CSSValueList::createCommaSeparated(); | 2043 CSSValueList* list = CSSValueList::createCommaSeparated(); |
| 2043 const FillLayer* currLayer = (propertyID == CSSPropertyWebkitMaskClip || | 2044 const FillLayer* currLayer = (propertyID == CSSPropertyWebkitMaskClip || |
| 2044 propertyID == CSSPropertyWebkitMaskOrigin) | 2045 propertyID == CSSPropertyWebkitMaskOrigin) |
| 2045 ? &style.maskLayers() | 2046 ? &style.maskLayers() |
| 2046 : &style.backgroundLayers(); | 2047 : &style.backgroundLayers(); |
| 2047 for (; currLayer; currLayer = currLayer->next()) { | 2048 for (; currLayer; currLayer = currLayer->next()) { |
| 2048 EFillBox box = isClip ? currLayer->clip() : currLayer->origin(); | 2049 EFillBox box = isClip ? currLayer->clip() : currLayer->origin(); |
| 2049 list->append(*CSSPrimitiveValue::create(box)); | 2050 list->append(*CSSIdentifierValue::create(box)); |
| 2050 } | 2051 } |
| 2051 return list; | 2052 return list; |
| 2052 } | 2053 } |
| 2053 case CSSPropertyBackgroundPosition: | 2054 case CSSPropertyBackgroundPosition: |
| 2054 case CSSPropertyWebkitMaskPosition: { | 2055 case CSSPropertyWebkitMaskPosition: { |
| 2055 CSSValueList* list = CSSValueList::createCommaSeparated(); | 2056 CSSValueList* list = CSSValueList::createCommaSeparated(); |
| 2056 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskPosition | 2057 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskPosition |
| 2057 ? &style.maskLayers() | 2058 ? &style.maskLayers() |
| 2058 : &style.backgroundLayers(); | 2059 : &style.backgroundLayers(); |
| 2059 for (; currLayer; currLayer = currLayer->next()) | 2060 for (; currLayer; currLayer = currLayer->next()) |
| (...skipping 18 matching lines...) Expand all Loading... |
| 2078 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskPositionY | 2079 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskPositionY |
| 2079 ? &style.maskLayers() | 2080 ? &style.maskLayers() |
| 2080 : &style.backgroundLayers(); | 2081 : &style.backgroundLayers(); |
| 2081 for (; currLayer; currLayer = currLayer->next()) | 2082 for (; currLayer; currLayer = currLayer->next()) |
| 2082 list->append( | 2083 list->append( |
| 2083 *zoomAdjustedPixelValueForLength(currLayer->yPosition(), style)); | 2084 *zoomAdjustedPixelValueForLength(currLayer->yPosition(), style)); |
| 2084 return list; | 2085 return list; |
| 2085 } | 2086 } |
| 2086 case CSSPropertyBorderCollapse: | 2087 case CSSPropertyBorderCollapse: |
| 2087 if (style.borderCollapse()) | 2088 if (style.borderCollapse()) |
| 2088 return CSSPrimitiveValue::createIdentifier(CSSValueCollapse); | 2089 return CSSIdentifierValue::create(CSSValueCollapse); |
| 2089 return CSSPrimitiveValue::createIdentifier(CSSValueSeparate); | 2090 return CSSIdentifierValue::create(CSSValueSeparate); |
| 2090 case CSSPropertyBorderSpacing: { | 2091 case CSSPropertyBorderSpacing: { |
| 2091 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 2092 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
| 2092 list->append( | 2093 list->append( |
| 2093 *zoomAdjustedPixelValue(style.horizontalBorderSpacing(), style)); | 2094 *zoomAdjustedPixelValue(style.horizontalBorderSpacing(), style)); |
| 2094 list->append( | 2095 list->append( |
| 2095 *zoomAdjustedPixelValue(style.verticalBorderSpacing(), style)); | 2096 *zoomAdjustedPixelValue(style.verticalBorderSpacing(), style)); |
| 2096 return list; | 2097 return list; |
| 2097 } | 2098 } |
| 2098 case CSSPropertyWebkitBorderHorizontalSpacing: | 2099 case CSSPropertyWebkitBorderHorizontalSpacing: |
| 2099 return zoomAdjustedPixelValue(style.horizontalBorderSpacing(), style); | 2100 return zoomAdjustedPixelValue(style.horizontalBorderSpacing(), style); |
| 2100 case CSSPropertyWebkitBorderVerticalSpacing: | 2101 case CSSPropertyWebkitBorderVerticalSpacing: |
| 2101 return zoomAdjustedPixelValue(style.verticalBorderSpacing(), style); | 2102 return zoomAdjustedPixelValue(style.verticalBorderSpacing(), style); |
| 2102 case CSSPropertyBorderImageSource: | 2103 case CSSPropertyBorderImageSource: |
| 2103 if (style.borderImageSource()) | 2104 if (style.borderImageSource()) |
| 2104 return style.borderImageSource()->computedCSSValue(); | 2105 return style.borderImageSource()->computedCSSValue(); |
| 2105 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 2106 return CSSIdentifierValue::create(CSSValueNone); |
| 2106 case CSSPropertyBorderTopColor: | 2107 case CSSPropertyBorderTopColor: |
| 2107 return allowVisitedStyle | 2108 return allowVisitedStyle |
| 2108 ? CSSColorValue::create( | 2109 ? CSSColorValue::create( |
| 2109 style.visitedDependentColor(CSSPropertyBorderTopColor) | 2110 style.visitedDependentColor(CSSPropertyBorderTopColor) |
| 2110 .rgb()) | 2111 .rgb()) |
| 2111 : currentColorOrValidColor(style, style.borderTopColor()); | 2112 : currentColorOrValidColor(style, style.borderTopColor()); |
| 2112 case CSSPropertyBorderRightColor: | 2113 case CSSPropertyBorderRightColor: |
| 2113 return allowVisitedStyle | 2114 return allowVisitedStyle |
| 2114 ? CSSColorValue::create( | 2115 ? CSSColorValue::create( |
| 2115 style.visitedDependentColor(CSSPropertyBorderRightColor) | 2116 style.visitedDependentColor(CSSPropertyBorderRightColor) |
| 2116 .rgb()) | 2117 .rgb()) |
| 2117 : currentColorOrValidColor(style, style.borderRightColor()); | 2118 : currentColorOrValidColor(style, style.borderRightColor()); |
| 2118 case CSSPropertyBorderBottomColor: | 2119 case CSSPropertyBorderBottomColor: |
| 2119 return allowVisitedStyle | 2120 return allowVisitedStyle |
| 2120 ? CSSColorValue::create( | 2121 ? CSSColorValue::create( |
| 2121 style.visitedDependentColor(CSSPropertyBorderBottomColor) | 2122 style.visitedDependentColor(CSSPropertyBorderBottomColor) |
| 2122 .rgb()) | 2123 .rgb()) |
| 2123 : currentColorOrValidColor(style, style.borderBottomColor()); | 2124 : currentColorOrValidColor(style, style.borderBottomColor()); |
| 2124 case CSSPropertyBorderLeftColor: | 2125 case CSSPropertyBorderLeftColor: |
| 2125 return allowVisitedStyle | 2126 return allowVisitedStyle |
| 2126 ? CSSColorValue::create( | 2127 ? CSSColorValue::create( |
| 2127 style.visitedDependentColor(CSSPropertyBorderLeftColor) | 2128 style.visitedDependentColor(CSSPropertyBorderLeftColor) |
| 2128 .rgb()) | 2129 .rgb()) |
| 2129 : currentColorOrValidColor(style, style.borderLeftColor()); | 2130 : currentColorOrValidColor(style, style.borderLeftColor()); |
| 2130 case CSSPropertyBorderTopStyle: | 2131 case CSSPropertyBorderTopStyle: |
| 2131 return CSSPrimitiveValue::create(style.borderTopStyle()); | 2132 return CSSIdentifierValue::create(style.borderTopStyle()); |
| 2132 case CSSPropertyBorderRightStyle: | 2133 case CSSPropertyBorderRightStyle: |
| 2133 return CSSPrimitiveValue::create(style.borderRightStyle()); | 2134 return CSSIdentifierValue::create(style.borderRightStyle()); |
| 2134 case CSSPropertyBorderBottomStyle: | 2135 case CSSPropertyBorderBottomStyle: |
| 2135 return CSSPrimitiveValue::create(style.borderBottomStyle()); | 2136 return CSSIdentifierValue::create(style.borderBottomStyle()); |
| 2136 case CSSPropertyBorderLeftStyle: | 2137 case CSSPropertyBorderLeftStyle: |
| 2137 return CSSPrimitiveValue::create(style.borderLeftStyle()); | 2138 return CSSIdentifierValue::create(style.borderLeftStyle()); |
| 2138 case CSSPropertyBorderTopWidth: | 2139 case CSSPropertyBorderTopWidth: |
| 2139 return zoomAdjustedPixelValue(style.borderTopWidth(), style); | 2140 return zoomAdjustedPixelValue(style.borderTopWidth(), style); |
| 2140 case CSSPropertyBorderRightWidth: | 2141 case CSSPropertyBorderRightWidth: |
| 2141 return zoomAdjustedPixelValue(style.borderRightWidth(), style); | 2142 return zoomAdjustedPixelValue(style.borderRightWidth(), style); |
| 2142 case CSSPropertyBorderBottomWidth: | 2143 case CSSPropertyBorderBottomWidth: |
| 2143 return zoomAdjustedPixelValue(style.borderBottomWidth(), style); | 2144 return zoomAdjustedPixelValue(style.borderBottomWidth(), style); |
| 2144 case CSSPropertyBorderLeftWidth: | 2145 case CSSPropertyBorderLeftWidth: |
| 2145 return zoomAdjustedPixelValue(style.borderLeftWidth(), style); | 2146 return zoomAdjustedPixelValue(style.borderLeftWidth(), style); |
| 2146 case CSSPropertyBottom: | 2147 case CSSPropertyBottom: |
| 2147 return valueForPositionOffset(style, CSSPropertyBottom, layoutObject); | 2148 return valueForPositionOffset(style, CSSPropertyBottom, layoutObject); |
| 2148 case CSSPropertyWebkitBoxAlign: | 2149 case CSSPropertyWebkitBoxAlign: |
| 2149 return CSSPrimitiveValue::create(style.boxAlign()); | 2150 return CSSIdentifierValue::create(style.boxAlign()); |
| 2150 case CSSPropertyWebkitBoxDecorationBreak: | 2151 case CSSPropertyWebkitBoxDecorationBreak: |
| 2151 if (style.boxDecorationBreak() == BoxDecorationBreakSlice) | 2152 if (style.boxDecorationBreak() == BoxDecorationBreakSlice) |
| 2152 return CSSPrimitiveValue::createIdentifier(CSSValueSlice); | 2153 return CSSIdentifierValue::create(CSSValueSlice); |
| 2153 return CSSPrimitiveValue::createIdentifier(CSSValueClone); | 2154 return CSSIdentifierValue::create(CSSValueClone); |
| 2154 case CSSPropertyWebkitBoxDirection: | 2155 case CSSPropertyWebkitBoxDirection: |
| 2155 return CSSPrimitiveValue::create(style.boxDirection()); | 2156 return CSSIdentifierValue::create(style.boxDirection()); |
| 2156 case CSSPropertyWebkitBoxFlex: | 2157 case CSSPropertyWebkitBoxFlex: |
| 2157 return CSSPrimitiveValue::create(style.boxFlex(), | 2158 return CSSPrimitiveValue::create(style.boxFlex(), |
| 2158 CSSPrimitiveValue::UnitType::Number); | 2159 CSSPrimitiveValue::UnitType::Number); |
| 2159 case CSSPropertyWebkitBoxFlexGroup: | 2160 case CSSPropertyWebkitBoxFlexGroup: |
| 2160 return CSSPrimitiveValue::create(style.boxFlexGroup(), | 2161 return CSSPrimitiveValue::create(style.boxFlexGroup(), |
| 2161 CSSPrimitiveValue::UnitType::Number); | 2162 CSSPrimitiveValue::UnitType::Number); |
| 2162 case CSSPropertyWebkitBoxLines: | 2163 case CSSPropertyWebkitBoxLines: |
| 2163 return CSSPrimitiveValue::create(style.boxLines()); | 2164 return CSSIdentifierValue::create(style.boxLines()); |
| 2164 case CSSPropertyWebkitBoxOrdinalGroup: | 2165 case CSSPropertyWebkitBoxOrdinalGroup: |
| 2165 return CSSPrimitiveValue::create(style.boxOrdinalGroup(), | 2166 return CSSPrimitiveValue::create(style.boxOrdinalGroup(), |
| 2166 CSSPrimitiveValue::UnitType::Number); | 2167 CSSPrimitiveValue::UnitType::Number); |
| 2167 case CSSPropertyWebkitBoxOrient: | 2168 case CSSPropertyWebkitBoxOrient: |
| 2168 return CSSPrimitiveValue::create(style.boxOrient()); | 2169 return CSSIdentifierValue::create(style.boxOrient()); |
| 2169 case CSSPropertyWebkitBoxPack: | 2170 case CSSPropertyWebkitBoxPack: |
| 2170 return CSSPrimitiveValue::create(style.boxPack()); | 2171 return CSSIdentifierValue::create(style.boxPack()); |
| 2171 case CSSPropertyWebkitBoxReflect: | 2172 case CSSPropertyWebkitBoxReflect: |
| 2172 return valueForReflection(style.boxReflect(), style); | 2173 return valueForReflection(style.boxReflect(), style); |
| 2173 case CSSPropertyBoxShadow: | 2174 case CSSPropertyBoxShadow: |
| 2174 return valueForShadowList(style.boxShadow(), style, true); | 2175 return valueForShadowList(style.boxShadow(), style, true); |
| 2175 case CSSPropertyCaptionSide: | 2176 case CSSPropertyCaptionSide: |
| 2176 return CSSPrimitiveValue::create(style.captionSide()); | 2177 return CSSIdentifierValue::create(style.captionSide()); |
| 2177 case CSSPropertyClear: | 2178 case CSSPropertyClear: |
| 2178 return CSSPrimitiveValue::create(style.clear()); | 2179 return CSSIdentifierValue::create(style.clear()); |
| 2179 case CSSPropertyColor: | 2180 case CSSPropertyColor: |
| 2180 return CSSColorValue::create( | 2181 return CSSColorValue::create( |
| 2181 allowVisitedStyle | 2182 allowVisitedStyle |
| 2182 ? style.visitedDependentColor(CSSPropertyColor).rgb() | 2183 ? style.visitedDependentColor(CSSPropertyColor).rgb() |
| 2183 : style.color().rgb()); | 2184 : style.color().rgb()); |
| 2184 case CSSPropertyWebkitPrintColorAdjust: | 2185 case CSSPropertyWebkitPrintColorAdjust: |
| 2185 return CSSPrimitiveValue::create(style.getPrintColorAdjust()); | 2186 return CSSIdentifierValue::create(style.getPrintColorAdjust()); |
| 2186 case CSSPropertyColumnCount: | 2187 case CSSPropertyColumnCount: |
| 2187 if (style.hasAutoColumnCount()) | 2188 if (style.hasAutoColumnCount()) |
| 2188 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); | 2189 return CSSIdentifierValue::create(CSSValueAuto); |
| 2189 return CSSPrimitiveValue::create(style.columnCount(), | 2190 return CSSPrimitiveValue::create(style.columnCount(), |
| 2190 CSSPrimitiveValue::UnitType::Number); | 2191 CSSPrimitiveValue::UnitType::Number); |
| 2191 case CSSPropertyColumnFill: | 2192 case CSSPropertyColumnFill: |
| 2192 return CSSPrimitiveValue::create(style.getColumnFill()); | 2193 return CSSIdentifierValue::create(style.getColumnFill()); |
| 2193 case CSSPropertyColumnGap: | 2194 case CSSPropertyColumnGap: |
| 2194 if (style.hasNormalColumnGap()) | 2195 if (style.hasNormalColumnGap()) |
| 2195 return CSSPrimitiveValue::createIdentifier(CSSValueNormal); | 2196 return CSSIdentifierValue::create(CSSValueNormal); |
| 2196 return zoomAdjustedPixelValue(style.columnGap(), style); | 2197 return zoomAdjustedPixelValue(style.columnGap(), style); |
| 2197 case CSSPropertyColumnRuleColor: | 2198 case CSSPropertyColumnRuleColor: |
| 2198 return allowVisitedStyle | 2199 return allowVisitedStyle |
| 2199 ? CSSColorValue::create( | 2200 ? CSSColorValue::create( |
| 2200 style.visitedDependentColor(CSSPropertyOutlineColor) | 2201 style.visitedDependentColor(CSSPropertyOutlineColor) |
| 2201 .rgb()) | 2202 .rgb()) |
| 2202 : currentColorOrValidColor(style, style.columnRuleColor()); | 2203 : currentColorOrValidColor(style, style.columnRuleColor()); |
| 2203 case CSSPropertyColumnRuleStyle: | 2204 case CSSPropertyColumnRuleStyle: |
| 2204 return CSSPrimitiveValue::create(style.columnRuleStyle()); | 2205 return CSSIdentifierValue::create(style.columnRuleStyle()); |
| 2205 case CSSPropertyColumnRuleWidth: | 2206 case CSSPropertyColumnRuleWidth: |
| 2206 return zoomAdjustedPixelValue(style.columnRuleWidth(), style); | 2207 return zoomAdjustedPixelValue(style.columnRuleWidth(), style); |
| 2207 case CSSPropertyColumnSpan: | 2208 case CSSPropertyColumnSpan: |
| 2208 return CSSPrimitiveValue::createIdentifier( | 2209 return CSSIdentifierValue::create(style.getColumnSpan() ? CSSValueAll |
| 2209 style.getColumnSpan() ? CSSValueAll : CSSValueNone); | 2210 : CSSValueNone); |
| 2210 case CSSPropertyWebkitColumnBreakAfter: | 2211 case CSSPropertyWebkitColumnBreakAfter: |
| 2211 return CSSPrimitiveValue::create( | 2212 return CSSIdentifierValue::create( |
| 2212 mapToColumnBreakValue(style.breakAfter())); | 2213 mapToColumnBreakValue(style.breakAfter())); |
| 2213 case CSSPropertyWebkitColumnBreakBefore: | 2214 case CSSPropertyWebkitColumnBreakBefore: |
| 2214 return CSSPrimitiveValue::create( | 2215 return CSSIdentifierValue::create( |
| 2215 mapToColumnBreakValue(style.breakBefore())); | 2216 mapToColumnBreakValue(style.breakBefore())); |
| 2216 case CSSPropertyWebkitColumnBreakInside: | 2217 case CSSPropertyWebkitColumnBreakInside: |
| 2217 return CSSPrimitiveValue::create( | 2218 return CSSIdentifierValue::create( |
| 2218 mapToColumnBreakValue(style.breakInside())); | 2219 mapToColumnBreakValue(style.breakInside())); |
| 2219 case CSSPropertyColumnWidth: | 2220 case CSSPropertyColumnWidth: |
| 2220 if (style.hasAutoColumnWidth()) | 2221 if (style.hasAutoColumnWidth()) |
| 2221 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); | 2222 return CSSIdentifierValue::create(CSSValueAuto); |
| 2222 return zoomAdjustedPixelValue(style.columnWidth(), style); | 2223 return zoomAdjustedPixelValue(style.columnWidth(), style); |
| 2223 case CSSPropertyTabSize: | 2224 case CSSPropertyTabSize: |
| 2224 return CSSPrimitiveValue::create( | 2225 return CSSPrimitiveValue::create( |
| 2225 style.getTabSize().getPixelSize(1.0), | 2226 style.getTabSize().getPixelSize(1.0), |
| 2226 style.getTabSize().isSpaces() ? CSSPrimitiveValue::UnitType::Number | 2227 style.getTabSize().isSpaces() ? CSSPrimitiveValue::UnitType::Number |
| 2227 : CSSPrimitiveValue::UnitType::Pixels); | 2228 : CSSPrimitiveValue::UnitType::Pixels); |
| 2228 case CSSPropertyTextSizeAdjust: | 2229 case CSSPropertyTextSizeAdjust: |
| 2229 if (style.getTextSizeAdjust().isAuto()) | 2230 if (style.getTextSizeAdjust().isAuto()) |
| 2230 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); | 2231 return CSSIdentifierValue::create(CSSValueAuto); |
| 2231 return CSSPrimitiveValue::create( | 2232 return CSSPrimitiveValue::create( |
| 2232 style.getTextSizeAdjust().multiplier() * 100, | 2233 style.getTextSizeAdjust().multiplier() * 100, |
| 2233 CSSPrimitiveValue::UnitType::Percentage); | 2234 CSSPrimitiveValue::UnitType::Percentage); |
| 2234 case CSSPropertyCursor: { | 2235 case CSSPropertyCursor: { |
| 2235 CSSValueList* list = nullptr; | 2236 CSSValueList* list = nullptr; |
| 2236 CursorList* cursors = style.cursors(); | 2237 CursorList* cursors = style.cursors(); |
| 2237 if (cursors && cursors->size() > 0) { | 2238 if (cursors && cursors->size() > 0) { |
| 2238 list = CSSValueList::createCommaSeparated(); | 2239 list = CSSValueList::createCommaSeparated(); |
| 2239 for (unsigned i = 0; i < cursors->size(); ++i) { | 2240 for (unsigned i = 0; i < cursors->size(); ++i) { |
| 2240 if (StyleImage* image = cursors->at(i).image()) | 2241 if (StyleImage* image = cursors->at(i).image()) |
| 2241 list->append(*CSSCursorImageValue::create( | 2242 list->append(*CSSCursorImageValue::create( |
| 2242 image->computedCSSValue(), cursors->at(i).hotSpotSpecified(), | 2243 image->computedCSSValue(), cursors->at(i).hotSpotSpecified(), |
| 2243 cursors->at(i).hotSpot())); | 2244 cursors->at(i).hotSpot())); |
| 2244 } | 2245 } |
| 2245 } | 2246 } |
| 2246 CSSValue* value = CSSPrimitiveValue::create(style.cursor()); | 2247 CSSValue* value = CSSIdentifierValue::create(style.cursor()); |
| 2247 if (list) { | 2248 if (list) { |
| 2248 list->append(*value); | 2249 list->append(*value); |
| 2249 return list; | 2250 return list; |
| 2250 } | 2251 } |
| 2251 return value; | 2252 return value; |
| 2252 } | 2253 } |
| 2253 case CSSPropertyDirection: | 2254 case CSSPropertyDirection: |
| 2254 return CSSPrimitiveValue::create(style.direction()); | 2255 return CSSIdentifierValue::create(style.direction()); |
| 2255 case CSSPropertyDisplay: | 2256 case CSSPropertyDisplay: |
| 2256 return CSSPrimitiveValue::create(style.display()); | 2257 return CSSIdentifierValue::create(style.display()); |
| 2257 case CSSPropertyEmptyCells: | 2258 case CSSPropertyEmptyCells: |
| 2258 return CSSPrimitiveValue::create(style.emptyCells()); | 2259 return CSSIdentifierValue::create(style.emptyCells()); |
| 2259 case CSSPropertyAlignContent: | 2260 case CSSPropertyAlignContent: |
| 2260 return valueForContentPositionAndDistributionWithOverflowAlignment( | 2261 return valueForContentPositionAndDistributionWithOverflowAlignment( |
| 2261 style.alignContent(), CSSValueStretch); | 2262 style.alignContent(), CSSValueStretch); |
| 2262 case CSSPropertyAlignItems: | 2263 case CSSPropertyAlignItems: |
| 2263 return valueForItemPositionWithOverflowAlignment(style.alignItems()); | 2264 return valueForItemPositionWithOverflowAlignment(style.alignItems()); |
| 2264 case CSSPropertyAlignSelf: | 2265 case CSSPropertyAlignSelf: |
| 2265 return valueForItemPositionWithOverflowAlignment(style.alignSelf()); | 2266 return valueForItemPositionWithOverflowAlignment(style.alignSelf()); |
| 2266 case CSSPropertyFlex: | 2267 case CSSPropertyFlex: |
| 2267 return valuesForShorthandProperty(flexShorthand(), style, layoutObject, | 2268 return valuesForShorthandProperty(flexShorthand(), style, layoutObject, |
| 2268 styledNode, allowVisitedStyle); | 2269 styledNode, allowVisitedStyle); |
| 2269 case CSSPropertyFlexBasis: | 2270 case CSSPropertyFlexBasis: |
| 2270 return zoomAdjustedPixelValueForLength(style.flexBasis(), style); | 2271 return zoomAdjustedPixelValueForLength(style.flexBasis(), style); |
| 2271 case CSSPropertyFlexDirection: | 2272 case CSSPropertyFlexDirection: |
| 2272 return CSSPrimitiveValue::create(style.flexDirection()); | 2273 return CSSIdentifierValue::create(style.flexDirection()); |
| 2273 case CSSPropertyFlexFlow: | 2274 case CSSPropertyFlexFlow: |
| 2274 return valuesForShorthandProperty(flexFlowShorthand(), style, | 2275 return valuesForShorthandProperty(flexFlowShorthand(), style, |
| 2275 layoutObject, styledNode, | 2276 layoutObject, styledNode, |
| 2276 allowVisitedStyle); | 2277 allowVisitedStyle); |
| 2277 case CSSPropertyFlexGrow: | 2278 case CSSPropertyFlexGrow: |
| 2278 return CSSPrimitiveValue::create(style.flexGrow(), | 2279 return CSSPrimitiveValue::create(style.flexGrow(), |
| 2279 CSSPrimitiveValue::UnitType::Number); | 2280 CSSPrimitiveValue::UnitType::Number); |
| 2280 case CSSPropertyFlexShrink: | 2281 case CSSPropertyFlexShrink: |
| 2281 return CSSPrimitiveValue::create(style.flexShrink(), | 2282 return CSSPrimitiveValue::create(style.flexShrink(), |
| 2282 CSSPrimitiveValue::UnitType::Number); | 2283 CSSPrimitiveValue::UnitType::Number); |
| 2283 case CSSPropertyFlexWrap: | 2284 case CSSPropertyFlexWrap: |
| 2284 return CSSPrimitiveValue::create(style.flexWrap()); | 2285 return CSSIdentifierValue::create(style.flexWrap()); |
| 2285 case CSSPropertyJustifyContent: | 2286 case CSSPropertyJustifyContent: |
| 2286 return valueForContentPositionAndDistributionWithOverflowAlignment( | 2287 return valueForContentPositionAndDistributionWithOverflowAlignment( |
| 2287 style.justifyContent(), CSSValueFlexStart); | 2288 style.justifyContent(), CSSValueFlexStart); |
| 2288 case CSSPropertyOrder: | 2289 case CSSPropertyOrder: |
| 2289 return CSSPrimitiveValue::create(style.order(), | 2290 return CSSPrimitiveValue::create(style.order(), |
| 2290 CSSPrimitiveValue::UnitType::Number); | 2291 CSSPrimitiveValue::UnitType::Number); |
| 2291 case CSSPropertyFloat: | 2292 case CSSPropertyFloat: |
| 2292 if (style.display() != EDisplay::None && style.hasOutOfFlowPosition()) | 2293 if (style.display() != EDisplay::None && style.hasOutOfFlowPosition()) |
| 2293 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 2294 return CSSIdentifierValue::create(CSSValueNone); |
| 2294 return CSSPrimitiveValue::create(style.floating()); | 2295 return CSSIdentifierValue::create(style.floating()); |
| 2295 case CSSPropertyFont: | 2296 case CSSPropertyFont: |
| 2296 return valueForFont(style); | 2297 return valueForFont(style); |
| 2297 case CSSPropertyFontFamily: | 2298 case CSSPropertyFontFamily: |
| 2298 return valueForFontFamily(style); | 2299 return valueForFontFamily(style); |
| 2299 case CSSPropertyFontSize: | 2300 case CSSPropertyFontSize: |
| 2300 return valueForFontSize(style); | 2301 return valueForFontSize(style); |
| 2301 case CSSPropertyFontSizeAdjust: | 2302 case CSSPropertyFontSizeAdjust: |
| 2302 if (style.hasFontSizeAdjust()) | 2303 if (style.hasFontSizeAdjust()) |
| 2303 return CSSPrimitiveValue::create(style.fontSizeAdjust(), | 2304 return CSSPrimitiveValue::create(style.fontSizeAdjust(), |
| 2304 CSSPrimitiveValue::UnitType::Number); | 2305 CSSPrimitiveValue::UnitType::Number); |
| 2305 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 2306 return CSSIdentifierValue::create(CSSValueNone); |
| 2306 case CSSPropertyFontStretch: | 2307 case CSSPropertyFontStretch: |
| 2307 return valueForFontStretch(style); | 2308 return valueForFontStretch(style); |
| 2308 case CSSPropertyFontStyle: | 2309 case CSSPropertyFontStyle: |
| 2309 return valueForFontStyle(style); | 2310 return valueForFontStyle(style); |
| 2310 case CSSPropertyFontVariant: | 2311 case CSSPropertyFontVariant: |
| 2311 return valuesForFontVariantProperty(style, layoutObject, styledNode, | 2312 return valuesForFontVariantProperty(style, layoutObject, styledNode, |
| 2312 allowVisitedStyle); | 2313 allowVisitedStyle); |
| 2313 case CSSPropertyFontWeight: | 2314 case CSSPropertyFontWeight: |
| 2314 return valueForFontWeight(style); | 2315 return valueForFontWeight(style); |
| 2315 case CSSPropertyFontFeatureSettings: { | 2316 case CSSPropertyFontFeatureSettings: { |
| 2316 const FontFeatureSettings* featureSettings = | 2317 const FontFeatureSettings* featureSettings = |
| 2317 style.getFontDescription().featureSettings(); | 2318 style.getFontDescription().featureSettings(); |
| 2318 if (!featureSettings || !featureSettings->size()) | 2319 if (!featureSettings || !featureSettings->size()) |
| 2319 return CSSPrimitiveValue::createIdentifier(CSSValueNormal); | 2320 return CSSIdentifierValue::create(CSSValueNormal); |
| 2320 CSSValueList* list = CSSValueList::createCommaSeparated(); | 2321 CSSValueList* list = CSSValueList::createCommaSeparated(); |
| 2321 for (unsigned i = 0; i < featureSettings->size(); ++i) { | 2322 for (unsigned i = 0; i < featureSettings->size(); ++i) { |
| 2322 const FontFeature& feature = featureSettings->at(i); | 2323 const FontFeature& feature = featureSettings->at(i); |
| 2323 CSSFontFeatureValue* featureValue = | 2324 CSSFontFeatureValue* featureValue = |
| 2324 CSSFontFeatureValue::create(feature.tag(), feature.value()); | 2325 CSSFontFeatureValue::create(feature.tag(), feature.value()); |
| 2325 list->append(*featureValue); | 2326 list->append(*featureValue); |
| 2326 } | 2327 } |
| 2327 return list; | 2328 return list; |
| 2328 } | 2329 } |
| 2329 case CSSPropertyGridAutoFlow: { | 2330 case CSSPropertyGridAutoFlow: { |
| 2330 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 2331 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
| 2331 switch (style.getGridAutoFlow()) { | 2332 switch (style.getGridAutoFlow()) { |
| 2332 case AutoFlowRow: | 2333 case AutoFlowRow: |
| 2333 case AutoFlowRowDense: | 2334 case AutoFlowRowDense: |
| 2334 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueRow)); | 2335 list->append(*CSSIdentifierValue::create(CSSValueRow)); |
| 2335 break; | 2336 break; |
| 2336 case AutoFlowColumn: | 2337 case AutoFlowColumn: |
| 2337 case AutoFlowColumnDense: | 2338 case AutoFlowColumnDense: |
| 2338 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueColumn)); | 2339 list->append(*CSSIdentifierValue::create(CSSValueColumn)); |
| 2339 break; | 2340 break; |
| 2340 default: | 2341 default: |
| 2341 ASSERT_NOT_REACHED(); | 2342 ASSERT_NOT_REACHED(); |
| 2342 } | 2343 } |
| 2343 | 2344 |
| 2344 switch (style.getGridAutoFlow()) { | 2345 switch (style.getGridAutoFlow()) { |
| 2345 case AutoFlowRowDense: | 2346 case AutoFlowRowDense: |
| 2346 case AutoFlowColumnDense: | 2347 case AutoFlowColumnDense: |
| 2347 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueDense)); | 2348 list->append(*CSSIdentifierValue::create(CSSValueDense)); |
| 2348 break; | 2349 break; |
| 2349 default: | 2350 default: |
| 2350 // Do nothing. | 2351 // Do nothing. |
| 2351 break; | 2352 break; |
| 2352 } | 2353 } |
| 2353 | 2354 |
| 2354 return list; | 2355 return list; |
| 2355 } | 2356 } |
| 2356 // Specs mention that getComputedStyle() should return the used value of the
property instead of the computed | 2357 // Specs mention that getComputedStyle() should return the used value of the
property instead of the computed |
| 2357 // one for grid-template-{rows|columns} but not for the grid-auto-{rows|colu
mns} as things like | 2358 // one for grid-template-{rows|columns} but not for the grid-auto-{rows|colu
mns} as things like |
| (...skipping 30 matching lines...) Expand all Loading... |
| 2388 case CSSPropertyGridTemplate: | 2389 case CSSPropertyGridTemplate: |
| 2389 return valuesForGridShorthand(gridTemplateShorthand(), style, | 2390 return valuesForGridShorthand(gridTemplateShorthand(), style, |
| 2390 layoutObject, styledNode, | 2391 layoutObject, styledNode, |
| 2391 allowVisitedStyle); | 2392 allowVisitedStyle); |
| 2392 case CSSPropertyGrid: | 2393 case CSSPropertyGrid: |
| 2393 return valuesForGridShorthand(gridShorthand(), style, layoutObject, | 2394 return valuesForGridShorthand(gridShorthand(), style, layoutObject, |
| 2394 styledNode, allowVisitedStyle); | 2395 styledNode, allowVisitedStyle); |
| 2395 case CSSPropertyGridTemplateAreas: | 2396 case CSSPropertyGridTemplateAreas: |
| 2396 if (!style.namedGridAreaRowCount()) { | 2397 if (!style.namedGridAreaRowCount()) { |
| 2397 ASSERT(!style.namedGridAreaColumnCount()); | 2398 ASSERT(!style.namedGridAreaColumnCount()); |
| 2398 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 2399 return CSSIdentifierValue::create(CSSValueNone); |
| 2399 } | 2400 } |
| 2400 | 2401 |
| 2401 return CSSGridTemplateAreasValue::create( | 2402 return CSSGridTemplateAreasValue::create( |
| 2402 style.namedGridArea(), style.namedGridAreaRowCount(), | 2403 style.namedGridArea(), style.namedGridAreaRowCount(), |
| 2403 style.namedGridAreaColumnCount()); | 2404 style.namedGridAreaColumnCount()); |
| 2404 case CSSPropertyGridColumnGap: | 2405 case CSSPropertyGridColumnGap: |
| 2405 return zoomAdjustedPixelValueForLength(style.gridColumnGap(), style); | 2406 return zoomAdjustedPixelValueForLength(style.gridColumnGap(), style); |
| 2406 case CSSPropertyGridRowGap: | 2407 case CSSPropertyGridRowGap: |
| 2407 return zoomAdjustedPixelValueForLength(style.gridRowGap(), style); | 2408 return zoomAdjustedPixelValueForLength(style.gridRowGap(), style); |
| 2408 case CSSPropertyGridGap: | 2409 case CSSPropertyGridGap: |
| 2409 return valuesForShorthandProperty(gridGapShorthand(), style, layoutObject, | 2410 return valuesForShorthandProperty(gridGapShorthand(), style, layoutObject, |
| 2410 styledNode, allowVisitedStyle); | 2411 styledNode, allowVisitedStyle); |
| 2411 | 2412 |
| 2412 case CSSPropertyHeight: | 2413 case CSSPropertyHeight: |
| 2413 if (layoutObject) { | 2414 if (layoutObject) { |
| 2414 // According to http://www.w3.org/TR/CSS2/visudet.html#the-height-proper
ty, | 2415 // According to http://www.w3.org/TR/CSS2/visudet.html#the-height-proper
ty, |
| 2415 // the "height" property does not apply for non-atomic inline elements. | 2416 // the "height" property does not apply for non-atomic inline elements. |
| 2416 if (!layoutObject->isAtomicInlineLevel() && layoutObject->isInline()) | 2417 if (!layoutObject->isAtomicInlineLevel() && layoutObject->isInline()) |
| 2417 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); | 2418 return CSSIdentifierValue::create(CSSValueAuto); |
| 2418 return zoomAdjustedPixelValue(sizingBox(layoutObject).height(), style); | 2419 return zoomAdjustedPixelValue(sizingBox(layoutObject).height(), style); |
| 2419 } | 2420 } |
| 2420 return zoomAdjustedPixelValueForLength(style.height(), style); | 2421 return zoomAdjustedPixelValueForLength(style.height(), style); |
| 2421 case CSSPropertyWebkitHighlight: | 2422 case CSSPropertyWebkitHighlight: |
| 2422 if (style.highlight() == nullAtom) | 2423 if (style.highlight() == nullAtom) |
| 2423 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 2424 return CSSIdentifierValue::create(CSSValueNone); |
| 2424 return CSSStringValue::create(style.highlight()); | 2425 return CSSStringValue::create(style.highlight()); |
| 2425 case CSSPropertyHyphens: | 2426 case CSSPropertyHyphens: |
| 2426 return CSSPrimitiveValue::create(style.getHyphens()); | 2427 return CSSIdentifierValue::create(style.getHyphens()); |
| 2427 case CSSPropertyWebkitHyphenateCharacter: | 2428 case CSSPropertyWebkitHyphenateCharacter: |
| 2428 if (style.hyphenationString().isNull()) | 2429 if (style.hyphenationString().isNull()) |
| 2429 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); | 2430 return CSSIdentifierValue::create(CSSValueAuto); |
| 2430 return CSSStringValue::create(style.hyphenationString()); | 2431 return CSSStringValue::create(style.hyphenationString()); |
| 2431 case CSSPropertyImageRendering: | 2432 case CSSPropertyImageRendering: |
| 2432 return CSSPrimitiveValue::create(style.imageRendering()); | 2433 return CSSIdentifierValue::create(style.imageRendering()); |
| 2433 case CSSPropertyImageOrientation: | 2434 case CSSPropertyImageOrientation: |
| 2434 if (style.respectImageOrientation() == RespectImageOrientation) | 2435 if (style.respectImageOrientation() == RespectImageOrientation) |
| 2435 return CSSPrimitiveValue::createIdentifier(CSSValueFromImage); | 2436 return CSSIdentifierValue::create(CSSValueFromImage); |
| 2436 return CSSPrimitiveValue::create(0, CSSPrimitiveValue::UnitType::Degrees); | 2437 return CSSPrimitiveValue::create(0, CSSPrimitiveValue::UnitType::Degrees); |
| 2437 case CSSPropertyIsolation: | 2438 case CSSPropertyIsolation: |
| 2438 return CSSPrimitiveValue::create(style.isolation()); | 2439 return CSSIdentifierValue::create(style.isolation()); |
| 2439 case CSSPropertyJustifyItems: | 2440 case CSSPropertyJustifyItems: |
| 2440 return valueForItemPositionWithOverflowAlignment(style.justifyItems()); | 2441 return valueForItemPositionWithOverflowAlignment(style.justifyItems()); |
| 2441 case CSSPropertyJustifySelf: | 2442 case CSSPropertyJustifySelf: |
| 2442 return valueForItemPositionWithOverflowAlignment(style.justifySelf()); | 2443 return valueForItemPositionWithOverflowAlignment(style.justifySelf()); |
| 2443 case CSSPropertyLeft: | 2444 case CSSPropertyLeft: |
| 2444 return valueForPositionOffset(style, CSSPropertyLeft, layoutObject); | 2445 return valueForPositionOffset(style, CSSPropertyLeft, layoutObject); |
| 2445 case CSSPropertyLetterSpacing: | 2446 case CSSPropertyLetterSpacing: |
| 2446 if (!style.letterSpacing()) | 2447 if (!style.letterSpacing()) |
| 2447 return CSSPrimitiveValue::createIdentifier(CSSValueNormal); | 2448 return CSSIdentifierValue::create(CSSValueNormal); |
| 2448 return zoomAdjustedPixelValue(style.letterSpacing(), style); | 2449 return zoomAdjustedPixelValue(style.letterSpacing(), style); |
| 2449 case CSSPropertyWebkitLineClamp: | 2450 case CSSPropertyWebkitLineClamp: |
| 2450 if (style.lineClamp().isNone()) | 2451 if (style.lineClamp().isNone()) |
| 2451 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 2452 return CSSIdentifierValue::create(CSSValueNone); |
| 2452 return CSSPrimitiveValue::create( | 2453 return CSSPrimitiveValue::create( |
| 2453 style.lineClamp().value(), | 2454 style.lineClamp().value(), |
| 2454 style.lineClamp().isPercentage() | 2455 style.lineClamp().isPercentage() |
| 2455 ? CSSPrimitiveValue::UnitType::Percentage | 2456 ? CSSPrimitiveValue::UnitType::Percentage |
| 2456 : CSSPrimitiveValue::UnitType::Number); | 2457 : CSSPrimitiveValue::UnitType::Number); |
| 2457 case CSSPropertyLineHeight: | 2458 case CSSPropertyLineHeight: |
| 2458 return valueForLineHeight(style); | 2459 return valueForLineHeight(style); |
| 2459 case CSSPropertyListStyleImage: | 2460 case CSSPropertyListStyleImage: |
| 2460 if (style.listStyleImage()) | 2461 if (style.listStyleImage()) |
| 2461 return style.listStyleImage()->computedCSSValue(); | 2462 return style.listStyleImage()->computedCSSValue(); |
| 2462 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 2463 return CSSIdentifierValue::create(CSSValueNone); |
| 2463 case CSSPropertyListStylePosition: | 2464 case CSSPropertyListStylePosition: |
| 2464 return CSSPrimitiveValue::create(style.listStylePosition()); | 2465 return CSSIdentifierValue::create(style.listStylePosition()); |
| 2465 case CSSPropertyListStyleType: | 2466 case CSSPropertyListStyleType: |
| 2466 return CSSPrimitiveValue::create(style.listStyleType()); | 2467 return CSSIdentifierValue::create(style.listStyleType()); |
| 2467 case CSSPropertyWebkitLocale: | 2468 case CSSPropertyWebkitLocale: |
| 2468 if (style.locale().isNull()) | 2469 if (style.locale().isNull()) |
| 2469 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); | 2470 return CSSIdentifierValue::create(CSSValueAuto); |
| 2470 return CSSStringValue::create(style.locale()); | 2471 return CSSStringValue::create(style.locale()); |
| 2471 case CSSPropertyMarginTop: { | 2472 case CSSPropertyMarginTop: { |
| 2472 Length marginTop = style.marginTop(); | 2473 Length marginTop = style.marginTop(); |
| 2473 if (marginTop.isFixed() || !layoutObject || !layoutObject->isBox()) | 2474 if (marginTop.isFixed() || !layoutObject || !layoutObject->isBox()) |
| 2474 return zoomAdjustedPixelValueForLength(marginTop, style); | 2475 return zoomAdjustedPixelValueForLength(marginTop, style); |
| 2475 return zoomAdjustedPixelValue(toLayoutBox(layoutObject)->marginTop(), | 2476 return zoomAdjustedPixelValue(toLayoutBox(layoutObject)->marginTop(), |
| 2476 style); | 2477 style); |
| 2477 } | 2478 } |
| 2478 case CSSPropertyMarginRight: { | 2479 case CSSPropertyMarginRight: { |
| 2479 Length marginRight = style.marginRight(); | 2480 Length marginRight = style.marginRight(); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 2501 style); | 2502 style); |
| 2502 } | 2503 } |
| 2503 case CSSPropertyMarginLeft: { | 2504 case CSSPropertyMarginLeft: { |
| 2504 Length marginLeft = style.marginLeft(); | 2505 Length marginLeft = style.marginLeft(); |
| 2505 if (marginLeft.isFixed() || !layoutObject || !layoutObject->isBox()) | 2506 if (marginLeft.isFixed() || !layoutObject || !layoutObject->isBox()) |
| 2506 return zoomAdjustedPixelValueForLength(marginLeft, style); | 2507 return zoomAdjustedPixelValueForLength(marginLeft, style); |
| 2507 return zoomAdjustedPixelValue(toLayoutBox(layoutObject)->marginLeft(), | 2508 return zoomAdjustedPixelValue(toLayoutBox(layoutObject)->marginLeft(), |
| 2508 style); | 2509 style); |
| 2509 } | 2510 } |
| 2510 case CSSPropertyWebkitUserModify: | 2511 case CSSPropertyWebkitUserModify: |
| 2511 return CSSPrimitiveValue::create(style.userModify()); | 2512 return CSSIdentifierValue::create(style.userModify()); |
| 2512 case CSSPropertyMaxHeight: { | 2513 case CSSPropertyMaxHeight: { |
| 2513 const Length& maxHeight = style.maxHeight(); | 2514 const Length& maxHeight = style.maxHeight(); |
| 2514 if (maxHeight.isMaxSizeNone()) | 2515 if (maxHeight.isMaxSizeNone()) |
| 2515 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 2516 return CSSIdentifierValue::create(CSSValueNone); |
| 2516 return zoomAdjustedPixelValueForLength(maxHeight, style); | 2517 return zoomAdjustedPixelValueForLength(maxHeight, style); |
| 2517 } | 2518 } |
| 2518 case CSSPropertyMaxWidth: { | 2519 case CSSPropertyMaxWidth: { |
| 2519 const Length& maxWidth = style.maxWidth(); | 2520 const Length& maxWidth = style.maxWidth(); |
| 2520 if (maxWidth.isMaxSizeNone()) | 2521 if (maxWidth.isMaxSizeNone()) |
| 2521 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 2522 return CSSIdentifierValue::create(CSSValueNone); |
| 2522 return zoomAdjustedPixelValueForLength(maxWidth, style); | 2523 return zoomAdjustedPixelValueForLength(maxWidth, style); |
| 2523 } | 2524 } |
| 2524 case CSSPropertyMinHeight: | 2525 case CSSPropertyMinHeight: |
| 2525 if (style.minHeight().isAuto()) { | 2526 if (style.minHeight().isAuto()) { |
| 2526 Node* parent = styledNode->parentNode(); | 2527 Node* parent = styledNode->parentNode(); |
| 2527 if (isFlexOrGrid(parent ? parent->ensureComputedStyle() : nullptr)) | 2528 if (isFlexOrGrid(parent ? parent->ensureComputedStyle() : nullptr)) |
| 2528 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); | 2529 return CSSIdentifierValue::create(CSSValueAuto); |
| 2529 return zoomAdjustedPixelValue(0, style); | 2530 return zoomAdjustedPixelValue(0, style); |
| 2530 } | 2531 } |
| 2531 return zoomAdjustedPixelValueForLength(style.minHeight(), style); | 2532 return zoomAdjustedPixelValueForLength(style.minHeight(), style); |
| 2532 case CSSPropertyMinWidth: | 2533 case CSSPropertyMinWidth: |
| 2533 if (style.minWidth().isAuto()) { | 2534 if (style.minWidth().isAuto()) { |
| 2534 Node* parent = styledNode->parentNode(); | 2535 Node* parent = styledNode->parentNode(); |
| 2535 if (isFlexOrGrid(parent ? parent->ensureComputedStyle() : nullptr)) | 2536 if (isFlexOrGrid(parent ? parent->ensureComputedStyle() : nullptr)) |
| 2536 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); | 2537 return CSSIdentifierValue::create(CSSValueAuto); |
| 2537 return zoomAdjustedPixelValue(0, style); | 2538 return zoomAdjustedPixelValue(0, style); |
| 2538 } | 2539 } |
| 2539 return zoomAdjustedPixelValueForLength(style.minWidth(), style); | 2540 return zoomAdjustedPixelValueForLength(style.minWidth(), style); |
| 2540 case CSSPropertyObjectFit: | 2541 case CSSPropertyObjectFit: |
| 2541 return CSSPrimitiveValue::create(style.getObjectFit()); | 2542 return CSSIdentifierValue::create(style.getObjectFit()); |
| 2542 case CSSPropertyObjectPosition: | 2543 case CSSPropertyObjectPosition: |
| 2543 return CSSValuePair::create( | 2544 return CSSValuePair::create( |
| 2544 zoomAdjustedPixelValueForLength(style.objectPosition().x(), style), | 2545 zoomAdjustedPixelValueForLength(style.objectPosition().x(), style), |
| 2545 zoomAdjustedPixelValueForLength(style.objectPosition().y(), style), | 2546 zoomAdjustedPixelValueForLength(style.objectPosition().y(), style), |
| 2546 CSSValuePair::KeepIdenticalValues); | 2547 CSSValuePair::KeepIdenticalValues); |
| 2547 case CSSPropertyOpacity: | 2548 case CSSPropertyOpacity: |
| 2548 return CSSPrimitiveValue::create(style.opacity(), | 2549 return CSSPrimitiveValue::create(style.opacity(), |
| 2549 CSSPrimitiveValue::UnitType::Number); | 2550 CSSPrimitiveValue::UnitType::Number); |
| 2550 case CSSPropertyOrphans: | 2551 case CSSPropertyOrphans: |
| 2551 return CSSPrimitiveValue::create(style.orphans(), | 2552 return CSSPrimitiveValue::create(style.orphans(), |
| 2552 CSSPrimitiveValue::UnitType::Number); | 2553 CSSPrimitiveValue::UnitType::Number); |
| 2553 case CSSPropertyOutlineColor: | 2554 case CSSPropertyOutlineColor: |
| 2554 return allowVisitedStyle | 2555 return allowVisitedStyle |
| 2555 ? CSSColorValue::create( | 2556 ? CSSColorValue::create( |
| 2556 style.visitedDependentColor(CSSPropertyOutlineColor) | 2557 style.visitedDependentColor(CSSPropertyOutlineColor) |
| 2557 .rgb()) | 2558 .rgb()) |
| 2558 : currentColorOrValidColor(style, style.outlineColor()); | 2559 : currentColorOrValidColor(style, style.outlineColor()); |
| 2559 case CSSPropertyOutlineOffset: | 2560 case CSSPropertyOutlineOffset: |
| 2560 return zoomAdjustedPixelValue(style.outlineOffset(), style); | 2561 return zoomAdjustedPixelValue(style.outlineOffset(), style); |
| 2561 case CSSPropertyOutlineStyle: | 2562 case CSSPropertyOutlineStyle: |
| 2562 if (style.outlineStyleIsAuto()) | 2563 if (style.outlineStyleIsAuto()) |
| 2563 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); | 2564 return CSSIdentifierValue::create(CSSValueAuto); |
| 2564 return CSSPrimitiveValue::create(style.outlineStyle()); | 2565 return CSSIdentifierValue::create(style.outlineStyle()); |
| 2565 case CSSPropertyOutlineWidth: | 2566 case CSSPropertyOutlineWidth: |
| 2566 return zoomAdjustedPixelValue(style.outlineWidth(), style); | 2567 return zoomAdjustedPixelValue(style.outlineWidth(), style); |
| 2567 case CSSPropertyOverflow: | 2568 case CSSPropertyOverflow: |
| 2568 return CSSPrimitiveValue::create( | 2569 return CSSIdentifierValue::create( |
| 2569 max(style.overflowX(), style.overflowY())); | 2570 max(style.overflowX(), style.overflowY())); |
| 2570 case CSSPropertyOverflowAnchor: | 2571 case CSSPropertyOverflowAnchor: |
| 2571 return CSSPrimitiveValue::create(style.overflowAnchor()); | 2572 return CSSIdentifierValue::create(style.overflowAnchor()); |
| 2572 case CSSPropertyOverflowWrap: | 2573 case CSSPropertyOverflowWrap: |
| 2573 return CSSPrimitiveValue::create(style.overflowWrap()); | 2574 return CSSIdentifierValue::create(style.overflowWrap()); |
| 2574 case CSSPropertyOverflowX: | 2575 case CSSPropertyOverflowX: |
| 2575 return CSSPrimitiveValue::create(style.overflowX()); | 2576 return CSSIdentifierValue::create(style.overflowX()); |
| 2576 case CSSPropertyOverflowY: | 2577 case CSSPropertyOverflowY: |
| 2577 return CSSPrimitiveValue::create(style.overflowY()); | 2578 return CSSIdentifierValue::create(style.overflowY()); |
| 2578 case CSSPropertyPaddingTop: { | 2579 case CSSPropertyPaddingTop: { |
| 2579 Length paddingTop = style.paddingTop(); | 2580 Length paddingTop = style.paddingTop(); |
| 2580 if (paddingTop.isFixed() || !layoutObject || !layoutObject->isBox()) | 2581 if (paddingTop.isFixed() || !layoutObject || !layoutObject->isBox()) |
| 2581 return zoomAdjustedPixelValueForLength(paddingTop, style); | 2582 return zoomAdjustedPixelValueForLength(paddingTop, style); |
| 2582 return zoomAdjustedPixelValue( | 2583 return zoomAdjustedPixelValue( |
| 2583 toLayoutBox(layoutObject)->computedCSSPaddingTop(), style); | 2584 toLayoutBox(layoutObject)->computedCSSPaddingTop(), style); |
| 2584 } | 2585 } |
| 2585 case CSSPropertyPaddingRight: { | 2586 case CSSPropertyPaddingRight: { |
| 2586 Length paddingRight = style.paddingRight(); | 2587 Length paddingRight = style.paddingRight(); |
| 2587 if (paddingRight.isFixed() || !layoutObject || !layoutObject->isBox()) | 2588 if (paddingRight.isFixed() || !layoutObject || !layoutObject->isBox()) |
| 2588 return zoomAdjustedPixelValueForLength(paddingRight, style); | 2589 return zoomAdjustedPixelValueForLength(paddingRight, style); |
| 2589 return zoomAdjustedPixelValue( | 2590 return zoomAdjustedPixelValue( |
| 2590 toLayoutBox(layoutObject)->computedCSSPaddingRight(), style); | 2591 toLayoutBox(layoutObject)->computedCSSPaddingRight(), style); |
| 2591 } | 2592 } |
| 2592 case CSSPropertyPaddingBottom: { | 2593 case CSSPropertyPaddingBottom: { |
| 2593 Length paddingBottom = style.paddingBottom(); | 2594 Length paddingBottom = style.paddingBottom(); |
| 2594 if (paddingBottom.isFixed() || !layoutObject || !layoutObject->isBox()) | 2595 if (paddingBottom.isFixed() || !layoutObject || !layoutObject->isBox()) |
| 2595 return zoomAdjustedPixelValueForLength(paddingBottom, style); | 2596 return zoomAdjustedPixelValueForLength(paddingBottom, style); |
| 2596 return zoomAdjustedPixelValue( | 2597 return zoomAdjustedPixelValue( |
| 2597 toLayoutBox(layoutObject)->computedCSSPaddingBottom(), style); | 2598 toLayoutBox(layoutObject)->computedCSSPaddingBottom(), style); |
| 2598 } | 2599 } |
| 2599 case CSSPropertyPaddingLeft: { | 2600 case CSSPropertyPaddingLeft: { |
| 2600 Length paddingLeft = style.paddingLeft(); | 2601 Length paddingLeft = style.paddingLeft(); |
| 2601 if (paddingLeft.isFixed() || !layoutObject || !layoutObject->isBox()) | 2602 if (paddingLeft.isFixed() || !layoutObject || !layoutObject->isBox()) |
| 2602 return zoomAdjustedPixelValueForLength(paddingLeft, style); | 2603 return zoomAdjustedPixelValueForLength(paddingLeft, style); |
| 2603 return zoomAdjustedPixelValue( | 2604 return zoomAdjustedPixelValue( |
| 2604 toLayoutBox(layoutObject)->computedCSSPaddingLeft(), style); | 2605 toLayoutBox(layoutObject)->computedCSSPaddingLeft(), style); |
| 2605 } | 2606 } |
| 2606 case CSSPropertyBreakAfter: | 2607 case CSSPropertyBreakAfter: |
| 2607 return CSSPrimitiveValue::create(style.breakAfter()); | 2608 return CSSIdentifierValue::create(style.breakAfter()); |
| 2608 case CSSPropertyBreakBefore: | 2609 case CSSPropertyBreakBefore: |
| 2609 return CSSPrimitiveValue::create(style.breakBefore()); | 2610 return CSSIdentifierValue::create(style.breakBefore()); |
| 2610 case CSSPropertyBreakInside: | 2611 case CSSPropertyBreakInside: |
| 2611 return CSSPrimitiveValue::create(style.breakInside()); | 2612 return CSSIdentifierValue::create(style.breakInside()); |
| 2612 case CSSPropertyPageBreakAfter: | 2613 case CSSPropertyPageBreakAfter: |
| 2613 return CSSPrimitiveValue::create(mapToPageBreakValue(style.breakAfter())); | 2614 return CSSIdentifierValue::create( |
| 2615 mapToPageBreakValue(style.breakAfter())); |
| 2614 case CSSPropertyPageBreakBefore: | 2616 case CSSPropertyPageBreakBefore: |
| 2615 return CSSPrimitiveValue::create( | 2617 return CSSIdentifierValue::create( |
| 2616 mapToPageBreakValue(style.breakBefore())); | 2618 mapToPageBreakValue(style.breakBefore())); |
| 2617 case CSSPropertyPageBreakInside: | 2619 case CSSPropertyPageBreakInside: |
| 2618 return CSSPrimitiveValue::create( | 2620 return CSSIdentifierValue::create( |
| 2619 mapToPageBreakValue(style.breakInside())); | 2621 mapToPageBreakValue(style.breakInside())); |
| 2620 case CSSPropertyPosition: | 2622 case CSSPropertyPosition: |
| 2621 return CSSPrimitiveValue::create(style.position()); | 2623 return CSSIdentifierValue::create(style.position()); |
| 2622 case CSSPropertyQuotes: | 2624 case CSSPropertyQuotes: |
| 2623 if (!style.quotes()) { | 2625 if (!style.quotes()) { |
| 2624 // TODO(ramya.v): We should return the quote values that we're actually
using. | 2626 // TODO(ramya.v): We should return the quote values that we're actually
using. |
| 2625 return nullptr; | 2627 return nullptr; |
| 2626 } | 2628 } |
| 2627 if (style.quotes()->size()) { | 2629 if (style.quotes()->size()) { |
| 2628 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 2630 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
| 2629 for (int i = 0; i < style.quotes()->size(); i++) { | 2631 for (int i = 0; i < style.quotes()->size(); i++) { |
| 2630 list->append( | 2632 list->append( |
| 2631 *CSSStringValue::create(style.quotes()->getOpenQuote(i))); | 2633 *CSSStringValue::create(style.quotes()->getOpenQuote(i))); |
| 2632 list->append( | 2634 list->append( |
| 2633 *CSSStringValue::create(style.quotes()->getCloseQuote(i))); | 2635 *CSSStringValue::create(style.quotes()->getCloseQuote(i))); |
| 2634 } | 2636 } |
| 2635 return list; | 2637 return list; |
| 2636 } | 2638 } |
| 2637 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 2639 return CSSIdentifierValue::create(CSSValueNone); |
| 2638 case CSSPropertyRight: | 2640 case CSSPropertyRight: |
| 2639 return valueForPositionOffset(style, CSSPropertyRight, layoutObject); | 2641 return valueForPositionOffset(style, CSSPropertyRight, layoutObject); |
| 2640 case CSSPropertyWebkitRubyPosition: | 2642 case CSSPropertyWebkitRubyPosition: |
| 2641 return CSSPrimitiveValue::create(style.getRubyPosition()); | 2643 return CSSIdentifierValue::create(style.getRubyPosition()); |
| 2642 case CSSPropertyScrollBehavior: | 2644 case CSSPropertyScrollBehavior: |
| 2643 return CSSPrimitiveValue::create(style.getScrollBehavior()); | 2645 return CSSIdentifierValue::create(style.getScrollBehavior()); |
| 2644 case CSSPropertyTableLayout: | 2646 case CSSPropertyTableLayout: |
| 2645 return CSSPrimitiveValue::create(style.tableLayout()); | 2647 return CSSIdentifierValue::create(style.tableLayout()); |
| 2646 case CSSPropertyTextAlign: | 2648 case CSSPropertyTextAlign: |
| 2647 return CSSPrimitiveValue::create(style.textAlign()); | 2649 return CSSIdentifierValue::create(style.textAlign()); |
| 2648 case CSSPropertyTextAlignLast: | 2650 case CSSPropertyTextAlignLast: |
| 2649 return CSSPrimitiveValue::create(style.getTextAlignLast()); | 2651 return CSSIdentifierValue::create(style.getTextAlignLast()); |
| 2650 case CSSPropertyTextDecoration: | 2652 case CSSPropertyTextDecoration: |
| 2651 if (RuntimeEnabledFeatures::css3TextDecorationsEnabled()) | 2653 if (RuntimeEnabledFeatures::css3TextDecorationsEnabled()) |
| 2652 return valuesForShorthandProperty(textDecorationShorthand(), style, | 2654 return valuesForShorthandProperty(textDecorationShorthand(), style, |
| 2653 layoutObject, styledNode, | 2655 layoutObject, styledNode, |
| 2654 allowVisitedStyle); | 2656 allowVisitedStyle); |
| 2655 // Fall through. | 2657 // Fall through. |
| 2656 case CSSPropertyTextDecorationLine: | 2658 case CSSPropertyTextDecorationLine: |
| 2657 return renderTextDecorationFlagsToCSSValue(style.getTextDecoration()); | 2659 return renderTextDecorationFlagsToCSSValue(style.getTextDecoration()); |
| 2658 case CSSPropertyTextDecorationStyle: | 2660 case CSSPropertyTextDecorationStyle: |
| 2659 return valueForTextDecorationStyle(style.getTextDecorationStyle()); | 2661 return valueForTextDecorationStyle(style.getTextDecorationStyle()); |
| 2660 case CSSPropertyTextDecorationColor: | 2662 case CSSPropertyTextDecorationColor: |
| 2661 return currentColorOrValidColor(style, style.textDecorationColor()); | 2663 return currentColorOrValidColor(style, style.textDecorationColor()); |
| 2662 case CSSPropertyTextJustify: | 2664 case CSSPropertyTextJustify: |
| 2663 return CSSPrimitiveValue::create(style.getTextJustify()); | 2665 return CSSIdentifierValue::create(style.getTextJustify()); |
| 2664 case CSSPropertyTextUnderlinePosition: | 2666 case CSSPropertyTextUnderlinePosition: |
| 2665 return CSSPrimitiveValue::create(style.getTextUnderlinePosition()); | 2667 return CSSIdentifierValue::create(style.getTextUnderlinePosition()); |
| 2666 case CSSPropertyWebkitTextDecorationsInEffect: | 2668 case CSSPropertyWebkitTextDecorationsInEffect: |
| 2667 return renderTextDecorationFlagsToCSSValue( | 2669 return renderTextDecorationFlagsToCSSValue( |
| 2668 style.textDecorationsInEffect()); | 2670 style.textDecorationsInEffect()); |
| 2669 case CSSPropertyWebkitTextFillColor: | 2671 case CSSPropertyWebkitTextFillColor: |
| 2670 return currentColorOrValidColor(style, style.textFillColor()); | 2672 return currentColorOrValidColor(style, style.textFillColor()); |
| 2671 case CSSPropertyWebkitTextEmphasisColor: | 2673 case CSSPropertyWebkitTextEmphasisColor: |
| 2672 return currentColorOrValidColor(style, style.textEmphasisColor()); | 2674 return currentColorOrValidColor(style, style.textEmphasisColor()); |
| 2673 case CSSPropertyWebkitTextEmphasisPosition: | 2675 case CSSPropertyWebkitTextEmphasisPosition: |
| 2674 return CSSPrimitiveValue::create(style.getTextEmphasisPosition()); | 2676 return CSSIdentifierValue::create(style.getTextEmphasisPosition()); |
| 2675 case CSSPropertyWebkitTextEmphasisStyle: | 2677 case CSSPropertyWebkitTextEmphasisStyle: |
| 2676 switch (style.getTextEmphasisMark()) { | 2678 switch (style.getTextEmphasisMark()) { |
| 2677 case TextEmphasisMarkNone: | 2679 case TextEmphasisMarkNone: |
| 2678 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 2680 return CSSIdentifierValue::create(CSSValueNone); |
| 2679 case TextEmphasisMarkCustom: | 2681 case TextEmphasisMarkCustom: |
| 2680 return CSSStringValue::create(style.textEmphasisCustomMark()); | 2682 return CSSStringValue::create(style.textEmphasisCustomMark()); |
| 2681 case TextEmphasisMarkAuto: | 2683 case TextEmphasisMarkAuto: |
| 2682 ASSERT_NOT_REACHED(); | 2684 ASSERT_NOT_REACHED(); |
| 2683 // Fall through | 2685 // Fall through |
| 2684 case TextEmphasisMarkDot: | 2686 case TextEmphasisMarkDot: |
| 2685 case TextEmphasisMarkCircle: | 2687 case TextEmphasisMarkCircle: |
| 2686 case TextEmphasisMarkDoubleCircle: | 2688 case TextEmphasisMarkDoubleCircle: |
| 2687 case TextEmphasisMarkTriangle: | 2689 case TextEmphasisMarkTriangle: |
| 2688 case TextEmphasisMarkSesame: { | 2690 case TextEmphasisMarkSesame: { |
| 2689 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 2691 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
| 2690 list->append(*CSSPrimitiveValue::create(style.getTextEmphasisFill())); | 2692 list->append( |
| 2691 list->append(*CSSPrimitiveValue::create(style.getTextEmphasisMark())); | 2693 *CSSIdentifierValue::create(style.getTextEmphasisFill())); |
| 2694 list->append( |
| 2695 *CSSIdentifierValue::create(style.getTextEmphasisMark())); |
| 2692 return list; | 2696 return list; |
| 2693 } | 2697 } |
| 2694 } | 2698 } |
| 2695 case CSSPropertyTextIndent: { | 2699 case CSSPropertyTextIndent: { |
| 2696 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 2700 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
| 2697 list->append(*zoomAdjustedPixelValueForLength(style.textIndent(), style)); | 2701 list->append(*zoomAdjustedPixelValueForLength(style.textIndent(), style)); |
| 2698 if (RuntimeEnabledFeatures::css3TextEnabled() && | 2702 if (RuntimeEnabledFeatures::css3TextEnabled() && |
| 2699 (style.getTextIndentLine() == TextIndentEachLine || | 2703 (style.getTextIndentLine() == TextIndentEachLine || |
| 2700 style.getTextIndentType() == TextIndentHanging)) { | 2704 style.getTextIndentType() == TextIndentHanging)) { |
| 2701 if (style.getTextIndentLine() == TextIndentEachLine) | 2705 if (style.getTextIndentLine() == TextIndentEachLine) |
| 2702 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueEachLine)); | 2706 list->append(*CSSIdentifierValue::create(CSSValueEachLine)); |
| 2703 if (style.getTextIndentType() == TextIndentHanging) | 2707 if (style.getTextIndentType() == TextIndentHanging) |
| 2704 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueHanging)); | 2708 list->append(*CSSIdentifierValue::create(CSSValueHanging)); |
| 2705 } | 2709 } |
| 2706 return list; | 2710 return list; |
| 2707 } | 2711 } |
| 2708 case CSSPropertyTextShadow: | 2712 case CSSPropertyTextShadow: |
| 2709 return valueForShadowList(style.textShadow(), style, false); | 2713 return valueForShadowList(style.textShadow(), style, false); |
| 2710 case CSSPropertyTextRendering: | 2714 case CSSPropertyTextRendering: |
| 2711 return CSSPrimitiveValue::create( | 2715 return CSSIdentifierValue::create( |
| 2712 style.getFontDescription().textRendering()); | 2716 style.getFontDescription().textRendering()); |
| 2713 case CSSPropertyTextOverflow: | 2717 case CSSPropertyTextOverflow: |
| 2714 if (style.getTextOverflow()) | 2718 if (style.getTextOverflow()) |
| 2715 return CSSPrimitiveValue::createIdentifier(CSSValueEllipsis); | 2719 return CSSIdentifierValue::create(CSSValueEllipsis); |
| 2716 return CSSPrimitiveValue::createIdentifier(CSSValueClip); | 2720 return CSSIdentifierValue::create(CSSValueClip); |
| 2717 case CSSPropertyWebkitTextSecurity: | 2721 case CSSPropertyWebkitTextSecurity: |
| 2718 return CSSPrimitiveValue::create(style.textSecurity()); | 2722 return CSSIdentifierValue::create(style.textSecurity()); |
| 2719 case CSSPropertyWebkitTextStrokeColor: | 2723 case CSSPropertyWebkitTextStrokeColor: |
| 2720 return currentColorOrValidColor(style, style.textStrokeColor()); | 2724 return currentColorOrValidColor(style, style.textStrokeColor()); |
| 2721 case CSSPropertyWebkitTextStrokeWidth: | 2725 case CSSPropertyWebkitTextStrokeWidth: |
| 2722 return zoomAdjustedPixelValue(style.textStrokeWidth(), style); | 2726 return zoomAdjustedPixelValue(style.textStrokeWidth(), style); |
| 2723 case CSSPropertyTextTransform: | 2727 case CSSPropertyTextTransform: |
| 2724 return CSSPrimitiveValue::create(style.textTransform()); | 2728 return CSSIdentifierValue::create(style.textTransform()); |
| 2725 case CSSPropertyTop: | 2729 case CSSPropertyTop: |
| 2726 return valueForPositionOffset(style, CSSPropertyTop, layoutObject); | 2730 return valueForPositionOffset(style, CSSPropertyTop, layoutObject); |
| 2727 case CSSPropertyTouchAction: | 2731 case CSSPropertyTouchAction: |
| 2728 return touchActionFlagsToCSSValue(style.getTouchAction()); | 2732 return touchActionFlagsToCSSValue(style.getTouchAction()); |
| 2729 case CSSPropertyUnicodeBidi: | 2733 case CSSPropertyUnicodeBidi: |
| 2730 return CSSPrimitiveValue::create(style.unicodeBidi()); | 2734 return CSSIdentifierValue::create(style.unicodeBidi()); |
| 2731 case CSSPropertyVerticalAlign: | 2735 case CSSPropertyVerticalAlign: |
| 2732 switch (style.verticalAlign()) { | 2736 switch (style.verticalAlign()) { |
| 2733 case VerticalAlignBaseline: | 2737 case VerticalAlignBaseline: |
| 2734 return CSSPrimitiveValue::createIdentifier(CSSValueBaseline); | 2738 return CSSIdentifierValue::create(CSSValueBaseline); |
| 2735 case VerticalAlignMiddle: | 2739 case VerticalAlignMiddle: |
| 2736 return CSSPrimitiveValue::createIdentifier(CSSValueMiddle); | 2740 return CSSIdentifierValue::create(CSSValueMiddle); |
| 2737 case VerticalAlignSub: | 2741 case VerticalAlignSub: |
| 2738 return CSSPrimitiveValue::createIdentifier(CSSValueSub); | 2742 return CSSIdentifierValue::create(CSSValueSub); |
| 2739 case VerticalAlignSuper: | 2743 case VerticalAlignSuper: |
| 2740 return CSSPrimitiveValue::createIdentifier(CSSValueSuper); | 2744 return CSSIdentifierValue::create(CSSValueSuper); |
| 2741 case VerticalAlignTextTop: | 2745 case VerticalAlignTextTop: |
| 2742 return CSSPrimitiveValue::createIdentifier(CSSValueTextTop); | 2746 return CSSIdentifierValue::create(CSSValueTextTop); |
| 2743 case VerticalAlignTextBottom: | 2747 case VerticalAlignTextBottom: |
| 2744 return CSSPrimitiveValue::createIdentifier(CSSValueTextBottom); | 2748 return CSSIdentifierValue::create(CSSValueTextBottom); |
| 2745 case VerticalAlignTop: | 2749 case VerticalAlignTop: |
| 2746 return CSSPrimitiveValue::createIdentifier(CSSValueTop); | 2750 return CSSIdentifierValue::create(CSSValueTop); |
| 2747 case VerticalAlignBottom: | 2751 case VerticalAlignBottom: |
| 2748 return CSSPrimitiveValue::createIdentifier(CSSValueBottom); | 2752 return CSSIdentifierValue::create(CSSValueBottom); |
| 2749 case VerticalAlignBaselineMiddle: | 2753 case VerticalAlignBaselineMiddle: |
| 2750 return CSSPrimitiveValue::createIdentifier( | 2754 return CSSIdentifierValue::create(CSSValueWebkitBaselineMiddle); |
| 2751 CSSValueWebkitBaselineMiddle); | |
| 2752 case VerticalAlignLength: | 2755 case VerticalAlignLength: |
| 2753 return zoomAdjustedPixelValueForLength(style.getVerticalAlignLength(), | 2756 return zoomAdjustedPixelValueForLength(style.getVerticalAlignLength(), |
| 2754 style); | 2757 style); |
| 2755 } | 2758 } |
| 2756 ASSERT_NOT_REACHED(); | 2759 ASSERT_NOT_REACHED(); |
| 2757 return nullptr; | 2760 return nullptr; |
| 2758 case CSSPropertyVisibility: | 2761 case CSSPropertyVisibility: |
| 2759 return CSSPrimitiveValue::create(style.visibility()); | 2762 return CSSIdentifierValue::create(style.visibility()); |
| 2760 case CSSPropertyWhiteSpace: | 2763 case CSSPropertyWhiteSpace: |
| 2761 return CSSPrimitiveValue::create(style.whiteSpace()); | 2764 return CSSIdentifierValue::create(style.whiteSpace()); |
| 2762 case CSSPropertyWidows: | 2765 case CSSPropertyWidows: |
| 2763 return CSSPrimitiveValue::create(style.widows(), | 2766 return CSSPrimitiveValue::create(style.widows(), |
| 2764 CSSPrimitiveValue::UnitType::Number); | 2767 CSSPrimitiveValue::UnitType::Number); |
| 2765 case CSSPropertyWidth: | 2768 case CSSPropertyWidth: |
| 2766 if (layoutObject) { | 2769 if (layoutObject) { |
| 2767 // According to http://www.w3.org/TR/CSS2/visudet.html#the-width-propert
y, | 2770 // According to http://www.w3.org/TR/CSS2/visudet.html#the-width-propert
y, |
| 2768 // the "width" property does not apply for non-atomic inline elements. | 2771 // the "width" property does not apply for non-atomic inline elements. |
| 2769 if (!layoutObject->isAtomicInlineLevel() && layoutObject->isInline()) | 2772 if (!layoutObject->isAtomicInlineLevel() && layoutObject->isInline()) |
| 2770 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); | 2773 return CSSIdentifierValue::create(CSSValueAuto); |
| 2771 return zoomAdjustedPixelValue(sizingBox(layoutObject).width(), style); | 2774 return zoomAdjustedPixelValue(sizingBox(layoutObject).width(), style); |
| 2772 } | 2775 } |
| 2773 return zoomAdjustedPixelValueForLength(style.width(), style); | 2776 return zoomAdjustedPixelValueForLength(style.width(), style); |
| 2774 case CSSPropertyWillChange: | 2777 case CSSPropertyWillChange: |
| 2775 return valueForWillChange(style.willChangeProperties(), | 2778 return valueForWillChange(style.willChangeProperties(), |
| 2776 style.willChangeContents(), | 2779 style.willChangeContents(), |
| 2777 style.willChangeScrollPosition()); | 2780 style.willChangeScrollPosition()); |
| 2778 case CSSPropertyWordBreak: | 2781 case CSSPropertyWordBreak: |
| 2779 return CSSPrimitiveValue::create(style.wordBreak()); | 2782 return CSSIdentifierValue::create(style.wordBreak()); |
| 2780 case CSSPropertyWordSpacing: | 2783 case CSSPropertyWordSpacing: |
| 2781 return zoomAdjustedPixelValue(style.wordSpacing(), style); | 2784 return zoomAdjustedPixelValue(style.wordSpacing(), style); |
| 2782 case CSSPropertyWordWrap: | 2785 case CSSPropertyWordWrap: |
| 2783 return CSSPrimitiveValue::create(style.overflowWrap()); | 2786 return CSSIdentifierValue::create(style.overflowWrap()); |
| 2784 case CSSPropertyWebkitLineBreak: | 2787 case CSSPropertyWebkitLineBreak: |
| 2785 return CSSPrimitiveValue::create(style.getLineBreak()); | 2788 return CSSIdentifierValue::create(style.getLineBreak()); |
| 2786 case CSSPropertyResize: | 2789 case CSSPropertyResize: |
| 2787 return CSSPrimitiveValue::create(style.resize()); | 2790 return CSSIdentifierValue::create(style.resize()); |
| 2788 case CSSPropertyFontKerning: | 2791 case CSSPropertyFontKerning: |
| 2789 return CSSPrimitiveValue::create(style.getFontDescription().getKerning()); | 2792 return CSSIdentifierValue::create( |
| 2793 style.getFontDescription().getKerning()); |
| 2790 case CSSPropertyWebkitFontSmoothing: | 2794 case CSSPropertyWebkitFontSmoothing: |
| 2791 return CSSPrimitiveValue::create( | 2795 return CSSIdentifierValue::create( |
| 2792 style.getFontDescription().fontSmoothing()); | 2796 style.getFontDescription().fontSmoothing()); |
| 2793 case CSSPropertyFontVariantLigatures: | 2797 case CSSPropertyFontVariantLigatures: |
| 2794 return valueForFontVariantLigatures(style); | 2798 return valueForFontVariantLigatures(style); |
| 2795 case CSSPropertyFontVariantCaps: | 2799 case CSSPropertyFontVariantCaps: |
| 2796 return valueForFontVariantCaps(style); | 2800 return valueForFontVariantCaps(style); |
| 2797 case CSSPropertyFontVariantNumeric: | 2801 case CSSPropertyFontVariantNumeric: |
| 2798 return valueForFontVariantNumeric(style); | 2802 return valueForFontVariantNumeric(style); |
| 2799 case CSSPropertyZIndex: | 2803 case CSSPropertyZIndex: |
| 2800 if (style.hasAutoZIndex()) | 2804 if (style.hasAutoZIndex()) |
| 2801 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); | 2805 return CSSIdentifierValue::create(CSSValueAuto); |
| 2802 return CSSPrimitiveValue::create(style.zIndex(), | 2806 return CSSPrimitiveValue::create(style.zIndex(), |
| 2803 CSSPrimitiveValue::UnitType::Integer); | 2807 CSSPrimitiveValue::UnitType::Integer); |
| 2804 case CSSPropertyZoom: | 2808 case CSSPropertyZoom: |
| 2805 return CSSPrimitiveValue::create(style.zoom(), | 2809 return CSSPrimitiveValue::create(style.zoom(), |
| 2806 CSSPrimitiveValue::UnitType::Number); | 2810 CSSPrimitiveValue::UnitType::Number); |
| 2807 case CSSPropertyBoxSizing: | 2811 case CSSPropertyBoxSizing: |
| 2808 if (style.boxSizing() == BoxSizingContentBox) | 2812 if (style.boxSizing() == BoxSizingContentBox) |
| 2809 return CSSPrimitiveValue::createIdentifier(CSSValueContentBox); | 2813 return CSSIdentifierValue::create(CSSValueContentBox); |
| 2810 return CSSPrimitiveValue::createIdentifier(CSSValueBorderBox); | 2814 return CSSIdentifierValue::create(CSSValueBorderBox); |
| 2811 case CSSPropertyWebkitAppRegion: | 2815 case CSSPropertyWebkitAppRegion: |
| 2812 return CSSPrimitiveValue::createIdentifier( | 2816 return CSSIdentifierValue::create(style.getDraggableRegionMode() == |
| 2813 style.getDraggableRegionMode() == DraggableRegionDrag | 2817 DraggableRegionDrag |
| 2814 ? CSSValueDrag | 2818 ? CSSValueDrag |
| 2815 : CSSValueNoDrag); | 2819 : CSSValueNoDrag); |
| 2816 case CSSPropertyAnimationDelay: | 2820 case CSSPropertyAnimationDelay: |
| 2817 return valueForAnimationDelay(style.animations()); | 2821 return valueForAnimationDelay(style.animations()); |
| 2818 case CSSPropertyAnimationDirection: { | 2822 case CSSPropertyAnimationDirection: { |
| 2819 CSSValueList* list = CSSValueList::createCommaSeparated(); | 2823 CSSValueList* list = CSSValueList::createCommaSeparated(); |
| 2820 const CSSAnimationData* animationData = style.animations(); | 2824 const CSSAnimationData* animationData = style.animations(); |
| 2821 if (animationData) { | 2825 if (animationData) { |
| 2822 for (size_t i = 0; i < animationData->directionList().size(); ++i) | 2826 for (size_t i = 0; i < animationData->directionList().size(); ++i) |
| 2823 list->append( | 2827 list->append( |
| 2824 *valueForAnimationDirection(animationData->directionList()[i])); | 2828 *valueForAnimationDirection(animationData->directionList()[i])); |
| 2825 } else { | 2829 } else { |
| 2826 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueNormal)); | 2830 list->append(*CSSIdentifierValue::create(CSSValueNormal)); |
| 2827 } | 2831 } |
| 2828 return list; | 2832 return list; |
| 2829 } | 2833 } |
| 2830 case CSSPropertyAnimationDuration: | 2834 case CSSPropertyAnimationDuration: |
| 2831 return valueForAnimationDuration(style.animations()); | 2835 return valueForAnimationDuration(style.animations()); |
| 2832 case CSSPropertyAnimationFillMode: { | 2836 case CSSPropertyAnimationFillMode: { |
| 2833 CSSValueList* list = CSSValueList::createCommaSeparated(); | 2837 CSSValueList* list = CSSValueList::createCommaSeparated(); |
| 2834 const CSSAnimationData* animationData = style.animations(); | 2838 const CSSAnimationData* animationData = style.animations(); |
| 2835 if (animationData) { | 2839 if (animationData) { |
| 2836 for (size_t i = 0; i < animationData->fillModeList().size(); ++i) | 2840 for (size_t i = 0; i < animationData->fillModeList().size(); ++i) |
| 2837 list->append( | 2841 list->append( |
| 2838 *valueForAnimationFillMode(animationData->fillModeList()[i])); | 2842 *valueForAnimationFillMode(animationData->fillModeList()[i])); |
| 2839 } else { | 2843 } else { |
| 2840 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueNone)); | 2844 list->append(*CSSIdentifierValue::create(CSSValueNone)); |
| 2841 } | 2845 } |
| 2842 return list; | 2846 return list; |
| 2843 } | 2847 } |
| 2844 case CSSPropertyAnimationIterationCount: { | 2848 case CSSPropertyAnimationIterationCount: { |
| 2845 CSSValueList* list = CSSValueList::createCommaSeparated(); | 2849 CSSValueList* list = CSSValueList::createCommaSeparated(); |
| 2846 const CSSAnimationData* animationData = style.animations(); | 2850 const CSSAnimationData* animationData = style.animations(); |
| 2847 if (animationData) { | 2851 if (animationData) { |
| 2848 for (size_t i = 0; i < animationData->iterationCountList().size(); ++i) | 2852 for (size_t i = 0; i < animationData->iterationCountList().size(); ++i) |
| 2849 list->append(*valueForAnimationIterationCount( | 2853 list->append(*valueForAnimationIterationCount( |
| 2850 animationData->iterationCountList()[i])); | 2854 animationData->iterationCountList()[i])); |
| 2851 } else { | 2855 } else { |
| 2852 list->append(*CSSPrimitiveValue::create( | 2856 list->append(*CSSPrimitiveValue::create( |
| 2853 CSSAnimationData::initialIterationCount(), | 2857 CSSAnimationData::initialIterationCount(), |
| 2854 CSSPrimitiveValue::UnitType::Number)); | 2858 CSSPrimitiveValue::UnitType::Number)); |
| 2855 } | 2859 } |
| 2856 return list; | 2860 return list; |
| 2857 } | 2861 } |
| 2858 case CSSPropertyAnimationName: { | 2862 case CSSPropertyAnimationName: { |
| 2859 CSSValueList* list = CSSValueList::createCommaSeparated(); | 2863 CSSValueList* list = CSSValueList::createCommaSeparated(); |
| 2860 const CSSAnimationData* animationData = style.animations(); | 2864 const CSSAnimationData* animationData = style.animations(); |
| 2861 if (animationData) { | 2865 if (animationData) { |
| 2862 for (size_t i = 0; i < animationData->nameList().size(); ++i) | 2866 for (size_t i = 0; i < animationData->nameList().size(); ++i) |
| 2863 list->append( | 2867 list->append( |
| 2864 *CSSCustomIdentValue::create(animationData->nameList()[i])); | 2868 *CSSCustomIdentValue::create(animationData->nameList()[i])); |
| 2865 } else { | 2869 } else { |
| 2866 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueNone)); | 2870 list->append(*CSSIdentifierValue::create(CSSValueNone)); |
| 2867 } | 2871 } |
| 2868 return list; | 2872 return list; |
| 2869 } | 2873 } |
| 2870 case CSSPropertyAnimationPlayState: { | 2874 case CSSPropertyAnimationPlayState: { |
| 2871 CSSValueList* list = CSSValueList::createCommaSeparated(); | 2875 CSSValueList* list = CSSValueList::createCommaSeparated(); |
| 2872 const CSSAnimationData* animationData = style.animations(); | 2876 const CSSAnimationData* animationData = style.animations(); |
| 2873 if (animationData) { | 2877 if (animationData) { |
| 2874 for (size_t i = 0; i < animationData->playStateList().size(); ++i) | 2878 for (size_t i = 0; i < animationData->playStateList().size(); ++i) |
| 2875 list->append( | 2879 list->append( |
| 2876 *valueForAnimationPlayState(animationData->playStateList()[i])); | 2880 *valueForAnimationPlayState(animationData->playStateList()[i])); |
| 2877 } else { | 2881 } else { |
| 2878 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueRunning)); | 2882 list->append(*CSSIdentifierValue::create(CSSValueRunning)); |
| 2879 } | 2883 } |
| 2880 return list; | 2884 return list; |
| 2881 } | 2885 } |
| 2882 case CSSPropertyAnimationTimingFunction: | 2886 case CSSPropertyAnimationTimingFunction: |
| 2883 return valueForAnimationTimingFunction(style.animations()); | 2887 return valueForAnimationTimingFunction(style.animations()); |
| 2884 case CSSPropertyAnimation: { | 2888 case CSSPropertyAnimation: { |
| 2885 const CSSAnimationData* animationData = style.animations(); | 2889 const CSSAnimationData* animationData = style.animations(); |
| 2886 if (animationData) { | 2890 if (animationData) { |
| 2887 CSSValueList* animationsList = CSSValueList::createCommaSeparated(); | 2891 CSSValueList* animationsList = CSSValueList::createCommaSeparated(); |
| 2888 for (size_t i = 0; i < animationData->nameList().size(); ++i) { | 2892 for (size_t i = 0; i < animationData->nameList().size(); ++i) { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 2907 CSSTimingData::getRepeated(animationData->fillModeList(), i))); | 2911 CSSTimingData::getRepeated(animationData->fillModeList(), i))); |
| 2908 list->append(*valueForAnimationPlayState( | 2912 list->append(*valueForAnimationPlayState( |
| 2909 CSSTimingData::getRepeated(animationData->playStateList(), i))); | 2913 CSSTimingData::getRepeated(animationData->playStateList(), i))); |
| 2910 animationsList->append(*list); | 2914 animationsList->append(*list); |
| 2911 } | 2915 } |
| 2912 return animationsList; | 2916 return animationsList; |
| 2913 } | 2917 } |
| 2914 | 2918 |
| 2915 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 2919 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
| 2916 // animation-name default value. | 2920 // animation-name default value. |
| 2917 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueNone)); | 2921 list->append(*CSSIdentifierValue::create(CSSValueNone)); |
| 2918 list->append( | 2922 list->append( |
| 2919 *CSSPrimitiveValue::create(CSSAnimationData::initialDuration(), | 2923 *CSSPrimitiveValue::create(CSSAnimationData::initialDuration(), |
| 2920 CSSPrimitiveValue::UnitType::Seconds)); | 2924 CSSPrimitiveValue::UnitType::Seconds)); |
| 2921 list->append(*createTimingFunctionValue( | 2925 list->append(*createTimingFunctionValue( |
| 2922 CSSAnimationData::initialTimingFunction().get())); | 2926 CSSAnimationData::initialTimingFunction().get())); |
| 2923 list->append( | 2927 list->append( |
| 2924 *CSSPrimitiveValue::create(CSSAnimationData::initialDelay(), | 2928 *CSSPrimitiveValue::create(CSSAnimationData::initialDelay(), |
| 2925 CSSPrimitiveValue::UnitType::Seconds)); | 2929 CSSPrimitiveValue::UnitType::Seconds)); |
| 2926 list->append( | 2930 list->append( |
| 2927 *CSSPrimitiveValue::create(CSSAnimationData::initialIterationCount(), | 2931 *CSSPrimitiveValue::create(CSSAnimationData::initialIterationCount(), |
| 2928 CSSPrimitiveValue::UnitType::Number)); | 2932 CSSPrimitiveValue::UnitType::Number)); |
| 2929 list->append( | 2933 list->append( |
| 2930 *valueForAnimationDirection(CSSAnimationData::initialDirection())); | 2934 *valueForAnimationDirection(CSSAnimationData::initialDirection())); |
| 2931 list->append( | 2935 list->append( |
| 2932 *valueForAnimationFillMode(CSSAnimationData::initialFillMode())); | 2936 *valueForAnimationFillMode(CSSAnimationData::initialFillMode())); |
| 2933 // Initial animation-play-state. | 2937 // Initial animation-play-state. |
| 2934 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueRunning)); | 2938 list->append(*CSSIdentifierValue::create(CSSValueRunning)); |
| 2935 return list; | 2939 return list; |
| 2936 } | 2940 } |
| 2937 case CSSPropertyWebkitAppearance: | 2941 case CSSPropertyWebkitAppearance: |
| 2938 return CSSPrimitiveValue::create(style.appearance()); | 2942 return CSSIdentifierValue::create(style.appearance()); |
| 2939 case CSSPropertyBackfaceVisibility: | 2943 case CSSPropertyBackfaceVisibility: |
| 2940 return CSSPrimitiveValue::createIdentifier( | 2944 return CSSIdentifierValue::create( |
| 2941 (style.backfaceVisibility() == BackfaceVisibilityHidden) | 2945 (style.backfaceVisibility() == BackfaceVisibilityHidden) |
| 2942 ? CSSValueHidden | 2946 ? CSSValueHidden |
| 2943 : CSSValueVisible); | 2947 : CSSValueVisible); |
| 2944 case CSSPropertyWebkitBorderImage: | 2948 case CSSPropertyWebkitBorderImage: |
| 2945 return valueForNinePieceImage(style.borderImage(), style); | 2949 return valueForNinePieceImage(style.borderImage(), style); |
| 2946 case CSSPropertyBorderImageOutset: | 2950 case CSSPropertyBorderImageOutset: |
| 2947 return valueForNinePieceImageQuad(style.borderImage().outset(), style); | 2951 return valueForNinePieceImageQuad(style.borderImage().outset(), style); |
| 2948 case CSSPropertyBorderImageRepeat: | 2952 case CSSPropertyBorderImageRepeat: |
| 2949 return valueForNinePieceImageRepeat(style.borderImage()); | 2953 return valueForNinePieceImageRepeat(style.borderImage()); |
| 2950 case CSSPropertyBorderImageSlice: | 2954 case CSSPropertyBorderImageSlice: |
| 2951 return valueForNinePieceImageSlice(style.borderImage()); | 2955 return valueForNinePieceImageSlice(style.borderImage()); |
| 2952 case CSSPropertyBorderImageWidth: | 2956 case CSSPropertyBorderImageWidth: |
| 2953 return valueForNinePieceImageQuad(style.borderImage().borderSlices(), | 2957 return valueForNinePieceImageQuad(style.borderImage().borderSlices(), |
| 2954 style); | 2958 style); |
| 2955 case CSSPropertyWebkitMaskBoxImage: | 2959 case CSSPropertyWebkitMaskBoxImage: |
| 2956 return valueForNinePieceImage(style.maskBoxImage(), style); | 2960 return valueForNinePieceImage(style.maskBoxImage(), style); |
| 2957 case CSSPropertyWebkitMaskBoxImageOutset: | 2961 case CSSPropertyWebkitMaskBoxImageOutset: |
| 2958 return valueForNinePieceImageQuad(style.maskBoxImage().outset(), style); | 2962 return valueForNinePieceImageQuad(style.maskBoxImage().outset(), style); |
| 2959 case CSSPropertyWebkitMaskBoxImageRepeat: | 2963 case CSSPropertyWebkitMaskBoxImageRepeat: |
| 2960 return valueForNinePieceImageRepeat(style.maskBoxImage()); | 2964 return valueForNinePieceImageRepeat(style.maskBoxImage()); |
| 2961 case CSSPropertyWebkitMaskBoxImageSlice: | 2965 case CSSPropertyWebkitMaskBoxImageSlice: |
| 2962 return valueForNinePieceImageSlice(style.maskBoxImage()); | 2966 return valueForNinePieceImageSlice(style.maskBoxImage()); |
| 2963 case CSSPropertyWebkitMaskBoxImageWidth: | 2967 case CSSPropertyWebkitMaskBoxImageWidth: |
| 2964 return valueForNinePieceImageQuad(style.maskBoxImage().borderSlices(), | 2968 return valueForNinePieceImageQuad(style.maskBoxImage().borderSlices(), |
| 2965 style); | 2969 style); |
| 2966 case CSSPropertyWebkitMaskBoxImageSource: | 2970 case CSSPropertyWebkitMaskBoxImageSource: |
| 2967 if (style.maskBoxImageSource()) | 2971 if (style.maskBoxImageSource()) |
| 2968 return style.maskBoxImageSource()->computedCSSValue(); | 2972 return style.maskBoxImageSource()->computedCSSValue(); |
| 2969 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 2973 return CSSIdentifierValue::create(CSSValueNone); |
| 2970 case CSSPropertyWebkitFontSizeDelta: | 2974 case CSSPropertyWebkitFontSizeDelta: |
| 2971 // Not a real style property -- used by the editing engine -- so has no co
mputed value. | 2975 // Not a real style property -- used by the editing engine -- so has no co
mputed value. |
| 2972 return nullptr; | 2976 return nullptr; |
| 2973 case CSSPropertyWebkitMarginBottomCollapse: | 2977 case CSSPropertyWebkitMarginBottomCollapse: |
| 2974 case CSSPropertyWebkitMarginAfterCollapse: | 2978 case CSSPropertyWebkitMarginAfterCollapse: |
| 2975 return CSSPrimitiveValue::create(style.marginAfterCollapse()); | 2979 return CSSIdentifierValue::create(style.marginAfterCollapse()); |
| 2976 case CSSPropertyWebkitMarginTopCollapse: | 2980 case CSSPropertyWebkitMarginTopCollapse: |
| 2977 case CSSPropertyWebkitMarginBeforeCollapse: | 2981 case CSSPropertyWebkitMarginBeforeCollapse: |
| 2978 return CSSPrimitiveValue::create(style.marginBeforeCollapse()); | 2982 return CSSIdentifierValue::create(style.marginBeforeCollapse()); |
| 2979 case CSSPropertyPerspective: | 2983 case CSSPropertyPerspective: |
| 2980 if (!style.hasPerspective()) | 2984 if (!style.hasPerspective()) |
| 2981 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 2985 return CSSIdentifierValue::create(CSSValueNone); |
| 2982 return zoomAdjustedPixelValue(style.perspective(), style); | 2986 return zoomAdjustedPixelValue(style.perspective(), style); |
| 2983 case CSSPropertyPerspectiveOrigin: { | 2987 case CSSPropertyPerspectiveOrigin: { |
| 2984 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 2988 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
| 2985 if (layoutObject) { | 2989 if (layoutObject) { |
| 2986 LayoutRect box; | 2990 LayoutRect box; |
| 2987 if (layoutObject->isBox()) | 2991 if (layoutObject->isBox()) |
| 2988 box = toLayoutBox(layoutObject)->borderBoxRect(); | 2992 box = toLayoutBox(layoutObject)->borderBoxRect(); |
| 2989 | 2993 |
| 2990 list->append(*zoomAdjustedPixelValue( | 2994 list->append(*zoomAdjustedPixelValue( |
| 2991 minimumValueForLength(style.perspectiveOriginX(), box.width()), | 2995 minimumValueForLength(style.perspectiveOriginX(), box.width()), |
| 2992 style)); | 2996 style)); |
| 2993 list->append(*zoomAdjustedPixelValue( | 2997 list->append(*zoomAdjustedPixelValue( |
| 2994 minimumValueForLength(style.perspectiveOriginY(), box.height()), | 2998 minimumValueForLength(style.perspectiveOriginY(), box.height()), |
| 2995 style)); | 2999 style)); |
| 2996 } else { | 3000 } else { |
| 2997 list->append(*zoomAdjustedPixelValueForLength( | 3001 list->append(*zoomAdjustedPixelValueForLength( |
| 2998 style.perspectiveOriginX(), style)); | 3002 style.perspectiveOriginX(), style)); |
| 2999 list->append(*zoomAdjustedPixelValueForLength( | 3003 list->append(*zoomAdjustedPixelValueForLength( |
| 3000 style.perspectiveOriginY(), style)); | 3004 style.perspectiveOriginY(), style)); |
| 3001 } | 3005 } |
| 3002 return list; | 3006 return list; |
| 3003 } | 3007 } |
| 3004 case CSSPropertyWebkitRtlOrdering: | 3008 case CSSPropertyWebkitRtlOrdering: |
| 3005 return CSSPrimitiveValue::createIdentifier( | 3009 return CSSIdentifierValue::create(style.rtlOrdering() ? CSSValueVisual |
| 3006 style.rtlOrdering() ? CSSValueVisual : CSSValueLogical); | 3010 : CSSValueLogical); |
| 3007 case CSSPropertyWebkitTapHighlightColor: | 3011 case CSSPropertyWebkitTapHighlightColor: |
| 3008 return currentColorOrValidColor(style, style.tapHighlightColor()); | 3012 return currentColorOrValidColor(style, style.tapHighlightColor()); |
| 3009 case CSSPropertyWebkitUserDrag: | 3013 case CSSPropertyWebkitUserDrag: |
| 3010 return CSSPrimitiveValue::create(style.userDrag()); | 3014 return CSSIdentifierValue::create(style.userDrag()); |
| 3011 case CSSPropertyUserSelect: | 3015 case CSSPropertyUserSelect: |
| 3012 return CSSPrimitiveValue::create(style.userSelect()); | 3016 return CSSIdentifierValue::create(style.userSelect()); |
| 3013 case CSSPropertyBorderBottomLeftRadius: | 3017 case CSSPropertyBorderBottomLeftRadius: |
| 3014 return &valueForBorderRadiusCorner(style.borderBottomLeftRadius(), style); | 3018 return &valueForBorderRadiusCorner(style.borderBottomLeftRadius(), style); |
| 3015 case CSSPropertyBorderBottomRightRadius: | 3019 case CSSPropertyBorderBottomRightRadius: |
| 3016 return &valueForBorderRadiusCorner(style.borderBottomRightRadius(), | 3020 return &valueForBorderRadiusCorner(style.borderBottomRightRadius(), |
| 3017 style); | 3021 style); |
| 3018 case CSSPropertyBorderTopLeftRadius: | 3022 case CSSPropertyBorderTopLeftRadius: |
| 3019 return &valueForBorderRadiusCorner(style.borderTopLeftRadius(), style); | 3023 return &valueForBorderRadiusCorner(style.borderTopLeftRadius(), style); |
| 3020 case CSSPropertyBorderTopRightRadius: | 3024 case CSSPropertyBorderTopRightRadius: |
| 3021 return &valueForBorderRadiusCorner(style.borderTopRightRadius(), style); | 3025 return &valueForBorderRadiusCorner(style.borderTopRightRadius(), style); |
| 3022 case CSSPropertyClip: { | 3026 case CSSPropertyClip: { |
| 3023 if (style.hasAutoClip()) | 3027 if (style.hasAutoClip()) |
| 3024 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); | 3028 return CSSIdentifierValue::create(CSSValueAuto); |
| 3025 CSSPrimitiveValue* top = | 3029 CSSValue* top = zoomAdjustedPixelValueOrAuto(style.clip().top(), style); |
| 3026 style.clip().top().isAuto() | 3030 CSSValue* right = |
| 3027 ? CSSPrimitiveValue::createIdentifier(CSSValueAuto) | 3031 zoomAdjustedPixelValueOrAuto(style.clip().right(), style); |
| 3028 : zoomAdjustedPixelValue(style.clip().top().value(), style); | 3032 CSSValue* bottom = |
| 3029 CSSPrimitiveValue* right = | 3033 zoomAdjustedPixelValueOrAuto(style.clip().bottom(), style); |
| 3030 style.clip().right().isAuto() | 3034 CSSValue* left = zoomAdjustedPixelValueOrAuto(style.clip().left(), style); |
| 3031 ? CSSPrimitiveValue::createIdentifier(CSSValueAuto) | |
| 3032 : zoomAdjustedPixelValue(style.clip().right().value(), style); | |
| 3033 CSSPrimitiveValue* bottom = | |
| 3034 style.clip().bottom().isAuto() | |
| 3035 ? CSSPrimitiveValue::createIdentifier(CSSValueAuto) | |
| 3036 : zoomAdjustedPixelValue(style.clip().bottom().value(), style); | |
| 3037 CSSPrimitiveValue* left = | |
| 3038 style.clip().left().isAuto() | |
| 3039 ? CSSPrimitiveValue::createIdentifier(CSSValueAuto) | |
| 3040 : zoomAdjustedPixelValue(style.clip().left().value(), style); | |
| 3041 return CSSQuadValue::create(top, right, bottom, left, | 3035 return CSSQuadValue::create(top, right, bottom, left, |
| 3042 CSSQuadValue::SerializeAsRect); | 3036 CSSQuadValue::SerializeAsRect); |
| 3043 } | 3037 } |
| 3044 case CSSPropertySpeak: | 3038 case CSSPropertySpeak: |
| 3045 return CSSPrimitiveValue::create(style.speak()); | 3039 return CSSIdentifierValue::create(style.speak()); |
| 3046 case CSSPropertyTransform: | 3040 case CSSPropertyTransform: |
| 3047 return computedTransform(layoutObject, style); | 3041 return computedTransform(layoutObject, style); |
| 3048 case CSSPropertyTransformOrigin: { | 3042 case CSSPropertyTransformOrigin: { |
| 3049 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 3043 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
| 3050 if (layoutObject) { | 3044 if (layoutObject) { |
| 3051 LayoutRect box; | 3045 LayoutRect box; |
| 3052 if (layoutObject->isBox()) | 3046 if (layoutObject->isBox()) |
| 3053 box = toLayoutBox(layoutObject)->borderBoxRect(); | 3047 box = toLayoutBox(layoutObject)->borderBoxRect(); |
| 3054 | 3048 |
| 3055 list->append(*zoomAdjustedPixelValue( | 3049 list->append(*zoomAdjustedPixelValue( |
| (...skipping 10 matching lines...) Expand all Loading... |
| 3066 *zoomAdjustedPixelValueForLength(style.transformOriginX(), style)); | 3060 *zoomAdjustedPixelValueForLength(style.transformOriginX(), style)); |
| 3067 list->append( | 3061 list->append( |
| 3068 *zoomAdjustedPixelValueForLength(style.transformOriginY(), style)); | 3062 *zoomAdjustedPixelValueForLength(style.transformOriginY(), style)); |
| 3069 if (style.transformOriginZ() != 0) | 3063 if (style.transformOriginZ() != 0) |
| 3070 list->append( | 3064 list->append( |
| 3071 *zoomAdjustedPixelValue(style.transformOriginZ(), style)); | 3065 *zoomAdjustedPixelValue(style.transformOriginZ(), style)); |
| 3072 } | 3066 } |
| 3073 return list; | 3067 return list; |
| 3074 } | 3068 } |
| 3075 case CSSPropertyTransformStyle: | 3069 case CSSPropertyTransformStyle: |
| 3076 return CSSPrimitiveValue::createIdentifier( | 3070 return CSSIdentifierValue::create( |
| 3077 (style.transformStyle3D() == TransformStyle3DPreserve3D) | 3071 (style.transformStyle3D() == TransformStyle3DPreserve3D) |
| 3078 ? CSSValuePreserve3d | 3072 ? CSSValuePreserve3d |
| 3079 : CSSValueFlat); | 3073 : CSSValueFlat); |
| 3080 case CSSPropertyTransitionDelay: | 3074 case CSSPropertyTransitionDelay: |
| 3081 return valueForAnimationDelay(style.transitions()); | 3075 return valueForAnimationDelay(style.transitions()); |
| 3082 case CSSPropertyTransitionDuration: | 3076 case CSSPropertyTransitionDuration: |
| 3083 return valueForAnimationDuration(style.transitions()); | 3077 return valueForAnimationDuration(style.transitions()); |
| 3084 case CSSPropertyTransitionProperty: | 3078 case CSSPropertyTransitionProperty: |
| 3085 return valueForTransitionProperty(style.transitions()); | 3079 return valueForTransitionProperty(style.transitions()); |
| 3086 case CSSPropertyTransitionTimingFunction: | 3080 case CSSPropertyTransitionTimingFunction: |
| (...skipping 16 matching lines...) Expand all Loading... |
| 3103 list->append(*CSSPrimitiveValue::create( | 3097 list->append(*CSSPrimitiveValue::create( |
| 3104 CSSTimingData::getRepeated(transitionData->delayList(), i), | 3098 CSSTimingData::getRepeated(transitionData->delayList(), i), |
| 3105 CSSPrimitiveValue::UnitType::Seconds)); | 3099 CSSPrimitiveValue::UnitType::Seconds)); |
| 3106 transitionsList->append(*list); | 3100 transitionsList->append(*list); |
| 3107 } | 3101 } |
| 3108 return transitionsList; | 3102 return transitionsList; |
| 3109 } | 3103 } |
| 3110 | 3104 |
| 3111 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 3105 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
| 3112 // transition-property default value. | 3106 // transition-property default value. |
| 3113 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueAll)); | 3107 list->append(*CSSIdentifierValue::create(CSSValueAll)); |
| 3114 list->append( | 3108 list->append( |
| 3115 *CSSPrimitiveValue::create(CSSTransitionData::initialDuration(), | 3109 *CSSPrimitiveValue::create(CSSTransitionData::initialDuration(), |
| 3116 CSSPrimitiveValue::UnitType::Seconds)); | 3110 CSSPrimitiveValue::UnitType::Seconds)); |
| 3117 list->append(*createTimingFunctionValue( | 3111 list->append(*createTimingFunctionValue( |
| 3118 CSSTransitionData::initialTimingFunction().get())); | 3112 CSSTransitionData::initialTimingFunction().get())); |
| 3119 list->append( | 3113 list->append( |
| 3120 *CSSPrimitiveValue::create(CSSTransitionData::initialDelay(), | 3114 *CSSPrimitiveValue::create(CSSTransitionData::initialDelay(), |
| 3121 CSSPrimitiveValue::UnitType::Seconds)); | 3115 CSSPrimitiveValue::UnitType::Seconds)); |
| 3122 return list; | 3116 return list; |
| 3123 } | 3117 } |
| 3124 case CSSPropertyPointerEvents: | 3118 case CSSPropertyPointerEvents: |
| 3125 return CSSPrimitiveValue::create(style.pointerEvents()); | 3119 return CSSIdentifierValue::create(style.pointerEvents()); |
| 3126 case CSSPropertyWritingMode: | 3120 case CSSPropertyWritingMode: |
| 3127 case CSSPropertyWebkitWritingMode: | 3121 case CSSPropertyWebkitWritingMode: |
| 3128 return CSSPrimitiveValue::create(style.getWritingMode()); | 3122 return CSSIdentifierValue::create(style.getWritingMode()); |
| 3129 case CSSPropertyWebkitTextCombine: | 3123 case CSSPropertyWebkitTextCombine: |
| 3130 if (style.getTextCombine() == TextCombineAll) | 3124 if (style.getTextCombine() == TextCombineAll) |
| 3131 return CSSPrimitiveValue::createIdentifier(CSSValueHorizontal); | 3125 return CSSIdentifierValue::create(CSSValueHorizontal); |
| 3132 case CSSPropertyTextCombineUpright: | 3126 case CSSPropertyTextCombineUpright: |
| 3133 return CSSPrimitiveValue::create(style.getTextCombine()); | 3127 return CSSIdentifierValue::create(style.getTextCombine()); |
| 3134 case CSSPropertyWebkitTextOrientation: | 3128 case CSSPropertyWebkitTextOrientation: |
| 3135 if (style.getTextOrientation() == TextOrientationMixed) | 3129 if (style.getTextOrientation() == TextOrientationMixed) |
| 3136 return CSSPrimitiveValue::createIdentifier(CSSValueVerticalRight); | 3130 return CSSIdentifierValue::create(CSSValueVerticalRight); |
| 3137 case CSSPropertyTextOrientation: | 3131 case CSSPropertyTextOrientation: |
| 3138 return CSSPrimitiveValue::create(style.getTextOrientation()); | 3132 return CSSIdentifierValue::create(style.getTextOrientation()); |
| 3139 case CSSPropertyContent: | 3133 case CSSPropertyContent: |
| 3140 return valueForContentData(style); | 3134 return valueForContentData(style); |
| 3141 case CSSPropertyCounterIncrement: | 3135 case CSSPropertyCounterIncrement: |
| 3142 return valueForCounterDirectives(style, propertyID); | 3136 return valueForCounterDirectives(style, propertyID); |
| 3143 case CSSPropertyCounterReset: | 3137 case CSSPropertyCounterReset: |
| 3144 return valueForCounterDirectives(style, propertyID); | 3138 return valueForCounterDirectives(style, propertyID); |
| 3145 case CSSPropertyClipPath: | 3139 case CSSPropertyClipPath: |
| 3146 if (ClipPathOperation* operation = style.clipPath()) { | 3140 if (ClipPathOperation* operation = style.clipPath()) { |
| 3147 if (operation->type() == ClipPathOperation::SHAPE) | 3141 if (operation->type() == ClipPathOperation::SHAPE) |
| 3148 return valueForBasicShape( | 3142 return valueForBasicShape( |
| 3149 style, toShapeClipPathOperation(operation)->basicShape()); | 3143 style, toShapeClipPathOperation(operation)->basicShape()); |
| 3150 if (operation->type() == ClipPathOperation::REFERENCE) | 3144 if (operation->type() == ClipPathOperation::REFERENCE) |
| 3151 return CSSURIValue::create( | 3145 return CSSURIValue::create( |
| 3152 toReferenceClipPathOperation(operation)->url()); | 3146 toReferenceClipPathOperation(operation)->url()); |
| 3153 } | 3147 } |
| 3154 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 3148 return CSSIdentifierValue::create(CSSValueNone); |
| 3155 case CSSPropertyShapeMargin: | 3149 case CSSPropertyShapeMargin: |
| 3156 return CSSPrimitiveValue::create(style.shapeMargin(), | 3150 return CSSValue::create(style.shapeMargin(), style.effectiveZoom()); |
| 3157 style.effectiveZoom()); | |
| 3158 case CSSPropertyShapeImageThreshold: | 3151 case CSSPropertyShapeImageThreshold: |
| 3159 return CSSPrimitiveValue::create(style.shapeImageThreshold(), | 3152 return CSSPrimitiveValue::create(style.shapeImageThreshold(), |
| 3160 CSSPrimitiveValue::UnitType::Number); | 3153 CSSPrimitiveValue::UnitType::Number); |
| 3161 case CSSPropertyShapeOutside: | 3154 case CSSPropertyShapeOutside: |
| 3162 return valueForShape(style, style.shapeOutside()); | 3155 return valueForShape(style, style.shapeOutside()); |
| 3163 case CSSPropertyFilter: | 3156 case CSSPropertyFilter: |
| 3164 return valueForFilter(style, style.filter()); | 3157 return valueForFilter(style, style.filter()); |
| 3165 case CSSPropertyBackdropFilter: | 3158 case CSSPropertyBackdropFilter: |
| 3166 return valueForFilter(style, style.backdropFilter()); | 3159 return valueForFilter(style, style.backdropFilter()); |
| 3167 case CSSPropertyMixBlendMode: | 3160 case CSSPropertyMixBlendMode: |
| 3168 return CSSPrimitiveValue::create(style.blendMode()); | 3161 return CSSIdentifierValue::create(style.blendMode()); |
| 3169 | 3162 |
| 3170 case CSSPropertyBackgroundBlendMode: { | 3163 case CSSPropertyBackgroundBlendMode: { |
| 3171 CSSValueList* list = CSSValueList::createCommaSeparated(); | 3164 CSSValueList* list = CSSValueList::createCommaSeparated(); |
| 3172 for (const FillLayer* currLayer = &style.backgroundLayers(); currLayer; | 3165 for (const FillLayer* currLayer = &style.backgroundLayers(); currLayer; |
| 3173 currLayer = currLayer->next()) | 3166 currLayer = currLayer->next()) |
| 3174 list->append(*CSSPrimitiveValue::create(currLayer->blendMode())); | 3167 list->append(*CSSIdentifierValue::create(currLayer->blendMode())); |
| 3175 return list; | 3168 return list; |
| 3176 } | 3169 } |
| 3177 case CSSPropertyBackground: | 3170 case CSSPropertyBackground: |
| 3178 return valuesForBackgroundShorthand(style, layoutObject, styledNode, | 3171 return valuesForBackgroundShorthand(style, layoutObject, styledNode, |
| 3179 allowVisitedStyle); | 3172 allowVisitedStyle); |
| 3180 case CSSPropertyBorder: { | 3173 case CSSPropertyBorder: { |
| 3181 const CSSValue* value = get(CSSPropertyBorderTop, style, layoutObject, | 3174 const CSSValue* value = get(CSSPropertyBorderTop, style, layoutObject, |
| 3182 styledNode, allowVisitedStyle); | 3175 styledNode, allowVisitedStyle); |
| 3183 const CSSPropertyID properties[] = {CSSPropertyBorderRight, | 3176 const CSSPropertyID properties[] = {CSSPropertyBorderRight, |
| 3184 CSSPropertyBorderBottom, | 3177 CSSPropertyBorderBottom, |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3258 | 3251 |
| 3259 case CSSPropertyOffsetAnchor: | 3252 case CSSPropertyOffsetAnchor: |
| 3260 return valueForPosition(style.offsetAnchor(), style); | 3253 return valueForPosition(style.offsetAnchor(), style); |
| 3261 | 3254 |
| 3262 case CSSPropertyOffsetPosition: | 3255 case CSSPropertyOffsetPosition: |
| 3263 return valueForPosition(style.offsetPosition(), style); | 3256 return valueForPosition(style.offsetPosition(), style); |
| 3264 | 3257 |
| 3265 case CSSPropertyOffsetPath: | 3258 case CSSPropertyOffsetPath: |
| 3266 if (const StylePath* styleMotionPath = style.offsetPath()) | 3259 if (const StylePath* styleMotionPath = style.offsetPath()) |
| 3267 return styleMotionPath->computedCSSValue(); | 3260 return styleMotionPath->computedCSSValue(); |
| 3268 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 3261 return CSSIdentifierValue::create(CSSValueNone); |
| 3269 | 3262 |
| 3270 case CSSPropertyOffsetDistance: | 3263 case CSSPropertyOffsetDistance: |
| 3271 return zoomAdjustedPixelValueForLength(style.offsetDistance(), style); | 3264 return zoomAdjustedPixelValueForLength(style.offsetDistance(), style); |
| 3272 | 3265 |
| 3273 case CSSPropertyOffsetRotation: { | 3266 case CSSPropertyOffsetRotation: { |
| 3274 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 3267 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
| 3275 if (style.offsetRotation().type == OffsetRotationAuto) | 3268 if (style.offsetRotation().type == OffsetRotationAuto) |
| 3276 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueAuto)); | 3269 list->append(*CSSIdentifierValue::create(CSSValueAuto)); |
| 3277 list->append(*CSSPrimitiveValue::create( | 3270 list->append(*CSSPrimitiveValue::create( |
| 3278 style.offsetRotation().angle, CSSPrimitiveValue::UnitType::Degrees)); | 3271 style.offsetRotation().angle, CSSPrimitiveValue::UnitType::Degrees)); |
| 3279 return list; | 3272 return list; |
| 3280 } | 3273 } |
| 3281 | 3274 |
| 3282 // Unimplemented CSS 3 properties (including CSS3 shorthand properties). | 3275 // Unimplemented CSS 3 properties (including CSS3 shorthand properties). |
| 3283 case CSSPropertyWebkitTextEmphasis: | 3276 case CSSPropertyWebkitTextEmphasis: |
| 3284 return nullptr; | 3277 return nullptr; |
| 3285 | 3278 |
| 3286 // Directional properties are resolved by resolveDirectionAwareProperty() be
fore the switch. | 3279 // Directional properties are resolved by resolveDirectionAwareProperty() be
fore the switch. |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3342 | 3335 |
| 3343 // @viewport rule properties. | 3336 // @viewport rule properties. |
| 3344 case CSSPropertyMaxZoom: | 3337 case CSSPropertyMaxZoom: |
| 3345 case CSSPropertyMinZoom: | 3338 case CSSPropertyMinZoom: |
| 3346 case CSSPropertyOrientation: | 3339 case CSSPropertyOrientation: |
| 3347 case CSSPropertyUserZoom: | 3340 case CSSPropertyUserZoom: |
| 3348 return nullptr; | 3341 return nullptr; |
| 3349 | 3342 |
| 3350 // SVG properties. | 3343 // SVG properties. |
| 3351 case CSSPropertyClipRule: | 3344 case CSSPropertyClipRule: |
| 3352 return CSSPrimitiveValue::create(svgStyle.clipRule()); | 3345 return CSSIdentifierValue::create(svgStyle.clipRule()); |
| 3353 case CSSPropertyFloodOpacity: | 3346 case CSSPropertyFloodOpacity: |
| 3354 return CSSPrimitiveValue::create(svgStyle.floodOpacity(), | 3347 return CSSPrimitiveValue::create(svgStyle.floodOpacity(), |
| 3355 CSSPrimitiveValue::UnitType::Number); | 3348 CSSPrimitiveValue::UnitType::Number); |
| 3356 case CSSPropertyStopOpacity: | 3349 case CSSPropertyStopOpacity: |
| 3357 return CSSPrimitiveValue::create(svgStyle.stopOpacity(), | 3350 return CSSPrimitiveValue::create(svgStyle.stopOpacity(), |
| 3358 CSSPrimitiveValue::UnitType::Number); | 3351 CSSPrimitiveValue::UnitType::Number); |
| 3359 case CSSPropertyColorInterpolation: | 3352 case CSSPropertyColorInterpolation: |
| 3360 return CSSPrimitiveValue::create(svgStyle.colorInterpolation()); | 3353 return CSSIdentifierValue::create(svgStyle.colorInterpolation()); |
| 3361 case CSSPropertyColorInterpolationFilters: | 3354 case CSSPropertyColorInterpolationFilters: |
| 3362 return CSSPrimitiveValue::create(svgStyle.colorInterpolationFilters()); | 3355 return CSSIdentifierValue::create(svgStyle.colorInterpolationFilters()); |
| 3363 case CSSPropertyFillOpacity: | 3356 case CSSPropertyFillOpacity: |
| 3364 return CSSPrimitiveValue::create(svgStyle.fillOpacity(), | 3357 return CSSPrimitiveValue::create(svgStyle.fillOpacity(), |
| 3365 CSSPrimitiveValue::UnitType::Number); | 3358 CSSPrimitiveValue::UnitType::Number); |
| 3366 case CSSPropertyFillRule: | 3359 case CSSPropertyFillRule: |
| 3367 return CSSPrimitiveValue::create(svgStyle.fillRule()); | 3360 return CSSIdentifierValue::create(svgStyle.fillRule()); |
| 3368 case CSSPropertyColorRendering: | 3361 case CSSPropertyColorRendering: |
| 3369 return CSSPrimitiveValue::create(svgStyle.colorRendering()); | 3362 return CSSIdentifierValue::create(svgStyle.colorRendering()); |
| 3370 case CSSPropertyShapeRendering: | 3363 case CSSPropertyShapeRendering: |
| 3371 return CSSPrimitiveValue::create(svgStyle.shapeRendering()); | 3364 return CSSIdentifierValue::create(svgStyle.shapeRendering()); |
| 3372 case CSSPropertyStrokeLinecap: | 3365 case CSSPropertyStrokeLinecap: |
| 3373 return CSSPrimitiveValue::create(svgStyle.capStyle()); | 3366 return CSSIdentifierValue::create(svgStyle.capStyle()); |
| 3374 case CSSPropertyStrokeLinejoin: | 3367 case CSSPropertyStrokeLinejoin: |
| 3375 return CSSPrimitiveValue::create(svgStyle.joinStyle()); | 3368 return CSSIdentifierValue::create(svgStyle.joinStyle()); |
| 3376 case CSSPropertyStrokeMiterlimit: | 3369 case CSSPropertyStrokeMiterlimit: |
| 3377 return CSSPrimitiveValue::create(svgStyle.strokeMiterLimit(), | 3370 return CSSPrimitiveValue::create(svgStyle.strokeMiterLimit(), |
| 3378 CSSPrimitiveValue::UnitType::Number); | 3371 CSSPrimitiveValue::UnitType::Number); |
| 3379 case CSSPropertyStrokeOpacity: | 3372 case CSSPropertyStrokeOpacity: |
| 3380 return CSSPrimitiveValue::create(svgStyle.strokeOpacity(), | 3373 return CSSPrimitiveValue::create(svgStyle.strokeOpacity(), |
| 3381 CSSPrimitiveValue::UnitType::Number); | 3374 CSSPrimitiveValue::UnitType::Number); |
| 3382 case CSSPropertyAlignmentBaseline: | 3375 case CSSPropertyAlignmentBaseline: |
| 3383 return CSSPrimitiveValue::create(svgStyle.alignmentBaseline()); | 3376 return CSSIdentifierValue::create(svgStyle.alignmentBaseline()); |
| 3384 case CSSPropertyDominantBaseline: | 3377 case CSSPropertyDominantBaseline: |
| 3385 return CSSPrimitiveValue::create(svgStyle.dominantBaseline()); | 3378 return CSSIdentifierValue::create(svgStyle.dominantBaseline()); |
| 3386 case CSSPropertyTextAnchor: | 3379 case CSSPropertyTextAnchor: |
| 3387 return CSSPrimitiveValue::create(svgStyle.textAnchor()); | 3380 return CSSIdentifierValue::create(svgStyle.textAnchor()); |
| 3388 case CSSPropertyMask: | 3381 case CSSPropertyMask: |
| 3389 if (!svgStyle.maskerResource().isEmpty()) | 3382 if (!svgStyle.maskerResource().isEmpty()) |
| 3390 return CSSURIValue::create( | 3383 return CSSURIValue::create( |
| 3391 serializeAsFragmentIdentifier(svgStyle.maskerResource())); | 3384 serializeAsFragmentIdentifier(svgStyle.maskerResource())); |
| 3392 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 3385 return CSSIdentifierValue::create(CSSValueNone); |
| 3393 case CSSPropertyFloodColor: | 3386 case CSSPropertyFloodColor: |
| 3394 return currentColorOrValidColor(style, svgStyle.floodColor()); | 3387 return currentColorOrValidColor(style, svgStyle.floodColor()); |
| 3395 case CSSPropertyLightingColor: | 3388 case CSSPropertyLightingColor: |
| 3396 return currentColorOrValidColor(style, svgStyle.lightingColor()); | 3389 return currentColorOrValidColor(style, svgStyle.lightingColor()); |
| 3397 case CSSPropertyStopColor: | 3390 case CSSPropertyStopColor: |
| 3398 return currentColorOrValidColor(style, svgStyle.stopColor()); | 3391 return currentColorOrValidColor(style, svgStyle.stopColor()); |
| 3399 case CSSPropertyFill: | 3392 case CSSPropertyFill: |
| 3400 return adjustSVGPaintForCurrentColor( | 3393 return adjustSVGPaintForCurrentColor( |
| 3401 svgStyle.fillPaintType(), svgStyle.fillPaintUri(), | 3394 svgStyle.fillPaintType(), svgStyle.fillPaintUri(), |
| 3402 svgStyle.fillPaintColor(), style.color()); | 3395 svgStyle.fillPaintColor(), style.color()); |
| 3403 case CSSPropertyMarkerEnd: | 3396 case CSSPropertyMarkerEnd: |
| 3404 if (!svgStyle.markerEndResource().isEmpty()) | 3397 if (!svgStyle.markerEndResource().isEmpty()) |
| 3405 return CSSURIValue::create( | 3398 return CSSURIValue::create( |
| 3406 serializeAsFragmentIdentifier(svgStyle.markerEndResource())); | 3399 serializeAsFragmentIdentifier(svgStyle.markerEndResource())); |
| 3407 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 3400 return CSSIdentifierValue::create(CSSValueNone); |
| 3408 case CSSPropertyMarkerMid: | 3401 case CSSPropertyMarkerMid: |
| 3409 if (!svgStyle.markerMidResource().isEmpty()) | 3402 if (!svgStyle.markerMidResource().isEmpty()) |
| 3410 return CSSURIValue::create( | 3403 return CSSURIValue::create( |
| 3411 serializeAsFragmentIdentifier(svgStyle.markerMidResource())); | 3404 serializeAsFragmentIdentifier(svgStyle.markerMidResource())); |
| 3412 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 3405 return CSSIdentifierValue::create(CSSValueNone); |
| 3413 case CSSPropertyMarkerStart: | 3406 case CSSPropertyMarkerStart: |
| 3414 if (!svgStyle.markerStartResource().isEmpty()) | 3407 if (!svgStyle.markerStartResource().isEmpty()) |
| 3415 return CSSURIValue::create( | 3408 return CSSURIValue::create( |
| 3416 serializeAsFragmentIdentifier(svgStyle.markerStartResource())); | 3409 serializeAsFragmentIdentifier(svgStyle.markerStartResource())); |
| 3417 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 3410 return CSSIdentifierValue::create(CSSValueNone); |
| 3418 case CSSPropertyStroke: | 3411 case CSSPropertyStroke: |
| 3419 return adjustSVGPaintForCurrentColor( | 3412 return adjustSVGPaintForCurrentColor( |
| 3420 svgStyle.strokePaintType(), svgStyle.strokePaintUri(), | 3413 svgStyle.strokePaintType(), svgStyle.strokePaintUri(), |
| 3421 svgStyle.strokePaintColor(), style.color()); | 3414 svgStyle.strokePaintColor(), style.color()); |
| 3422 case CSSPropertyStrokeDasharray: | 3415 case CSSPropertyStrokeDasharray: |
| 3423 return strokeDashArrayToCSSValueList(*svgStyle.strokeDashArray(), style); | 3416 return strokeDashArrayToCSSValueList(*svgStyle.strokeDashArray(), style); |
| 3424 case CSSPropertyStrokeDashoffset: | 3417 case CSSPropertyStrokeDashoffset: |
| 3425 return zoomAdjustedPixelValueForLength(svgStyle.strokeDashOffset(), | 3418 return zoomAdjustedPixelValueForLength(svgStyle.strokeDashOffset(), |
| 3426 style); | 3419 style); |
| 3427 case CSSPropertyStrokeWidth: | 3420 case CSSPropertyStrokeWidth: |
| 3428 return pixelValueForUnzoomedLength(svgStyle.strokeWidth(), style); | 3421 return pixelValueForUnzoomedLength(svgStyle.strokeWidth(), style); |
| 3429 case CSSPropertyBaselineShift: { | 3422 case CSSPropertyBaselineShift: { |
| 3430 switch (svgStyle.baselineShift()) { | 3423 switch (svgStyle.baselineShift()) { |
| 3431 case BS_SUPER: | 3424 case BS_SUPER: |
| 3432 return CSSPrimitiveValue::createIdentifier(CSSValueSuper); | 3425 return CSSIdentifierValue::create(CSSValueSuper); |
| 3433 case BS_SUB: | 3426 case BS_SUB: |
| 3434 return CSSPrimitiveValue::createIdentifier(CSSValueSub); | 3427 return CSSIdentifierValue::create(CSSValueSub); |
| 3435 case BS_LENGTH: | 3428 case BS_LENGTH: |
| 3436 return zoomAdjustedPixelValueForLength(svgStyle.baselineShiftValue(), | 3429 return zoomAdjustedPixelValueForLength(svgStyle.baselineShiftValue(), |
| 3437 style); | 3430 style); |
| 3438 } | 3431 } |
| 3439 ASSERT_NOT_REACHED(); | 3432 ASSERT_NOT_REACHED(); |
| 3440 return nullptr; | 3433 return nullptr; |
| 3441 } | 3434 } |
| 3442 case CSSPropertyBufferedRendering: | 3435 case CSSPropertyBufferedRendering: |
| 3443 return CSSPrimitiveValue::create(svgStyle.bufferedRendering()); | 3436 return CSSIdentifierValue::create(svgStyle.bufferedRendering()); |
| 3444 case CSSPropertyPaintOrder: | 3437 case CSSPropertyPaintOrder: |
| 3445 return paintOrderToCSSValueList(svgStyle); | 3438 return paintOrderToCSSValueList(svgStyle); |
| 3446 case CSSPropertyVectorEffect: | 3439 case CSSPropertyVectorEffect: |
| 3447 return CSSPrimitiveValue::create(svgStyle.vectorEffect()); | 3440 return CSSIdentifierValue::create(svgStyle.vectorEffect()); |
| 3448 case CSSPropertyMaskType: | 3441 case CSSPropertyMaskType: |
| 3449 return CSSPrimitiveValue::create(svgStyle.maskType()); | 3442 return CSSIdentifierValue::create(svgStyle.maskType()); |
| 3450 case CSSPropertyMarker: | 3443 case CSSPropertyMarker: |
| 3451 // the above properties are not yet implemented in the engine | 3444 // the above properties are not yet implemented in the engine |
| 3452 return nullptr; | 3445 return nullptr; |
| 3453 case CSSPropertyD: | 3446 case CSSPropertyD: |
| 3454 if (const StylePath* stylePath = svgStyle.d()) | 3447 if (const StylePath* stylePath = svgStyle.d()) |
| 3455 return stylePath->computedCSSValue(); | 3448 return stylePath->computedCSSValue(); |
| 3456 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 3449 return CSSIdentifierValue::create(CSSValueNone); |
| 3457 case CSSPropertyCx: | 3450 case CSSPropertyCx: |
| 3458 return zoomAdjustedPixelValueForLength(svgStyle.cx(), style); | 3451 return zoomAdjustedPixelValueForLength(svgStyle.cx(), style); |
| 3459 case CSSPropertyCy: | 3452 case CSSPropertyCy: |
| 3460 return zoomAdjustedPixelValueForLength(svgStyle.cy(), style); | 3453 return zoomAdjustedPixelValueForLength(svgStyle.cy(), style); |
| 3461 case CSSPropertyX: | 3454 case CSSPropertyX: |
| 3462 return zoomAdjustedPixelValueForLength(svgStyle.x(), style); | 3455 return zoomAdjustedPixelValueForLength(svgStyle.x(), style); |
| 3463 case CSSPropertyY: | 3456 case CSSPropertyY: |
| 3464 return zoomAdjustedPixelValueForLength(svgStyle.y(), style); | 3457 return zoomAdjustedPixelValueForLength(svgStyle.y(), style); |
| 3465 case CSSPropertyR: | 3458 case CSSPropertyR: |
| 3466 return zoomAdjustedPixelValueForLength(svgStyle.r(), style); | 3459 return zoomAdjustedPixelValueForLength(svgStyle.r(), style); |
| 3467 case CSSPropertyRx: | 3460 case CSSPropertyRx: |
| 3468 return zoomAdjustedPixelValueForLength(svgStyle.rx(), style); | 3461 return zoomAdjustedPixelValueForLength(svgStyle.rx(), style); |
| 3469 case CSSPropertyRy: | 3462 case CSSPropertyRy: |
| 3470 return zoomAdjustedPixelValueForLength(svgStyle.ry(), style); | 3463 return zoomAdjustedPixelValueForLength(svgStyle.ry(), style); |
| 3471 case CSSPropertyScrollSnapType: | 3464 case CSSPropertyScrollSnapType: |
| 3472 return CSSPrimitiveValue::create(style.getScrollSnapType()); | 3465 return CSSIdentifierValue::create(style.getScrollSnapType()); |
| 3473 case CSSPropertyScrollSnapPointsX: | 3466 case CSSPropertyScrollSnapPointsX: |
| 3474 return valueForScrollSnapPoints(style.scrollSnapPointsX(), style); | 3467 return valueForScrollSnapPoints(style.scrollSnapPointsX(), style); |
| 3475 case CSSPropertyScrollSnapPointsY: | 3468 case CSSPropertyScrollSnapPointsY: |
| 3476 return valueForScrollSnapPoints(style.scrollSnapPointsY(), style); | 3469 return valueForScrollSnapPoints(style.scrollSnapPointsY(), style); |
| 3477 case CSSPropertyScrollSnapCoordinate: | 3470 case CSSPropertyScrollSnapCoordinate: |
| 3478 return valueForScrollSnapCoordinate(style.scrollSnapCoordinate(), style); | 3471 return valueForScrollSnapCoordinate(style.scrollSnapCoordinate(), style); |
| 3479 case CSSPropertyScrollSnapDestination: | 3472 case CSSPropertyScrollSnapDestination: |
| 3480 return valueForScrollSnapDestination(style.scrollSnapDestination(), | 3473 return valueForScrollSnapDestination(style.scrollSnapDestination(), |
| 3481 style); | 3474 style); |
| 3482 case CSSPropertyTranslate: { | 3475 case CSSPropertyTranslate: { |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3542 return list; | 3535 return list; |
| 3543 list->append(*CSSPrimitiveValue::create( | 3536 list->append(*CSSPrimitiveValue::create( |
| 3544 style.scale()->y(), CSSPrimitiveValue::UnitType::Number)); | 3537 style.scale()->y(), CSSPrimitiveValue::UnitType::Number)); |
| 3545 if (style.scale()->z() != 1) | 3538 if (style.scale()->z() != 1) |
| 3546 list->append(*CSSPrimitiveValue::create( | 3539 list->append(*CSSPrimitiveValue::create( |
| 3547 style.scale()->z(), CSSPrimitiveValue::UnitType::Number)); | 3540 style.scale()->z(), CSSPrimitiveValue::UnitType::Number)); |
| 3548 return list; | 3541 return list; |
| 3549 } | 3542 } |
| 3550 case CSSPropertyContain: { | 3543 case CSSPropertyContain: { |
| 3551 if (!style.contain()) | 3544 if (!style.contain()) |
| 3552 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 3545 return CSSIdentifierValue::create(CSSValueNone); |
| 3553 if (style.contain() == ContainsStrict) | 3546 if (style.contain() == ContainsStrict) |
| 3554 return CSSPrimitiveValue::createIdentifier(CSSValueStrict); | 3547 return CSSIdentifierValue::create(CSSValueStrict); |
| 3555 if (style.contain() == ContainsContent) | 3548 if (style.contain() == ContainsContent) |
| 3556 return CSSPrimitiveValue::createIdentifier(CSSValueContent); | 3549 return CSSIdentifierValue::create(CSSValueContent); |
| 3557 | 3550 |
| 3558 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 3551 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
| 3559 if (style.containsStyle()) | 3552 if (style.containsStyle()) |
| 3560 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueStyle)); | 3553 list->append(*CSSIdentifierValue::create(CSSValueStyle)); |
| 3561 if (style.contain() & ContainsLayout) | 3554 if (style.contain() & ContainsLayout) |
| 3562 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueLayout)); | 3555 list->append(*CSSIdentifierValue::create(CSSValueLayout)); |
| 3563 if (style.containsPaint()) | 3556 if (style.containsPaint()) |
| 3564 list->append(*CSSPrimitiveValue::createIdentifier(CSSValuePaint)); | 3557 list->append(*CSSIdentifierValue::create(CSSValuePaint)); |
| 3565 if (style.containsSize()) | 3558 if (style.containsSize()) |
| 3566 list->append(*CSSPrimitiveValue::createIdentifier(CSSValueSize)); | 3559 list->append(*CSSIdentifierValue::create(CSSValueSize)); |
| 3567 ASSERT(list->length()); | 3560 ASSERT(list->length()); |
| 3568 return list; | 3561 return list; |
| 3569 } | 3562 } |
| 3570 case CSSPropertySnapHeight: { | 3563 case CSSPropertySnapHeight: { |
| 3571 if (!style.snapHeightUnit()) | 3564 if (!style.snapHeightUnit()) |
| 3572 return CSSPrimitiveValue::create(0, | 3565 return CSSPrimitiveValue::create(0, |
| 3573 CSSPrimitiveValue::UnitType::Pixels); | 3566 CSSPrimitiveValue::UnitType::Pixels); |
| 3574 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 3567 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
| 3575 list->append(*CSSPrimitiveValue::create( | 3568 list->append(*CSSPrimitiveValue::create( |
| 3576 style.snapHeightUnit(), CSSPrimitiveValue::UnitType::Pixels)); | 3569 style.snapHeightUnit(), CSSPrimitiveValue::UnitType::Pixels)); |
| 3577 if (style.snapHeightPosition()) | 3570 if (style.snapHeightPosition()) |
| 3578 list->append(*CSSPrimitiveValue::create( | 3571 list->append(*CSSPrimitiveValue::create( |
| 3579 style.snapHeightPosition(), CSSPrimitiveValue::UnitType::Integer)); | 3572 style.snapHeightPosition(), CSSPrimitiveValue::UnitType::Integer)); |
| 3580 return list; | 3573 return list; |
| 3581 } | 3574 } |
| 3582 case CSSPropertyVariable: | 3575 case CSSPropertyVariable: |
| 3583 // Variables are retrieved via get(AtomicString). | 3576 // Variables are retrieved via get(AtomicString). |
| 3584 ASSERT_NOT_REACHED(); | 3577 ASSERT_NOT_REACHED(); |
| 3585 return nullptr; | 3578 return nullptr; |
| 3586 case CSSPropertyAll: | 3579 case CSSPropertyAll: |
| 3587 return nullptr; | 3580 return nullptr; |
| 3588 default: | 3581 default: |
| 3589 break; | 3582 break; |
| 3590 } | 3583 } |
| 3591 ASSERT_NOT_REACHED(); | 3584 ASSERT_NOT_REACHED(); |
| 3592 return nullptr; | 3585 return nullptr; |
| 3593 } | 3586 } |
| 3594 | 3587 |
| 3595 } // namespace blink | 3588 } // namespace blink |
| OLD | NEW |