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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 if (itemPosition >= ItemPositionCenter && overflowAlignment != OverflowAlign
mentDefault) | 398 if (itemPosition >= ItemPositionCenter && overflowAlignment != OverflowAlign
mentDefault) |
399 result->append(CSSPrimitiveValue::create(overflowAlignment)); | 399 result->append(CSSPrimitiveValue::create(overflowAlignment)); |
400 ASSERT(result->length() <= 2); | 400 ASSERT(result->length() <= 2); |
401 return result.release(); | 401 return result.release(); |
402 } | 402 } |
403 | 403 |
404 static PassRefPtrWillBeRawPtr<CSSValueList> valuesForGridShorthand(const StylePr
opertyShorthand& shorthand, const ComputedStyle& style, const LayoutObject* layo
utObject, Node* styledNode, bool allowVisitedStyle) | 404 static PassRefPtrWillBeRawPtr<CSSValueList> valuesForGridShorthand(const StylePr
opertyShorthand& shorthand, const ComputedStyle& style, const LayoutObject* layo
utObject, Node* styledNode, bool allowVisitedStyle) |
405 { | 405 { |
406 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSlashSeparated()
; | 406 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSlashSeparated()
; |
407 for (size_t i = 0; i < shorthand.length(); ++i) { | 407 for (size_t i = 0; i < shorthand.length(); ++i) { |
408 RefPtrWillBeRawPtr<CSSValue> value = ComputedStyleCSSValueMapping::get(s
horthand.properties()[i], style, layoutObject, styledNode, allowVisitedStyle); | 408 RefPtrWillBeRawPtr<CSSValue> value = ComputedStyleCSSValueMapping::get(s
horthand.properties()[i], style, layoutObject, styledNode, ComputedStyleCSSValue
Mapping::DoingShorthand, allowVisitedStyle); |
409 ASSERT(value); | 409 ASSERT(value); |
410 list->append(value.release()); | 410 list->append(value.release()); |
411 } | 411 } |
412 return list.release(); | 412 return list.release(); |
413 } | 413 } |
414 | 414 |
415 static PassRefPtrWillBeRawPtr<CSSValueList> valuesForShorthandProperty(const Sty
lePropertyShorthand& shorthand, const ComputedStyle& style, const LayoutObject*
layoutObject, Node* styledNode, bool allowVisitedStyle) | 415 static PassRefPtrWillBeRawPtr<CSSValueList> valuesForShorthandProperty(const Sty
lePropertyShorthand& shorthand, const ComputedStyle& style, const LayoutObject*
layoutObject, Node* styledNode, bool allowVisitedStyle) |
416 { | 416 { |
417 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 417 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; |
418 for (size_t i = 0; i < shorthand.length(); ++i) { | 418 for (size_t i = 0; i < shorthand.length(); ++i) { |
419 RefPtrWillBeRawPtr<CSSValue> value = ComputedStyleCSSValueMapping::get(s
horthand.properties()[i], style, layoutObject, styledNode, allowVisitedStyle); | 419 RefPtrWillBeRawPtr<CSSValue> value = ComputedStyleCSSValueMapping::get(s
horthand.properties()[i], style, layoutObject, styledNode, ComputedStyleCSSValue
Mapping::DoingShorthand, allowVisitedStyle); |
420 ASSERT(value); | 420 ASSERT(value); |
421 list->append(value); | 421 list->append(value); |
422 } | 422 } |
423 return list.release(); | 423 return list.release(); |
424 } | 424 } |
425 | 425 |
426 static PassRefPtrWillBeRawPtr<CSSValueList> valuesForBackgroundShorthand(const C
omputedStyle& style, const LayoutObject* layoutObject, Node* styledNode, bool al
lowVisitedStyle) | 426 static PassRefPtrWillBeRawPtr<CSSValueList> valuesForBackgroundShorthand(const C
omputedStyle& style, const LayoutObject* layoutObject, Node* styledNode, bool al
lowVisitedStyle) |
427 { | 427 { |
428 RefPtrWillBeRawPtr<CSSValueList> ret = CSSValueList::createCommaSeparated(); | 428 RefPtrWillBeRawPtr<CSSValueList> ret = CSSValueList::createCommaSeparated(); |
429 const FillLayer* currLayer = &style.backgroundLayers(); | 429 const FillLayer* currLayer = &style.backgroundLayers(); |
430 for (; currLayer; currLayer = currLayer->next()) { | 430 for (; currLayer; currLayer = currLayer->next()) { |
431 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSlashSeparat
ed(); | 431 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSlashSeparat
ed(); |
432 RefPtrWillBeRawPtr<CSSValueList> beforeSlash = CSSValueList::createSpace
Separated(); | 432 RefPtrWillBeRawPtr<CSSValueList> beforeSlash = CSSValueList::createSpace
Separated(); |
433 if (!currLayer->next()) { // color only for final layer | 433 if (!currLayer->next()) { // color only for final layer |
434 RefPtrWillBeRawPtr<CSSValue> value = ComputedStyleCSSValueMapping::g
et(CSSPropertyBackgroundColor, style, layoutObject, styledNode, allowVisitedStyl
e); | 434 RefPtrWillBeRawPtr<CSSValue> value = ComputedStyleCSSValueMapping::g
et(CSSPropertyBackgroundColor, style, layoutObject, styledNode, ComputedStyleCSS
ValueMapping::DoingShorthand, allowVisitedStyle); |
435 ASSERT(value); | 435 ASSERT(value); |
436 beforeSlash->append(value); | 436 beforeSlash->append(value); |
437 } | 437 } |
438 beforeSlash->append(currLayer->image() ? currLayer->image()->cssValue()
: cssValuePool().createIdentifierValue(CSSValueNone)); | 438 beforeSlash->append(currLayer->image() ? currLayer->image()->cssValue()
: cssValuePool().createIdentifierValue(CSSValueNone)); |
439 beforeSlash->append(valueForFillRepeat(currLayer->repeatX(), currLayer->
repeatY())); | 439 beforeSlash->append(valueForFillRepeat(currLayer->repeatX(), currLayer->
repeatY())); |
440 beforeSlash->append(cssValuePool().createValue(currLayer->attachment()))
; | 440 beforeSlash->append(cssValuePool().createValue(currLayer->attachment()))
; |
441 beforeSlash->append(createPositionListForLayer(CSSPropertyBackgroundPosi
tion, *currLayer, style)); | 441 beforeSlash->append(createPositionListForLayer(CSSPropertyBackgroundPosi
tion, *currLayer, style)); |
442 list->append(beforeSlash); | 442 list->append(beforeSlash); |
443 RefPtrWillBeRawPtr<CSSValueList> afterSlash = CSSValueList::createSpaceS
eparated(); | 443 RefPtrWillBeRawPtr<CSSValueList> afterSlash = CSSValueList::createSpaceS
eparated(); |
444 afterSlash->append(valueForFillSize(currLayer->size(), style)); | 444 afterSlash->append(valueForFillSize(currLayer->size(), style)); |
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1076 list->append(valueForBasicShape(style, shapeValue->shape())); | 1076 list->append(valueForBasicShape(style, shapeValue->shape())); |
1077 if (shapeValue->cssBox() != BoxMissing) | 1077 if (shapeValue->cssBox() != BoxMissing) |
1078 list->append(cssValuePool().createValue(shapeValue->cssBox())); | 1078 list->append(cssValuePool().createValue(shapeValue->cssBox())); |
1079 return list.release(); | 1079 return list.release(); |
1080 } | 1080 } |
1081 | 1081 |
1082 static PassRefPtrWillBeRawPtr<CSSValueList> valuesForSidesShorthand(const StyleP
ropertyShorthand& shorthand, const ComputedStyle& style, const LayoutObject* lay
outObject, Node* styledNode, bool allowVisitedStyle) | 1082 static PassRefPtrWillBeRawPtr<CSSValueList> valuesForSidesShorthand(const StyleP
ropertyShorthand& shorthand, const ComputedStyle& style, const LayoutObject* lay
outObject, Node* styledNode, bool allowVisitedStyle) |
1083 { | 1083 { |
1084 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 1084 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; |
1085 // Assume the properties are in the usual order top, right, bottom, left. | 1085 // Assume the properties are in the usual order top, right, bottom, left. |
1086 RefPtrWillBeRawPtr<CSSValue> topValue = ComputedStyleCSSValueMapping::get(sh
orthand.properties()[0], style, layoutObject, styledNode, allowVisitedStyle); | 1086 RefPtrWillBeRawPtr<CSSValue> topValue = ComputedStyleCSSValueMapping::get(sh
orthand.properties()[0], style, layoutObject, styledNode, ComputedStyleCSSValueM
apping::DoingShorthand, allowVisitedStyle); |
1087 RefPtrWillBeRawPtr<CSSValue> rightValue = ComputedStyleCSSValueMapping::get(
shorthand.properties()[1], style, layoutObject, styledNode, allowVisitedStyle); | 1087 RefPtrWillBeRawPtr<CSSValue> rightValue = ComputedStyleCSSValueMapping::get(
shorthand.properties()[1], style, layoutObject, styledNode, ComputedStyleCSSValu
eMapping::DoingShorthand, allowVisitedStyle); |
1088 RefPtrWillBeRawPtr<CSSValue> bottomValue = ComputedStyleCSSValueMapping::get
(shorthand.properties()[2], style, layoutObject, styledNode, allowVisitedStyle); | 1088 RefPtrWillBeRawPtr<CSSValue> bottomValue = ComputedStyleCSSValueMapping::get
(shorthand.properties()[2], style, layoutObject, styledNode, ComputedStyleCSSVal
ueMapping::DoingShorthand, allowVisitedStyle); |
1089 RefPtrWillBeRawPtr<CSSValue> leftValue = ComputedStyleCSSValueMapping::get(s
horthand.properties()[3], style, layoutObject, styledNode, allowVisitedStyle); | 1089 RefPtrWillBeRawPtr<CSSValue> leftValue = ComputedStyleCSSValueMapping::get(s
horthand.properties()[3], style, layoutObject, styledNode, ComputedStyleCSSValue
Mapping::DoingShorthand, allowVisitedStyle); |
1090 | 1090 |
1091 // All 4 properties must be specified. | 1091 // All 4 properties must be specified. |
1092 if (!topValue || !rightValue || !bottomValue || !leftValue) | 1092 if (!topValue || !rightValue || !bottomValue || !leftValue) |
1093 return nullptr; | 1093 return nullptr; |
1094 | 1094 |
1095 bool showLeft = !compareCSSValuePtr(rightValue, leftValue); | 1095 bool showLeft = !compareCSSValuePtr(rightValue, leftValue); |
1096 bool showBottom = !compareCSSValuePtr(topValue, bottomValue) || showLeft; | 1096 bool showBottom = !compareCSSValuePtr(topValue, bottomValue) || showLeft; |
1097 bool showRight = !compareCSSValuePtr(topValue, rightValue) || showBottom; | 1097 bool showRight = !compareCSSValuePtr(topValue, rightValue) || showBottom; |
1098 | 1098 |
1099 list->append(topValue.release()); | 1099 list->append(topValue.release()); |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1311 default: | 1311 default: |
1312 ASSERT_NOT_REACHED(); | 1312 ASSERT_NOT_REACHED(); |
1313 break; | 1313 break; |
1314 } | 1314 } |
1315 list->append(filterValue.release()); | 1315 list->append(filterValue.release()); |
1316 } | 1316 } |
1317 | 1317 |
1318 return list.release(); | 1318 return list.release(); |
1319 } | 1319 } |
1320 | 1320 |
1321 PassRefPtrWillBeRawPtr<CSSValue> ComputedStyleCSSValueMapping::get(CSSPropertyID
propertyID, const ComputedStyle& style, const LayoutObject* layoutObject, Node*
styledNode, bool allowVisitedStyle) | 1321 PassRefPtrWillBeRawPtr<CSSValue> ComputedStyleCSSValueMapping::get(CSSPropertyID
unresolvedProperty, const ComputedStyle& style, const LayoutObject* layoutObjec
t, Node* styledNode, ShorthandState shorthandState, bool allowVisitedStyle) |
1322 { | 1322 { |
1323 const SVGComputedStyle& svgStyle = style.svgStyle(); | 1323 const SVGComputedStyle& svgStyle = style.svgStyle(); |
| 1324 CSSPropertyID propertyID = resolveCSSPropertyID(unresolvedProperty); |
1324 propertyID = CSSProperty::resolveDirectionAwareProperty(propertyID, style.di
rection(), style.writingMode()); | 1325 propertyID = CSSProperty::resolveDirectionAwareProperty(propertyID, style.di
rection(), style.writingMode()); |
1325 switch (propertyID) { | 1326 switch (propertyID) { |
1326 case CSSPropertyInvalid: | 1327 case CSSPropertyInvalid: |
1327 return nullptr; | 1328 return nullptr; |
1328 | 1329 |
1329 case CSSPropertyBackgroundColor: | 1330 case CSSPropertyBackgroundColor: |
1330 return allowVisitedStyle ? cssValuePool().createColorValue(style.visited
DependentColor(CSSPropertyBackgroundColor).rgb()) : currentColorOrValidColor(sty
le, style.backgroundColor()); | 1331 return allowVisitedStyle ? cssValuePool().createColorValue(style.visited
DependentColor(CSSPropertyBackgroundColor).rgb()) : currentColorOrValidColor(sty
le, style.backgroundColor()); |
1331 case CSSPropertyBackgroundImage: | 1332 case CSSPropertyBackgroundImage: |
1332 case CSSPropertyWebkitMaskImage: { | 1333 case CSSPropertyWebkitMaskImage: { |
1333 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparat
ed(); | 1334 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparat
ed(); |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1484 case CSSPropertyBoxShadow: | 1485 case CSSPropertyBoxShadow: |
1485 return valueForShadowList(style.boxShadow(), style, true); | 1486 return valueForShadowList(style.boxShadow(), style, true); |
1486 case CSSPropertyCaptionSide: | 1487 case CSSPropertyCaptionSide: |
1487 return cssValuePool().createValue(style.captionSide()); | 1488 return cssValuePool().createValue(style.captionSide()); |
1488 case CSSPropertyClear: | 1489 case CSSPropertyClear: |
1489 return cssValuePool().createValue(style.clear()); | 1490 return cssValuePool().createValue(style.clear()); |
1490 case CSSPropertyColor: | 1491 case CSSPropertyColor: |
1491 return cssValuePool().createColorValue(allowVisitedStyle ? style.visited
DependentColor(CSSPropertyColor).rgb() : style.color().rgb()); | 1492 return cssValuePool().createColorValue(allowVisitedStyle ? style.visited
DependentColor(CSSPropertyColor).rgb() : style.color().rgb()); |
1492 case CSSPropertyWebkitPrintColorAdjust: | 1493 case CSSPropertyWebkitPrintColorAdjust: |
1493 return cssValuePool().createValue(style.printColorAdjust()); | 1494 return cssValuePool().createValue(style.printColorAdjust()); |
1494 case CSSPropertyWebkitColumnCount: | 1495 case CSSPropertyColumnCount: |
| 1496 if (unresolvedProperty != CSSPropertyAliasWebkitColumnCount && shorthand
State != DoingShorthand && !RuntimeEnabledFeatures::unprefixMulticolEnabled()) |
| 1497 return nullptr; |
1495 if (style.hasAutoColumnCount()) | 1498 if (style.hasAutoColumnCount()) |
1496 return cssValuePool().createIdentifierValue(CSSValueAuto); | 1499 return cssValuePool().createIdentifierValue(CSSValueAuto); |
1497 return cssValuePool().createValue(style.columnCount(), CSSPrimitiveValue
::CSS_NUMBER); | 1500 return cssValuePool().createValue(style.columnCount(), CSSPrimitiveValue
::CSS_NUMBER); |
1498 case CSSPropertyColumnFill: | 1501 case CSSPropertyColumnFill: |
1499 ASSERT(RuntimeEnabledFeatures::regionBasedColumnsEnabled()); | 1502 ASSERT(RuntimeEnabledFeatures::unprefixMulticolEnabled()); |
1500 return cssValuePool().createValue(style.columnFill()); | 1503 return cssValuePool().createValue(style.columnFill()); |
1501 case CSSPropertyWebkitColumnGap: | 1504 case CSSPropertyColumnGap: |
| 1505 if (unresolvedProperty != CSSPropertyAliasWebkitColumnGap && !RuntimeEna
bledFeatures::unprefixMulticolEnabled()) |
| 1506 return nullptr; |
1502 if (style.hasNormalColumnGap()) | 1507 if (style.hasNormalColumnGap()) |
1503 return cssValuePool().createIdentifierValue(CSSValueNormal); | 1508 return cssValuePool().createIdentifierValue(CSSValueNormal); |
1504 return zoomAdjustedPixelValue(style.columnGap(), style); | 1509 return zoomAdjustedPixelValue(style.columnGap(), style); |
1505 case CSSPropertyWebkitColumnRuleColor: | 1510 case CSSPropertyColumnRuleColor: |
| 1511 if (unresolvedProperty != CSSPropertyAliasWebkitColumnRuleColor && short
handState != DoingShorthand && !RuntimeEnabledFeatures::unprefixMulticolEnabled(
)) |
| 1512 return nullptr; |
1506 return allowVisitedStyle ? cssValuePool().createColorValue(style.visited
DependentColor(CSSPropertyOutlineColor).rgb()) : currentColorOrValidColor(style,
style.columnRuleColor()); | 1513 return allowVisitedStyle ? cssValuePool().createColorValue(style.visited
DependentColor(CSSPropertyOutlineColor).rgb()) : currentColorOrValidColor(style,
style.columnRuleColor()); |
1507 case CSSPropertyWebkitColumnRuleStyle: | 1514 case CSSPropertyColumnRuleStyle: |
| 1515 if (unresolvedProperty != CSSPropertyAliasWebkitColumnRuleStyle && short
handState != DoingShorthand && !RuntimeEnabledFeatures::unprefixMulticolEnabled(
)) |
| 1516 return nullptr; |
1508 return cssValuePool().createValue(style.columnRuleStyle()); | 1517 return cssValuePool().createValue(style.columnRuleStyle()); |
1509 case CSSPropertyWebkitColumnRuleWidth: | 1518 case CSSPropertyColumnRuleWidth: |
| 1519 if (unresolvedProperty != CSSPropertyAliasWebkitColumnRuleWidth && short
handState != DoingShorthand && !RuntimeEnabledFeatures::unprefixMulticolEnabled(
)) |
| 1520 return nullptr; |
1510 return zoomAdjustedPixelValue(style.columnRuleWidth(), style); | 1521 return zoomAdjustedPixelValue(style.columnRuleWidth(), style); |
1511 case CSSPropertyWebkitColumnSpan: | 1522 case CSSPropertyColumnSpan: |
| 1523 if (unresolvedProperty != CSSPropertyAliasWebkitColumnSpan && !RuntimeEn
abledFeatures::unprefixMulticolEnabled()) |
| 1524 return nullptr; |
1512 return cssValuePool().createIdentifierValue(style.columnSpan() ? CSSValu
eAll : CSSValueNone); | 1525 return cssValuePool().createIdentifierValue(style.columnSpan() ? CSSValu
eAll : CSSValueNone); |
1513 case CSSPropertyWebkitColumnBreakAfter: | 1526 case CSSPropertyWebkitColumnBreakAfter: |
1514 return cssValuePool().createValue(style.columnBreakAfter()); | 1527 return cssValuePool().createValue(style.columnBreakAfter()); |
1515 case CSSPropertyWebkitColumnBreakBefore: | 1528 case CSSPropertyWebkitColumnBreakBefore: |
1516 return cssValuePool().createValue(style.columnBreakBefore()); | 1529 return cssValuePool().createValue(style.columnBreakBefore()); |
1517 case CSSPropertyWebkitColumnBreakInside: | 1530 case CSSPropertyWebkitColumnBreakInside: |
1518 return cssValuePool().createValue(style.columnBreakInside()); | 1531 return cssValuePool().createValue(style.columnBreakInside()); |
1519 case CSSPropertyWebkitColumnWidth: | 1532 case CSSPropertyColumnWidth: |
| 1533 if (unresolvedProperty != CSSPropertyAliasWebkitColumnWidth && shorthand
State != DoingShorthand && !RuntimeEnabledFeatures::unprefixMulticolEnabled()) |
| 1534 return nullptr; |
1520 if (style.hasAutoColumnWidth()) | 1535 if (style.hasAutoColumnWidth()) |
1521 return cssValuePool().createIdentifierValue(CSSValueAuto); | 1536 return cssValuePool().createIdentifierValue(CSSValueAuto); |
1522 return zoomAdjustedPixelValue(style.columnWidth(), style); | 1537 return zoomAdjustedPixelValue(style.columnWidth(), style); |
1523 case CSSPropertyTabSize: | 1538 case CSSPropertyTabSize: |
1524 return cssValuePool().createValue( | 1539 return cssValuePool().createValue( |
1525 style.tabSize().getPixelSize(1.0), style.tabSize().isSpaces() ? CSSP
rimitiveValue::CSS_NUMBER : CSSPrimitiveValue::CSS_PX); | 1540 style.tabSize().getPixelSize(1.0), style.tabSize().isSpaces() ? CSSP
rimitiveValue::CSS_NUMBER : CSSPrimitiveValue::CSS_PX); |
1526 case CSSPropertyCursor: { | 1541 case CSSPropertyCursor: { |
1527 RefPtrWillBeRawPtr<CSSValueList> list = nullptr; | 1542 RefPtrWillBeRawPtr<CSSValueList> list = nullptr; |
1528 CursorList* cursors = style.cursors(); | 1543 CursorList* cursors = style.cursors(); |
1529 if (cursors && cursors->size() > 0) { | 1544 if (cursors && cursors->size() > 0) { |
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2305 | 2320 |
2306 case CSSPropertyBackgroundBlendMode: { | 2321 case CSSPropertyBackgroundBlendMode: { |
2307 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparat
ed(); | 2322 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparat
ed(); |
2308 for (const FillLayer* currLayer = &style.backgroundLayers(); currLayer;
currLayer = currLayer->next()) | 2323 for (const FillLayer* currLayer = &style.backgroundLayers(); currLayer;
currLayer = currLayer->next()) |
2309 list->append(cssValuePool().createValue(currLayer->blendMode())); | 2324 list->append(cssValuePool().createValue(currLayer->blendMode())); |
2310 return list.release(); | 2325 return list.release(); |
2311 } | 2326 } |
2312 case CSSPropertyBackground: | 2327 case CSSPropertyBackground: |
2313 return valuesForBackgroundShorthand(style, layoutObject, styledNode, all
owVisitedStyle); | 2328 return valuesForBackgroundShorthand(style, layoutObject, styledNode, all
owVisitedStyle); |
2314 case CSSPropertyBorder: { | 2329 case CSSPropertyBorder: { |
2315 RefPtrWillBeRawPtr<CSSValue> value = get(CSSPropertyBorderTop, style, la
youtObject, styledNode, allowVisitedStyle); | 2330 RefPtrWillBeRawPtr<CSSValue> value = get(CSSPropertyBorderTop, style, la
youtObject, styledNode, DoingShorthand, allowVisitedStyle); |
2316 const CSSPropertyID properties[] = { | 2331 const CSSPropertyID properties[] = { |
2317 CSSPropertyBorderRight, | 2332 CSSPropertyBorderRight, |
2318 CSSPropertyBorderBottom, | 2333 CSSPropertyBorderBottom, |
2319 CSSPropertyBorderLeft | 2334 CSSPropertyBorderLeft |
2320 }; | 2335 }; |
2321 for (size_t i = 0; i < WTF_ARRAY_LENGTH(properties); ++i) { | 2336 for (size_t i = 0; i < WTF_ARRAY_LENGTH(properties); ++i) { |
2322 if (!compareCSSValuePtr<CSSValue>(value, get(properties[i], style, l
ayoutObject, styledNode, allowVisitedStyle))) | 2337 if (!compareCSSValuePtr<CSSValue>(value, get(properties[i], style, l
ayoutObject, styledNode, DoingShorthand, allowVisitedStyle))) |
2323 return nullptr; | 2338 return nullptr; |
2324 } | 2339 } |
2325 return value.release(); | 2340 return value.release(); |
2326 } | 2341 } |
2327 case CSSPropertyBorderBottom: | 2342 case CSSPropertyBorderBottom: |
2328 return valuesForShorthandProperty(borderBottomShorthand(), style, layout
Object, styledNode, allowVisitedStyle); | 2343 return valuesForShorthandProperty(borderBottomShorthand(), style, layout
Object, styledNode, allowVisitedStyle); |
2329 case CSSPropertyBorderColor: | 2344 case CSSPropertyBorderColor: |
2330 return valuesForSidesShorthand(borderColorShorthand(), style, layoutObje
ct, styledNode, allowVisitedStyle); | 2345 return valuesForSidesShorthand(borderColorShorthand(), style, layoutObje
ct, styledNode, allowVisitedStyle); |
2331 case CSSPropertyBorderLeft: | 2346 case CSSPropertyBorderLeft: |
2332 return valuesForShorthandProperty(borderLeftShorthand(), style, layoutOb
ject, styledNode, allowVisitedStyle); | 2347 return valuesForShorthandProperty(borderLeftShorthand(), style, layoutOb
ject, styledNode, allowVisitedStyle); |
2333 case CSSPropertyBorderImage: | 2348 case CSSPropertyBorderImage: |
2334 return valueForNinePieceImage(style.borderImage(), style); | 2349 return valueForNinePieceImage(style.borderImage(), style); |
2335 case CSSPropertyBorderRadius: | 2350 case CSSPropertyBorderRadius: |
2336 return valueForBorderRadiusShorthand(style); | 2351 return valueForBorderRadiusShorthand(style); |
2337 case CSSPropertyBorderRight: | 2352 case CSSPropertyBorderRight: |
2338 return valuesForShorthandProperty(borderRightShorthand(), style, layoutO
bject, styledNode, allowVisitedStyle); | 2353 return valuesForShorthandProperty(borderRightShorthand(), style, layoutO
bject, styledNode, allowVisitedStyle); |
2339 case CSSPropertyBorderStyle: | 2354 case CSSPropertyBorderStyle: |
2340 return valuesForSidesShorthand(borderStyleShorthand(), style, layoutObje
ct, styledNode, allowVisitedStyle); | 2355 return valuesForSidesShorthand(borderStyleShorthand(), style, layoutObje
ct, styledNode, allowVisitedStyle); |
2341 case CSSPropertyBorderTop: | 2356 case CSSPropertyBorderTop: |
2342 return valuesForShorthandProperty(borderTopShorthand(), style, layoutObj
ect, styledNode, allowVisitedStyle); | 2357 return valuesForShorthandProperty(borderTopShorthand(), style, layoutObj
ect, styledNode, allowVisitedStyle); |
2343 case CSSPropertyBorderWidth: | 2358 case CSSPropertyBorderWidth: |
2344 return valuesForSidesShorthand(borderWidthShorthand(), style, layoutObje
ct, styledNode, allowVisitedStyle); | 2359 return valuesForSidesShorthand(borderWidthShorthand(), style, layoutObje
ct, styledNode, allowVisitedStyle); |
2345 case CSSPropertyWebkitColumnRule: | 2360 case CSSPropertyColumnRule: |
2346 return valuesForShorthandProperty(webkitColumnRuleShorthand(), style, la
youtObject, styledNode, allowVisitedStyle); | 2361 if (unresolvedProperty != CSSPropertyAliasWebkitColumnRule && !RuntimeEn
abledFeatures::unprefixMulticolEnabled()) |
2347 case CSSPropertyWebkitColumns: | 2362 return nullptr; |
2348 return valuesForShorthandProperty(webkitColumnsShorthand(), style, layou
tObject, styledNode, allowVisitedStyle); | 2363 return valuesForShorthandProperty(columnRuleShorthand(), style, layoutOb
ject, styledNode, allowVisitedStyle); |
| 2364 case CSSPropertyColumns: |
| 2365 if (unresolvedProperty != CSSPropertyAliasWebkitColumns && !RuntimeEnabl
edFeatures::unprefixMulticolEnabled()) |
| 2366 return nullptr; |
| 2367 return valuesForShorthandProperty(columnsShorthand(), style, layoutObjec
t, styledNode, allowVisitedStyle); |
2349 case CSSPropertyListStyle: | 2368 case CSSPropertyListStyle: |
2350 return valuesForShorthandProperty(listStyleShorthand(), style, layoutObj
ect, styledNode, allowVisitedStyle); | 2369 return valuesForShorthandProperty(listStyleShorthand(), style, layoutObj
ect, styledNode, allowVisitedStyle); |
2351 case CSSPropertyMargin: | 2370 case CSSPropertyMargin: |
2352 return valuesForSidesShorthand(marginShorthand(), style, layoutObject, s
tyledNode, allowVisitedStyle); | 2371 return valuesForSidesShorthand(marginShorthand(), style, layoutObject, s
tyledNode, allowVisitedStyle); |
2353 case CSSPropertyOutline: | 2372 case CSSPropertyOutline: |
2354 return valuesForShorthandProperty(outlineShorthand(), style, layoutObjec
t, styledNode, allowVisitedStyle); | 2373 return valuesForShorthandProperty(outlineShorthand(), style, layoutObjec
t, styledNode, allowVisitedStyle); |
2355 case CSSPropertyPadding: | 2374 case CSSPropertyPadding: |
2356 return valuesForSidesShorthand(paddingShorthand(), style, layoutObject,
styledNode, allowVisitedStyle); | 2375 return valuesForSidesShorthand(paddingShorthand(), style, layoutObject,
styledNode, allowVisitedStyle); |
2357 // Individual properties not part of the spec. | 2376 // Individual properties not part of the spec. |
2358 case CSSPropertyBackgroundRepeatX: | 2377 case CSSPropertyBackgroundRepeatX: |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2581 case CSSPropertyAll: | 2600 case CSSPropertyAll: |
2582 return nullptr; | 2601 return nullptr; |
2583 default: | 2602 default: |
2584 break; | 2603 break; |
2585 } | 2604 } |
2586 ASSERT_NOT_REACHED(); | 2605 ASSERT_NOT_REACHED(); |
2587 return nullptr; | 2606 return nullptr; |
2588 } | 2607 } |
2589 | 2608 |
2590 } | 2609 } |
OLD | NEW |