| 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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 if (itemPosition >= ItemPositionCenter && overflowAlignment != OverflowAlign
mentDefault) | 454 if (itemPosition >= ItemPositionCenter && overflowAlignment != OverflowAlign
mentDefault) |
| 455 result->append(CSSPrimitiveValue::create(overflowAlignment)); | 455 result->append(CSSPrimitiveValue::create(overflowAlignment)); |
| 456 ASSERT(result->length() <= 2); | 456 ASSERT(result->length() <= 2); |
| 457 return result; | 457 return result; |
| 458 } | 458 } |
| 459 | 459 |
| 460 static CSSValueList* valuesForGridShorthand(const StylePropertyShorthand& shorth
and, const ComputedStyle& style, const LayoutObject* layoutObject, Node* styledN
ode, bool allowVisitedStyle) | 460 static CSSValueList* valuesForGridShorthand(const StylePropertyShorthand& shorth
and, const ComputedStyle& style, const LayoutObject* layoutObject, Node* styledN
ode, bool allowVisitedStyle) |
| 461 { | 461 { |
| 462 CSSValueList* list = CSSValueList::createSlashSeparated(); | 462 CSSValueList* list = CSSValueList::createSlashSeparated(); |
| 463 for (size_t i = 0; i < shorthand.length(); ++i) { | 463 for (size_t i = 0; i < shorthand.length(); ++i) { |
| 464 CSSValue* value = ComputedStyleCSSValueMapping::get(shorthand.properties
()[i], style, layoutObject, styledNode, allowVisitedStyle); | 464 const CSSValue* value = ComputedStyleCSSValueMapping::get(shorthand.prop
erties()[i], style, layoutObject, styledNode, allowVisitedStyle); |
| 465 ASSERT(value); | 465 ASSERT(value); |
| 466 list->append(value); | 466 list->append(value); |
| 467 } | 467 } |
| 468 return list; | 468 return list; |
| 469 } | 469 } |
| 470 | 470 |
| 471 static CSSValueList* valuesForShorthandProperty(const StylePropertyShorthand& sh
orthand, const ComputedStyle& style, const LayoutObject* layoutObject, Node* sty
ledNode, bool allowVisitedStyle) | 471 static CSSValueList* valuesForShorthandProperty(const StylePropertyShorthand& sh
orthand, const ComputedStyle& style, const LayoutObject* layoutObject, Node* sty
ledNode, bool allowVisitedStyle) |
| 472 { | 472 { |
| 473 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 473 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
| 474 for (size_t i = 0; i < shorthand.length(); ++i) { | 474 for (size_t i = 0; i < shorthand.length(); ++i) { |
| 475 CSSValue* value = ComputedStyleCSSValueMapping::get(shorthand.properties
()[i], style, layoutObject, styledNode, allowVisitedStyle); | 475 const CSSValue* value = ComputedStyleCSSValueMapping::get(shorthand.prop
erties()[i], style, layoutObject, styledNode, allowVisitedStyle); |
| 476 ASSERT(value); | 476 ASSERT(value); |
| 477 list->append(value); | 477 list->append(value); |
| 478 } | 478 } |
| 479 return list; | 479 return list; |
| 480 } | 480 } |
| 481 | 481 |
| 482 static CSSValue* expandNoneLigaturesValue() | 482 static CSSValue* expandNoneLigaturesValue() |
| 483 { | 483 { |
| 484 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 484 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
| 485 list->append(CSSPrimitiveValue::createIdentifier(CSSValueNoCommonLigatures))
; | 485 list->append(CSSPrimitiveValue::createIdentifier(CSSValueNoCommonLigatures))
; |
| 486 list->append(CSSPrimitiveValue::createIdentifier(CSSValueNoDiscretionaryLiga
tures)); | 486 list->append(CSSPrimitiveValue::createIdentifier(CSSValueNoDiscretionaryLiga
tures)); |
| 487 list->append(CSSPrimitiveValue::createIdentifier(CSSValueNoHistoricalLigatur
es)); | 487 list->append(CSSPrimitiveValue::createIdentifier(CSSValueNoHistoricalLigatur
es)); |
| 488 list->append(CSSPrimitiveValue::createIdentifier(CSSValueNoContextual)); | 488 list->append(CSSPrimitiveValue::createIdentifier(CSSValueNoContextual)); |
| 489 return list; | 489 return list; |
| 490 } | 490 } |
| 491 | 491 |
| 492 static CSSValue* valuesForFontVariantProperty(const ComputedStyle& style, const
LayoutObject* layoutObject, Node* styledNode, bool allowVisitedStyle) | 492 static CSSValue* valuesForFontVariantProperty(const ComputedStyle& style, const
LayoutObject* layoutObject, Node* styledNode, bool allowVisitedStyle) |
| 493 { | 493 { |
| 494 enum VariantShorthandCases { AllNormal, NoneLigatures, ConcatenateNonNormal
}; | 494 enum VariantShorthandCases { AllNormal, NoneLigatures, ConcatenateNonNormal
}; |
| 495 VariantShorthandCases shorthandCase = AllNormal; | 495 VariantShorthandCases shorthandCase = AllNormal; |
| 496 for (size_t i = 0; i < fontVariantShorthand().length(); ++i) { | 496 for (size_t i = 0; i < fontVariantShorthand().length(); ++i) { |
| 497 CSSValue* value = ComputedStyleCSSValueMapping::get(fontVariantShorthand
().properties()[i], style, layoutObject, styledNode, allowVisitedStyle); | 497 const CSSValue* value = ComputedStyleCSSValueMapping::get(fontVariantSho
rthand().properties()[i], style, layoutObject, styledNode, allowVisitedStyle); |
| 498 | 498 |
| 499 if (shorthandCase == AllNormal | 499 if (shorthandCase == AllNormal |
| 500 && value->isPrimitiveValue() | 500 && value->isPrimitiveValue() |
| 501 && toCSSPrimitiveValue(value)->getValueID() == CSSValueNone | 501 && toCSSPrimitiveValue(value)->getValueID() == CSSValueNone |
| 502 && fontVariantShorthand().properties()[i] == CSSPropertyFontVariantL
igatures) { | 502 && fontVariantShorthand().properties()[i] == CSSPropertyFontVariantL
igatures) { |
| 503 shorthandCase = NoneLigatures; | 503 shorthandCase = NoneLigatures; |
| 504 } else if (!(value->isPrimitiveValue() && toCSSPrimitiveValue(value)->ge
tValueID() == CSSValueNormal)) { | 504 } else if (!(value->isPrimitiveValue() && toCSSPrimitiveValue(value)->ge
tValueID() == CSSValueNormal)) { |
| 505 shorthandCase = ConcatenateNonNormal; | 505 shorthandCase = ConcatenateNonNormal; |
| 506 break; | 506 break; |
| 507 } | 507 } |
| 508 } | 508 } |
| 509 | 509 |
| 510 switch (shorthandCase) { | 510 switch (shorthandCase) { |
| 511 case AllNormal: | 511 case AllNormal: |
| 512 return CSSPrimitiveValue::createIdentifier(CSSValueNormal); | 512 return CSSPrimitiveValue::createIdentifier(CSSValueNormal); |
| 513 case NoneLigatures: | 513 case NoneLigatures: |
| 514 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 514 return CSSPrimitiveValue::createIdentifier(CSSValueNone); |
| 515 case ConcatenateNonNormal: | 515 case ConcatenateNonNormal: |
| 516 { | 516 { |
| 517 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 517 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
| 518 for (size_t i = 0; i < fontVariantShorthand().length(); ++i) { | 518 for (size_t i = 0; i < fontVariantShorthand().length(); ++i) { |
| 519 CSSValue* value = ComputedStyleCSSValueMapping::get(fontVariantShort
hand().properties()[i], style, layoutObject, styledNode, allowVisitedStyle); | 519 const CSSValue* value = ComputedStyleCSSValueMapping::get(fontVarian
tShorthand().properties()[i], style, layoutObject, styledNode, allowVisitedStyle
); |
| 520 ASSERT(value); | 520 ASSERT(value); |
| 521 if (value->isPrimitiveValue() && toCSSPrimitiveValue(value)->getValu
eID() == CSSValueNone) { | 521 if (value->isPrimitiveValue() && toCSSPrimitiveValue(value)->getValu
eID() == CSSValueNone) { |
| 522 list->append(expandNoneLigaturesValue()); | 522 list->append(expandNoneLigaturesValue()); |
| 523 } else if (!(value->isPrimitiveValue() && toCSSPrimitiveValue(value)
->getValueID() == CSSValueNormal)) { | 523 } else if (!(value->isPrimitiveValue() && toCSSPrimitiveValue(value)
->getValueID() == CSSValueNormal)) { |
| 524 list->append(value); | 524 list->append(value); |
| 525 } | 525 } |
| 526 } | 526 } |
| 527 return list; | 527 return list; |
| 528 } | 528 } |
| 529 default: | 529 default: |
| 530 NOTREACHED(); | 530 NOTREACHED(); |
| 531 return nullptr; | 531 return nullptr; |
| 532 } | 532 } |
| 533 } | 533 } |
| 534 | 534 |
| 535 static CSSValueList* valuesForBackgroundShorthand(const ComputedStyle& style, co
nst LayoutObject* layoutObject, Node* styledNode, bool allowVisitedStyle) | 535 static CSSValueList* valuesForBackgroundShorthand(const ComputedStyle& style, co
nst LayoutObject* layoutObject, Node* styledNode, bool allowVisitedStyle) |
| 536 { | 536 { |
| 537 CSSValueList* ret = CSSValueList::createCommaSeparated(); | 537 CSSValueList* ret = CSSValueList::createCommaSeparated(); |
| 538 const FillLayer* currLayer = &style.backgroundLayers(); | 538 const FillLayer* currLayer = &style.backgroundLayers(); |
| 539 for (; currLayer; currLayer = currLayer->next()) { | 539 for (; currLayer; currLayer = currLayer->next()) { |
| 540 CSSValueList* list = CSSValueList::createSlashSeparated(); | 540 CSSValueList* list = CSSValueList::createSlashSeparated(); |
| 541 CSSValueList* beforeSlash = CSSValueList::createSpaceSeparated(); | 541 CSSValueList* beforeSlash = CSSValueList::createSpaceSeparated(); |
| 542 if (!currLayer->next()) { // color only for final layer | 542 if (!currLayer->next()) { // color only for final layer |
| 543 CSSValue* value = ComputedStyleCSSValueMapping::get(CSSPropertyBackg
roundColor, style, layoutObject, styledNode, allowVisitedStyle); | 543 const CSSValue* value = ComputedStyleCSSValueMapping::get(CSSPropert
yBackgroundColor, style, layoutObject, styledNode, allowVisitedStyle); |
| 544 ASSERT(value); | 544 ASSERT(value); |
| 545 beforeSlash->append(value); | 545 beforeSlash->append(value); |
| 546 } | 546 } |
| 547 beforeSlash->append(currLayer->image() ? currLayer->image()->computedCSS
Value() : CSSPrimitiveValue::createIdentifier(CSSValueNone)); | 547 beforeSlash->append(currLayer->image() ? currLayer->image()->computedCSS
Value() : CSSPrimitiveValue::createIdentifier(CSSValueNone)); |
| 548 beforeSlash->append(valueForFillRepeat(currLayer->repeatX(), currLayer->
repeatY())); | 548 beforeSlash->append(valueForFillRepeat(currLayer->repeatX(), currLayer->
repeatY())); |
| 549 beforeSlash->append(CSSPrimitiveValue::create(currLayer->attachment())); | 549 beforeSlash->append(CSSPrimitiveValue::create(currLayer->attachment())); |
| 550 beforeSlash->append(createPositionListForLayer(CSSPropertyBackgroundPosi
tion, *currLayer, style)); | 550 beforeSlash->append(createPositionListForLayer(CSSPropertyBackgroundPosi
tion, *currLayer, style)); |
| 551 list->append(beforeSlash); | 551 list->append(beforeSlash); |
| 552 CSSValueList* afterSlash = CSSValueList::createSpaceSeparated(); | 552 CSSValueList* afterSlash = CSSValueList::createSpaceSeparated(); |
| 553 afterSlash->append(valueForFillSize(currLayer->size(), style)); | 553 afterSlash->append(valueForFillSize(currLayer->size(), style)); |
| (...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1111 list->append(CSSPrimitiveValue::create(radius.width().percent(), CSSPrim
itiveValue::UnitType::Percentage)); | 1111 list->append(CSSPrimitiveValue::create(radius.width().percent(), CSSPrim
itiveValue::UnitType::Percentage)); |
| 1112 else | 1112 else |
| 1113 list->append(zoomAdjustedPixelValueForLength(radius.width(), style)); | 1113 list->append(zoomAdjustedPixelValueForLength(radius.width(), style)); |
| 1114 if (radius.height().type() == Percent) | 1114 if (radius.height().type() == Percent) |
| 1115 list->append(CSSPrimitiveValue::create(radius.height().percent(), CSSPri
mitiveValue::UnitType::Percentage)); | 1115 list->append(CSSPrimitiveValue::create(radius.height().percent(), CSSPri
mitiveValue::UnitType::Percentage)); |
| 1116 else | 1116 else |
| 1117 list->append(zoomAdjustedPixelValueForLength(radius.height(), style)); | 1117 list->append(zoomAdjustedPixelValueForLength(radius.height(), style)); |
| 1118 return list; | 1118 return list; |
| 1119 } | 1119 } |
| 1120 | 1120 |
| 1121 static CSSValue* valueForBorderRadiusCorner(LengthSize radius, const ComputedSty
le& style) | 1121 static const CSSValue* valueForBorderRadiusCorner(LengthSize radius, const Compu
tedStyle& style) |
| 1122 { | 1122 { |
| 1123 CSSValueList* list = valuesForBorderRadiusCorner(radius, style); | 1123 CSSValueList* list = valuesForBorderRadiusCorner(radius, style); |
| 1124 if (list->item(0)->equals(*list->item(1))) | 1124 if (list->item(0)->equals(*list->item(1))) |
| 1125 return list->item(0); | 1125 return list->item(0); |
| 1126 return list; | 1126 return list; |
| 1127 } | 1127 } |
| 1128 | 1128 |
| 1129 static CSSFunctionValue* valueForMatrixTransform(const TransformationMatrix& tra
nsform, const ComputedStyle& style) | 1129 static CSSFunctionValue* valueForMatrixTransform(const TransformationMatrix& tra
nsform, const ComputedStyle& style) |
| 1130 { | 1130 { |
| 1131 CSSFunctionValue* transformValue = nullptr; | 1131 CSSFunctionValue* transformValue = nullptr; |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1293 list->append(valueForBasicShape(style, shapeValue->shape())); | 1293 list->append(valueForBasicShape(style, shapeValue->shape())); |
| 1294 if (shapeValue->cssBox() != BoxMissing) | 1294 if (shapeValue->cssBox() != BoxMissing) |
| 1295 list->append(CSSPrimitiveValue::create(shapeValue->cssBox())); | 1295 list->append(CSSPrimitiveValue::create(shapeValue->cssBox())); |
| 1296 return list; | 1296 return list; |
| 1297 } | 1297 } |
| 1298 | 1298 |
| 1299 static CSSValueList* valuesForSidesShorthand(const StylePropertyShorthand& short
hand, const ComputedStyle& style, const LayoutObject* layoutObject, Node* styled
Node, bool allowVisitedStyle) | 1299 static CSSValueList* valuesForSidesShorthand(const StylePropertyShorthand& short
hand, const ComputedStyle& style, const LayoutObject* layoutObject, Node* styled
Node, bool allowVisitedStyle) |
| 1300 { | 1300 { |
| 1301 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 1301 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
| 1302 // Assume the properties are in the usual order top, right, bottom, left. | 1302 // Assume the properties are in the usual order top, right, bottom, left. |
| 1303 CSSValue* topValue = ComputedStyleCSSValueMapping::get(shorthand.properties(
)[0], style, layoutObject, styledNode, allowVisitedStyle); | 1303 const CSSValue* topValue = ComputedStyleCSSValueMapping::get(shorthand.prope
rties()[0], style, layoutObject, styledNode, allowVisitedStyle); |
| 1304 CSSValue* rightValue = ComputedStyleCSSValueMapping::get(shorthand.propertie
s()[1], style, layoutObject, styledNode, allowVisitedStyle); | 1304 const CSSValue* rightValue = ComputedStyleCSSValueMapping::get(shorthand.pro
perties()[1], style, layoutObject, styledNode, allowVisitedStyle); |
| 1305 CSSValue* bottomValue = ComputedStyleCSSValueMapping::get(shorthand.properti
es()[2], style, layoutObject, styledNode, allowVisitedStyle); | 1305 const CSSValue* bottomValue = ComputedStyleCSSValueMapping::get(shorthand.pr
operties()[2], style, layoutObject, styledNode, allowVisitedStyle); |
| 1306 CSSValue* leftValue = ComputedStyleCSSValueMapping::get(shorthand.properties
()[3], style, layoutObject, styledNode, allowVisitedStyle); | 1306 const CSSValue* leftValue = ComputedStyleCSSValueMapping::get(shorthand.prop
erties()[3], style, layoutObject, styledNode, allowVisitedStyle); |
| 1307 | 1307 |
| 1308 // All 4 properties must be specified. | 1308 // All 4 properties must be specified. |
| 1309 if (!topValue || !rightValue || !bottomValue || !leftValue) | 1309 if (!topValue || !rightValue || !bottomValue || !leftValue) |
| 1310 return nullptr; | 1310 return nullptr; |
| 1311 | 1311 |
| 1312 bool showLeft = !compareCSSValuePtr(rightValue, leftValue); | 1312 bool showLeft = !compareCSSValuePtr(rightValue, leftValue); |
| 1313 bool showBottom = !compareCSSValuePtr(topValue, bottomValue) || showLeft; | 1313 bool showBottom = !compareCSSValuePtr(topValue, bottomValue) || showLeft; |
| 1314 bool showRight = !compareCSSValuePtr(topValue, rightValue) || showBottom; | 1314 bool showRight = !compareCSSValuePtr(topValue, rightValue) || showBottom; |
| 1315 | 1315 |
| 1316 list->append(topValue); | 1316 list->append(topValue); |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1615 return BreakAuto; | 1615 return BreakAuto; |
| 1616 case BreakColumn: | 1616 case BreakColumn: |
| 1617 return BreakAlways; | 1617 return BreakAlways; |
| 1618 case BreakAvoidColumn: | 1618 case BreakAvoidColumn: |
| 1619 return BreakAvoid; | 1619 return BreakAvoid; |
| 1620 default: | 1620 default: |
| 1621 return genericBreakValue; | 1621 return genericBreakValue; |
| 1622 } | 1622 } |
| 1623 } | 1623 } |
| 1624 | 1624 |
| 1625 CSSValue* ComputedStyleCSSValueMapping::get(const AtomicString customPropertyNam
e, const ComputedStyle& style) | 1625 const CSSValue* ComputedStyleCSSValueMapping::get(const AtomicString customPrope
rtyName, const ComputedStyle& style) |
| 1626 { | 1626 { |
| 1627 StyleVariableData* variables = style.variables(); | 1627 StyleVariableData* variables = style.variables(); |
| 1628 if (!variables) | 1628 if (!variables) |
| 1629 return nullptr; | 1629 return nullptr; |
| 1630 | 1630 |
| 1631 CSSVariableData* data = variables->getVariable(customPropertyName); | 1631 CSSVariableData* data = variables->getVariable(customPropertyName); |
| 1632 if (!data) | 1632 if (!data) |
| 1633 return nullptr; | 1633 return nullptr; |
| 1634 | 1634 |
| 1635 return CSSCustomPropertyDeclaration::create(customPropertyName, data); | 1635 return CSSCustomPropertyDeclaration::create(customPropertyName, data); |
| 1636 } | 1636 } |
| 1637 | 1637 |
| 1638 std::unique_ptr<HashMap<AtomicString, RefPtr<CSSVariableData>>> ComputedStyleCSS
ValueMapping::getVariables(const ComputedStyle& style) | 1638 std::unique_ptr<HashMap<AtomicString, RefPtr<CSSVariableData>>> ComputedStyleCSS
ValueMapping::getVariables(const ComputedStyle& style) |
| 1639 { | 1639 { |
| 1640 StyleVariableData* variables = style.variables(); | 1640 StyleVariableData* variables = style.variables(); |
| 1641 if (variables) | 1641 if (variables) |
| 1642 return variables->getVariables(); | 1642 return variables->getVariables(); |
| 1643 return nullptr; | 1643 return nullptr; |
| 1644 } | 1644 } |
| 1645 | 1645 |
| 1646 CSSValue* ComputedStyleCSSValueMapping::get(CSSPropertyID propertyID, const Comp
utedStyle& style, const LayoutObject* layoutObject, Node* styledNode, bool allow
VisitedStyle) | 1646 const CSSValue* ComputedStyleCSSValueMapping::get(CSSPropertyID propertyID, cons
t ComputedStyle& style, const LayoutObject* layoutObject, Node* styledNode, bool
allowVisitedStyle) |
| 1647 { | 1647 { |
| 1648 const SVGComputedStyle& svgStyle = style.svgStyle(); | 1648 const SVGComputedStyle& svgStyle = style.svgStyle(); |
| 1649 propertyID = CSSProperty::resolveDirectionAwareProperty(propertyID, style.di
rection(), style.getWritingMode()); | 1649 propertyID = CSSProperty::resolveDirectionAwareProperty(propertyID, style.di
rection(), style.getWritingMode()); |
| 1650 switch (propertyID) { | 1650 switch (propertyID) { |
| 1651 case CSSPropertyInvalid: | 1651 case CSSPropertyInvalid: |
| 1652 return nullptr; | 1652 return nullptr; |
| 1653 | 1653 |
| 1654 case CSSPropertyBackgroundColor: | 1654 case CSSPropertyBackgroundColor: |
| 1655 return allowVisitedStyle ? CSSColorValue::create(style.visitedDependentC
olor(CSSPropertyBackgroundColor).rgb()) : currentColorOrValidColor(style, style.
backgroundColor()); | 1655 return allowVisitedStyle ? CSSColorValue::create(style.visitedDependentC
olor(CSSPropertyBackgroundColor).rgb()) : currentColorOrValidColor(style, style.
backgroundColor()); |
| 1656 case CSSPropertyBackgroundImage: | 1656 case CSSPropertyBackgroundImage: |
| (...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2652 | 2652 |
| 2653 case CSSPropertyBackgroundBlendMode: { | 2653 case CSSPropertyBackgroundBlendMode: { |
| 2654 CSSValueList* list = CSSValueList::createCommaSeparated(); | 2654 CSSValueList* list = CSSValueList::createCommaSeparated(); |
| 2655 for (const FillLayer* currLayer = &style.backgroundLayers(); currLayer;
currLayer = currLayer->next()) | 2655 for (const FillLayer* currLayer = &style.backgroundLayers(); currLayer;
currLayer = currLayer->next()) |
| 2656 list->append(CSSPrimitiveValue::create(currLayer->blendMode())); | 2656 list->append(CSSPrimitiveValue::create(currLayer->blendMode())); |
| 2657 return list; | 2657 return list; |
| 2658 } | 2658 } |
| 2659 case CSSPropertyBackground: | 2659 case CSSPropertyBackground: |
| 2660 return valuesForBackgroundShorthand(style, layoutObject, styledNode, all
owVisitedStyle); | 2660 return valuesForBackgroundShorthand(style, layoutObject, styledNode, all
owVisitedStyle); |
| 2661 case CSSPropertyBorder: { | 2661 case CSSPropertyBorder: { |
| 2662 CSSValue* value = get(CSSPropertyBorderTop, style, layoutObject, styledN
ode, allowVisitedStyle); | 2662 const CSSValue* value = get(CSSPropertyBorderTop, style, layoutObject, s
tyledNode, allowVisitedStyle); |
| 2663 const CSSPropertyID properties[] = { | 2663 const CSSPropertyID properties[] = { |
| 2664 CSSPropertyBorderRight, | 2664 CSSPropertyBorderRight, |
| 2665 CSSPropertyBorderBottom, | 2665 CSSPropertyBorderBottom, |
| 2666 CSSPropertyBorderLeft | 2666 CSSPropertyBorderLeft |
| 2667 }; | 2667 }; |
| 2668 for (size_t i = 0; i < WTF_ARRAY_LENGTH(properties); ++i) { | 2668 for (size_t i = 0; i < WTF_ARRAY_LENGTH(properties); ++i) { |
| 2669 if (!compareCSSValuePtr<CSSValue>(value, get(properties[i], style, l
ayoutObject, styledNode, allowVisitedStyle))) | 2669 if (!compareCSSValuePtr<CSSValue>(value, get(properties[i], style, l
ayoutObject, styledNode, allowVisitedStyle))) |
| 2670 return nullptr; | 2670 return nullptr; |
| 2671 } | 2671 } |
| 2672 return value; | 2672 return value; |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3003 case CSSPropertyAll: | 3003 case CSSPropertyAll: |
| 3004 return nullptr; | 3004 return nullptr; |
| 3005 default: | 3005 default: |
| 3006 break; | 3006 break; |
| 3007 } | 3007 } |
| 3008 ASSERT_NOT_REACHED(); | 3008 ASSERT_NOT_REACHED(); |
| 3009 return nullptr; | 3009 return nullptr; |
| 3010 } | 3010 } |
| 3011 | 3011 |
| 3012 } // namespace blink | 3012 } // namespace blink |
| OLD | NEW |