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. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. |
4 * All rights reserved. | 4 * All rights reserved. |
5 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 5 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
6 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> | 6 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> |
7 * Copyright (C) 2011 Sencha, Inc. All rights reserved. | 7 * Copyright (C) 2011 Sencha, Inc. All rights reserved. |
8 * Copyright (C) 2015 Google Inc. All rights reserved. | 8 * Copyright (C) 2015 Google Inc. All rights reserved. |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
114 CSSValueList* positionList = CSSValueList::createSpaceSeparated(); | 114 CSSValueList* positionList = CSSValueList::createSpaceSeparated(); |
115 if (layer.isBackgroundXOriginSet()) { | 115 if (layer.isBackgroundXOriginSet()) { |
116 DCHECK(propertyID == CSSPropertyBackgroundPosition || | 116 DCHECK(propertyID == CSSPropertyBackgroundPosition || |
117 propertyID == CSSPropertyWebkitMaskPosition); | 117 propertyID == CSSPropertyWebkitMaskPosition); |
118 positionList->append( | 118 positionList->append( |
119 *CSSIdentifierValue::create(layer.backgroundXOrigin())); | 119 *CSSIdentifierValue::create(layer.backgroundXOrigin())); |
120 } | 120 } |
121 positionList->append( | 121 positionList->append( |
122 *zoomAdjustedPixelValueForLength(layer.xPosition(), style)); | 122 *zoomAdjustedPixelValueForLength(layer.xPosition(), style)); |
123 if (layer.isBackgroundYOriginSet()) { | 123 if (layer.isBackgroundYOriginSet()) { |
124 ASSERT(propertyID == CSSPropertyBackgroundPosition || | 124 DCHECK(propertyID == CSSPropertyBackgroundPosition || |
125 propertyID == CSSPropertyWebkitMaskPosition); | 125 propertyID == CSSPropertyWebkitMaskPosition); |
126 positionList->append( | 126 positionList->append( |
127 *CSSIdentifierValue::create(layer.backgroundYOrigin())); | 127 *CSSIdentifierValue::create(layer.backgroundYOrigin())); |
128 } | 128 } |
129 positionList->append( | 129 positionList->append( |
130 *zoomAdjustedPixelValueForLength(layer.yPosition(), style)); | 130 *zoomAdjustedPixelValueForLength(layer.yPosition(), style)); |
131 return positionList; | 131 return positionList; |
132 } | 132 } |
133 | 133 |
134 CSSValue* ComputedStyleCSSValueMapping::currentColorOrValidColor( | 134 CSSValue* ComputedStyleCSSValueMapping::currentColorOrValidColor( |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
512 result->append( | 512 result->append( |
513 *CSSValuePair::create(CSSIdentifierValue::create(CSSValueLast), | 513 *CSSValuePair::create(CSSIdentifierValue::create(CSSValueLast), |
514 CSSIdentifierValue::create(CSSValueBaseline), | 514 CSSIdentifierValue::create(CSSValueBaseline), |
515 CSSValuePair::DropIdenticalValues)); | 515 CSSValuePair::DropIdenticalValues)); |
516 } else { | 516 } else { |
517 result->append(*CSSIdentifierValue::create(data.position())); | 517 result->append(*CSSIdentifierValue::create(data.position())); |
518 } | 518 } |
519 if (data.position() >= ItemPositionCenter && | 519 if (data.position() >= ItemPositionCenter && |
520 data.overflow() != OverflowAlignmentDefault) | 520 data.overflow() != OverflowAlignmentDefault) |
521 result->append(*CSSIdentifierValue::create(data.overflow())); | 521 result->append(*CSSIdentifierValue::create(data.overflow())); |
522 ASSERT(result->length() <= 2); | 522 DCHECK_LE(result->length(), static_cast<unsigned>(2)); |
tkent
2017/03/28 14:44:55
static_cast<unsigned>(2) -> 2u
nikhil.sahni
2017/03/30 12:17:57
Done.
| |
523 return result; | 523 return result; |
524 } | 524 } |
525 | 525 |
526 static CSSValueList* valuesForGridShorthand( | 526 static CSSValueList* valuesForGridShorthand( |
527 const StylePropertyShorthand& shorthand, | 527 const StylePropertyShorthand& shorthand, |
528 const ComputedStyle& style, | 528 const ComputedStyle& style, |
529 const LayoutObject* layoutObject, | 529 const LayoutObject* layoutObject, |
530 Node* styledNode, | 530 Node* styledNode, |
531 bool allowVisitedStyle) { | 531 bool allowVisitedStyle) { |
532 CSSValueList* list = CSSValueList::createSlashSeparated(); | 532 CSSValueList* list = CSSValueList::createSlashSeparated(); |
533 for (size_t i = 0; i < shorthand.length(); ++i) { | 533 for (size_t i = 0; i < shorthand.length(); ++i) { |
534 const CSSValue* value = ComputedStyleCSSValueMapping::get( | 534 const CSSValue* value = ComputedStyleCSSValueMapping::get( |
535 shorthand.properties()[i], style, layoutObject, styledNode, | 535 shorthand.properties()[i], style, layoutObject, styledNode, |
536 allowVisitedStyle); | 536 allowVisitedStyle); |
537 ASSERT(value); | 537 DCHECK(value); |
538 list->append(*value); | 538 list->append(*value); |
539 } | 539 } |
540 return list; | 540 return list; |
541 } | 541 } |
542 | 542 |
543 static CSSValueList* valuesForShorthandProperty( | 543 static CSSValueList* valuesForShorthandProperty( |
544 const StylePropertyShorthand& shorthand, | 544 const StylePropertyShorthand& shorthand, |
545 const ComputedStyle& style, | 545 const ComputedStyle& style, |
546 const LayoutObject* layoutObject, | 546 const LayoutObject* layoutObject, |
547 Node* styledNode, | 547 Node* styledNode, |
548 bool allowVisitedStyle) { | 548 bool allowVisitedStyle) { |
549 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 549 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
550 for (size_t i = 0; i < shorthand.length(); ++i) { | 550 for (size_t i = 0; i < shorthand.length(); ++i) { |
551 const CSSValue* value = ComputedStyleCSSValueMapping::get( | 551 const CSSValue* value = ComputedStyleCSSValueMapping::get( |
552 shorthand.properties()[i], style, layoutObject, styledNode, | 552 shorthand.properties()[i], style, layoutObject, styledNode, |
553 allowVisitedStyle); | 553 allowVisitedStyle); |
554 ASSERT(value); | 554 DCHECK(value); |
555 list->append(*value); | 555 list->append(*value); |
556 } | 556 } |
557 return list; | 557 return list; |
558 } | 558 } |
559 | 559 |
560 static CSSValue* expandNoneLigaturesValue() { | 560 static CSSValue* expandNoneLigaturesValue() { |
561 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 561 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
562 list->append(*CSSIdentifierValue::create(CSSValueNoCommonLigatures)); | 562 list->append(*CSSIdentifierValue::create(CSSValueNoCommonLigatures)); |
563 list->append(*CSSIdentifierValue::create(CSSValueNoDiscretionaryLigatures)); | 563 list->append(*CSSIdentifierValue::create(CSSValueNoDiscretionaryLigatures)); |
564 list->append(*CSSIdentifierValue::create(CSSValueNoHistoricalLigatures)); | 564 list->append(*CSSIdentifierValue::create(CSSValueNoHistoricalLigatures)); |
(...skipping 28 matching lines...) Expand all Loading... | |
593 case AllNormal: | 593 case AllNormal: |
594 return CSSIdentifierValue::create(CSSValueNormal); | 594 return CSSIdentifierValue::create(CSSValueNormal); |
595 case NoneLigatures: | 595 case NoneLigatures: |
596 return CSSIdentifierValue::create(CSSValueNone); | 596 return CSSIdentifierValue::create(CSSValueNone); |
597 case ConcatenateNonNormal: { | 597 case ConcatenateNonNormal: { |
598 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 598 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
599 for (size_t i = 0; i < fontVariantShorthand().length(); ++i) { | 599 for (size_t i = 0; i < fontVariantShorthand().length(); ++i) { |
600 const CSSValue* value = ComputedStyleCSSValueMapping::get( | 600 const CSSValue* value = ComputedStyleCSSValueMapping::get( |
601 fontVariantShorthand().properties()[i], style, layoutObject, | 601 fontVariantShorthand().properties()[i], style, layoutObject, |
602 styledNode, allowVisitedStyle); | 602 styledNode, allowVisitedStyle); |
603 ASSERT(value); | 603 DCHECK(value); |
604 if (value->isIdentifierValue() && | 604 if (value->isIdentifierValue() && |
605 toCSSIdentifierValue(value)->getValueID() == CSSValueNone) { | 605 toCSSIdentifierValue(value)->getValueID() == CSSValueNone) { |
606 list->append(*expandNoneLigaturesValue()); | 606 list->append(*expandNoneLigaturesValue()); |
607 } else if (!(value->isIdentifierValue() && | 607 } else if (!(value->isIdentifierValue() && |
608 toCSSIdentifierValue(value)->getValueID() == | 608 toCSSIdentifierValue(value)->getValueID() == |
609 CSSValueNormal)) { | 609 CSSValueNormal)) { |
610 list->append(*value); | 610 list->append(*value); |
611 } | 611 } |
612 } | 612 } |
613 return list; | 613 return list; |
(...skipping 11 matching lines...) Expand all Loading... | |
625 bool allowVisitedStyle) { | 625 bool allowVisitedStyle) { |
626 CSSValueList* ret = CSSValueList::createCommaSeparated(); | 626 CSSValueList* ret = CSSValueList::createCommaSeparated(); |
627 const FillLayer* currLayer = &style.backgroundLayers(); | 627 const FillLayer* currLayer = &style.backgroundLayers(); |
628 for (; currLayer; currLayer = currLayer->next()) { | 628 for (; currLayer; currLayer = currLayer->next()) { |
629 CSSValueList* list = CSSValueList::createSlashSeparated(); | 629 CSSValueList* list = CSSValueList::createSlashSeparated(); |
630 CSSValueList* beforeSlash = CSSValueList::createSpaceSeparated(); | 630 CSSValueList* beforeSlash = CSSValueList::createSpaceSeparated(); |
631 if (!currLayer->next()) { // color only for final layer | 631 if (!currLayer->next()) { // color only for final layer |
632 const CSSValue* value = ComputedStyleCSSValueMapping::get( | 632 const CSSValue* value = ComputedStyleCSSValueMapping::get( |
633 CSSPropertyBackgroundColor, style, layoutObject, styledNode, | 633 CSSPropertyBackgroundColor, style, layoutObject, styledNode, |
634 allowVisitedStyle); | 634 allowVisitedStyle); |
635 ASSERT(value); | 635 DCHECK(value); |
636 beforeSlash->append(*value); | 636 beforeSlash->append(*value); |
637 } | 637 } |
638 beforeSlash->append(currLayer->image() | 638 beforeSlash->append(currLayer->image() |
639 ? *currLayer->image()->computedCSSValue() | 639 ? *currLayer->image()->computedCSSValue() |
640 : *CSSIdentifierValue::create(CSSValueNone)); | 640 : *CSSIdentifierValue::create(CSSValueNone)); |
641 beforeSlash->append( | 641 beforeSlash->append( |
642 *valueForFillRepeat(currLayer->repeatX(), currLayer->repeatY())); | 642 *valueForFillRepeat(currLayer->repeatX(), currLayer->repeatY())); |
643 beforeSlash->append(*CSSIdentifierValue::create(currLayer->attachment())); | 643 beforeSlash->append(*CSSIdentifierValue::create(currLayer->attachment())); |
644 beforeSlash->append(*createPositionListForLayer( | 644 beforeSlash->append(*createPositionListForLayer( |
645 CSSPropertyBackgroundPosition, *currLayer, style)); | 645 CSSPropertyBackgroundPosition, *currLayer, style)); |
(...skipping 20 matching lines...) Expand all Loading... | |
666 if (!RuntimeEnabledFeatures::cssGridLayoutEnabled() && | 666 if (!RuntimeEnabledFeatures::cssGridLayoutEnabled() && |
667 data.position() == ContentPositionNormal) | 667 data.position() == ContentPositionNormal) |
668 result->append(*CSSIdentifierValue::create(normalBehaviorValueID)); | 668 result->append(*CSSIdentifierValue::create(normalBehaviorValueID)); |
669 else | 669 else |
670 result->append(*CSSIdentifierValue::create(data.position())); | 670 result->append(*CSSIdentifierValue::create(data.position())); |
671 } | 671 } |
672 if ((data.position() >= ContentPositionCenter || | 672 if ((data.position() >= ContentPositionCenter || |
673 data.distribution() != ContentDistributionDefault) && | 673 data.distribution() != ContentDistributionDefault) && |
674 data.overflow() != OverflowAlignmentDefault) | 674 data.overflow() != OverflowAlignmentDefault) |
675 result->append(*CSSIdentifierValue::create(data.overflow())); | 675 result->append(*CSSIdentifierValue::create(data.overflow())); |
676 ASSERT(result->length() > 0); | 676 DCHECK_GT(result->length(), static_cast<unsigned>(0)); |
tkent
2017/03/28 14:44:55
static_cast<unsigned>(0) -> 0u
| |
677 ASSERT(result->length() <= 3); | 677 DCHECK_LE(result->length(), static_cast<unsigned>(3)); |
tkent
2017/03/28 14:44:55
static_cast<unsigned>(3) -> 3u
nikhil.sahni
2017/03/30 12:17:57
Done.
| |
678 return result; | 678 return result; |
679 } | 679 } |
680 | 680 |
681 static CSSValue* valueForLineHeight(const ComputedStyle& style) { | 681 static CSSValue* valueForLineHeight(const ComputedStyle& style) { |
682 Length length = style.lineHeight(); | 682 Length length = style.lineHeight(); |
683 if (length.isNegative()) | 683 if (length.isNegative()) |
684 return CSSIdentifierValue::create(CSSValueNormal); | 684 return CSSIdentifierValue::create(CSSValueNormal); |
685 | 685 |
686 return zoomAdjustedPixelValue( | 686 return zoomAdjustedPixelValue( |
687 floatValueForLength(length, style.getFontDescription().computedSize()), | 687 floatValueForLength(length, style.getFontDescription().computedSize()), |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
885 return minMaxTrackBreadths; | 885 return minMaxTrackBreadths; |
886 } | 886 } |
887 case FitContentTrackSizing: { | 887 case FitContentTrackSizing: { |
888 auto* fitContentTrackBreadth = | 888 auto* fitContentTrackBreadth = |
889 CSSFunctionValue::create(CSSValueFitContent); | 889 CSSFunctionValue::create(CSSValueFitContent); |
890 fitContentTrackBreadth->append(*specifiedValueForGridTrackBreadth( | 890 fitContentTrackBreadth->append(*specifiedValueForGridTrackBreadth( |
891 trackSize.fitContentTrackBreadth(), style)); | 891 trackSize.fitContentTrackBreadth(), style)); |
892 return fitContentTrackBreadth; | 892 return fitContentTrackBreadth; |
893 } | 893 } |
894 } | 894 } |
895 ASSERT_NOT_REACHED(); | 895 NOTREACHED(); |
896 return nullptr; | 896 return nullptr; |
897 } | 897 } |
898 | 898 |
899 class OrderedNamedLinesCollector { | 899 class OrderedNamedLinesCollector { |
900 STACK_ALLOCATED(); | 900 STACK_ALLOCATED(); |
901 WTF_MAKE_NONCOPYABLE(OrderedNamedLinesCollector); | 901 WTF_MAKE_NONCOPYABLE(OrderedNamedLinesCollector); |
902 | 902 |
903 public: | 903 public: |
904 OrderedNamedLinesCollector(const ComputedStyle& style, | 904 OrderedNamedLinesCollector(const ComputedStyle& style, |
905 bool isRowAxis, | 905 bool isRowAxis, |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1122 case TextDecorationStyleDouble: | 1122 case TextDecorationStyleDouble: |
1123 return CSSIdentifierValue::create(CSSValueDouble); | 1123 return CSSIdentifierValue::create(CSSValueDouble); |
1124 case TextDecorationStyleDotted: | 1124 case TextDecorationStyleDotted: |
1125 return CSSIdentifierValue::create(CSSValueDotted); | 1125 return CSSIdentifierValue::create(CSSValueDotted); |
1126 case TextDecorationStyleDashed: | 1126 case TextDecorationStyleDashed: |
1127 return CSSIdentifierValue::create(CSSValueDashed); | 1127 return CSSIdentifierValue::create(CSSValueDashed); |
1128 case TextDecorationStyleWavy: | 1128 case TextDecorationStyleWavy: |
1129 return CSSIdentifierValue::create(CSSValueWavy); | 1129 return CSSIdentifierValue::create(CSSValueWavy); |
1130 } | 1130 } |
1131 | 1131 |
1132 ASSERT_NOT_REACHED(); | 1132 NOTREACHED(); |
1133 return CSSInitialValue::create(); | 1133 return CSSInitialValue::create(); |
1134 } | 1134 } |
1135 | 1135 |
1136 static CSSValue* valueForTextDecorationSkip( | 1136 static CSSValue* valueForTextDecorationSkip( |
1137 TextDecorationSkip textDecorationSkip) { | 1137 TextDecorationSkip textDecorationSkip) { |
1138 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 1138 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
1139 if (textDecorationSkip & TextDecorationSkipObjects) | 1139 if (textDecorationSkip & TextDecorationSkipObjects) |
1140 list->append(*CSSIdentifierValue::create(CSSValueObjects)); | 1140 list->append(*CSSIdentifierValue::create(CSSValueObjects)); |
1141 if (textDecorationSkip & TextDecorationSkipInk) | 1141 if (textDecorationSkip & TextDecorationSkipInk) |
1142 list->append(*CSSIdentifierValue::create(CSSValueInk)); | 1142 list->append(*CSSIdentifierValue::create(CSSValueInk)); |
(...skipping 21 matching lines...) Expand all Loading... | |
1164 list->append(*CSSIdentifierValue::create(CSSValuePanY)); | 1164 list->append(*CSSIdentifierValue::create(CSSValuePanY)); |
1165 else if (touchAction & TouchActionPanUp) | 1165 else if (touchAction & TouchActionPanUp) |
1166 list->append(*CSSIdentifierValue::create(CSSValuePanUp)); | 1166 list->append(*CSSIdentifierValue::create(CSSValuePanUp)); |
1167 else if (touchAction & TouchActionPanDown) | 1167 else if (touchAction & TouchActionPanDown) |
1168 list->append(*CSSIdentifierValue::create(CSSValuePanDown)); | 1168 list->append(*CSSIdentifierValue::create(CSSValuePanDown)); |
1169 | 1169 |
1170 if ((touchAction & TouchActionPinchZoom) == TouchActionPinchZoom) | 1170 if ((touchAction & TouchActionPinchZoom) == TouchActionPinchZoom) |
1171 list->append(*CSSIdentifierValue::create(CSSValuePinchZoom)); | 1171 list->append(*CSSIdentifierValue::create(CSSValuePinchZoom)); |
1172 } | 1172 } |
1173 | 1173 |
1174 ASSERT(list->length()); | 1174 DCHECK(list->length()); |
1175 return list; | 1175 return list; |
1176 } | 1176 } |
1177 | 1177 |
1178 static CSSValue* valueForWillChange( | 1178 static CSSValue* valueForWillChange( |
1179 const Vector<CSSPropertyID>& willChangeProperties, | 1179 const Vector<CSSPropertyID>& willChangeProperties, |
1180 bool willChangeContents, | 1180 bool willChangeContents, |
1181 bool willChangeScrollPosition) { | 1181 bool willChangeScrollPosition) { |
1182 CSSValueList* list = CSSValueList::createCommaSeparated(); | 1182 CSSValueList* list = CSSValueList::createCommaSeparated(); |
1183 if (willChangeContents) | 1183 if (willChangeContents) |
1184 list->append(*CSSIdentifierValue::create(CSSValueContents)); | 1184 list->append(*CSSIdentifierValue::create(CSSValueContents)); |
(...skipping 24 matching lines...) Expand all Loading... | |
1209 switch (direction) { | 1209 switch (direction) { |
1210 case Timing::PlaybackDirection::NORMAL: | 1210 case Timing::PlaybackDirection::NORMAL: |
1211 return CSSIdentifierValue::create(CSSValueNormal); | 1211 return CSSIdentifierValue::create(CSSValueNormal); |
1212 case Timing::PlaybackDirection::ALTERNATE_NORMAL: | 1212 case Timing::PlaybackDirection::ALTERNATE_NORMAL: |
1213 return CSSIdentifierValue::create(CSSValueAlternate); | 1213 return CSSIdentifierValue::create(CSSValueAlternate); |
1214 case Timing::PlaybackDirection::REVERSE: | 1214 case Timing::PlaybackDirection::REVERSE: |
1215 return CSSIdentifierValue::create(CSSValueReverse); | 1215 return CSSIdentifierValue::create(CSSValueReverse); |
1216 case Timing::PlaybackDirection::ALTERNATE_REVERSE: | 1216 case Timing::PlaybackDirection::ALTERNATE_REVERSE: |
1217 return CSSIdentifierValue::create(CSSValueAlternateReverse); | 1217 return CSSIdentifierValue::create(CSSValueAlternateReverse); |
1218 default: | 1218 default: |
1219 ASSERT_NOT_REACHED(); | 1219 NOTREACHED(); |
1220 return nullptr; | 1220 return nullptr; |
1221 } | 1221 } |
1222 } | 1222 } |
1223 | 1223 |
1224 static CSSValue* valueForAnimationDuration(const CSSTimingData* timingData) { | 1224 static CSSValue* valueForAnimationDuration(const CSSTimingData* timingData) { |
1225 CSSValueList* list = CSSValueList::createCommaSeparated(); | 1225 CSSValueList* list = CSSValueList::createCommaSeparated(); |
1226 if (timingData) { | 1226 if (timingData) { |
1227 for (size_t i = 0; i < timingData->durationList().size(); ++i) | 1227 for (size_t i = 0; i < timingData->durationList().size(); ++i) |
1228 list->append(*CSSPrimitiveValue::create( | 1228 list->append(*CSSPrimitiveValue::create( |
1229 timingData->durationList()[i], CSSPrimitiveValue::UnitType::Seconds)); | 1229 timingData->durationList()[i], CSSPrimitiveValue::UnitType::Seconds)); |
1230 } else { | 1230 } else { |
1231 list->append( | 1231 list->append( |
1232 *CSSPrimitiveValue::create(CSSTimingData::initialDuration(), | 1232 *CSSPrimitiveValue::create(CSSTimingData::initialDuration(), |
1233 CSSPrimitiveValue::UnitType::Seconds)); | 1233 CSSPrimitiveValue::UnitType::Seconds)); |
1234 } | 1234 } |
1235 return list; | 1235 return list; |
1236 } | 1236 } |
1237 | 1237 |
1238 static CSSValue* valueForAnimationFillMode(Timing::FillMode fillMode) { | 1238 static CSSValue* valueForAnimationFillMode(Timing::FillMode fillMode) { |
1239 switch (fillMode) { | 1239 switch (fillMode) { |
1240 case Timing::FillMode::NONE: | 1240 case Timing::FillMode::NONE: |
1241 return CSSIdentifierValue::create(CSSValueNone); | 1241 return CSSIdentifierValue::create(CSSValueNone); |
1242 case Timing::FillMode::FORWARDS: | 1242 case Timing::FillMode::FORWARDS: |
1243 return CSSIdentifierValue::create(CSSValueForwards); | 1243 return CSSIdentifierValue::create(CSSValueForwards); |
1244 case Timing::FillMode::BACKWARDS: | 1244 case Timing::FillMode::BACKWARDS: |
1245 return CSSIdentifierValue::create(CSSValueBackwards); | 1245 return CSSIdentifierValue::create(CSSValueBackwards); |
1246 case Timing::FillMode::BOTH: | 1246 case Timing::FillMode::BOTH: |
1247 return CSSIdentifierValue::create(CSSValueBoth); | 1247 return CSSIdentifierValue::create(CSSValueBoth); |
1248 default: | 1248 default: |
1249 ASSERT_NOT_REACHED(); | 1249 NOTREACHED(); |
1250 return nullptr; | 1250 return nullptr; |
1251 } | 1251 } |
1252 } | 1252 } |
1253 | 1253 |
1254 static CSSValue* valueForAnimationIterationCount(double iterationCount) { | 1254 static CSSValue* valueForAnimationIterationCount(double iterationCount) { |
1255 if (iterationCount == std::numeric_limits<double>::infinity()) | 1255 if (iterationCount == std::numeric_limits<double>::infinity()) |
1256 return CSSIdentifierValue::create(CSSValueInfinite); | 1256 return CSSIdentifierValue::create(CSSValueInfinite); |
1257 return CSSPrimitiveValue::create(iterationCount, | 1257 return CSSPrimitiveValue::create(iterationCount, |
1258 CSSPrimitiveValue::UnitType::Number); | 1258 CSSPrimitiveValue::UnitType::Number); |
1259 } | 1259 } |
1260 | 1260 |
1261 static CSSValue* valueForAnimationPlayState(EAnimPlayState playState) { | 1261 static CSSValue* valueForAnimationPlayState(EAnimPlayState playState) { |
1262 if (playState == AnimPlayStatePlaying) | 1262 if (playState == AnimPlayStatePlaying) |
1263 return CSSIdentifierValue::create(CSSValueRunning); | 1263 return CSSIdentifierValue::create(CSSValueRunning); |
1264 ASSERT(playState == AnimPlayStatePaused); | 1264 DCHECK_EQ(playState, AnimPlayStatePaused); |
1265 return CSSIdentifierValue::create(CSSValuePaused); | 1265 return CSSIdentifierValue::create(CSSValuePaused); |
1266 } | 1266 } |
1267 | 1267 |
1268 static CSSValue* createTimingFunctionValue( | 1268 static CSSValue* createTimingFunctionValue( |
1269 const TimingFunction* timingFunction) { | 1269 const TimingFunction* timingFunction) { |
1270 switch (timingFunction->getType()) { | 1270 switch (timingFunction->getType()) { |
1271 case TimingFunction::Type::CUBIC_BEZIER: { | 1271 case TimingFunction::Type::CUBIC_BEZIER: { |
1272 const CubicBezierTimingFunction* bezierTimingFunction = | 1272 const CubicBezierTimingFunction* bezierTimingFunction = |
1273 toCubicBezierTimingFunction(timingFunction); | 1273 toCubicBezierTimingFunction(timingFunction); |
1274 if (bezierTimingFunction->getEaseType() != | 1274 if (bezierTimingFunction->getEaseType() != |
1275 CubicBezierTimingFunction::EaseType::CUSTOM) { | 1275 CubicBezierTimingFunction::EaseType::CUSTOM) { |
1276 CSSValueID valueId = CSSValueInvalid; | 1276 CSSValueID valueId = CSSValueInvalid; |
1277 switch (bezierTimingFunction->getEaseType()) { | 1277 switch (bezierTimingFunction->getEaseType()) { |
1278 case CubicBezierTimingFunction::EaseType::EASE: | 1278 case CubicBezierTimingFunction::EaseType::EASE: |
1279 valueId = CSSValueEase; | 1279 valueId = CSSValueEase; |
1280 break; | 1280 break; |
1281 case CubicBezierTimingFunction::EaseType::EASE_IN: | 1281 case CubicBezierTimingFunction::EaseType::EASE_IN: |
1282 valueId = CSSValueEaseIn; | 1282 valueId = CSSValueEaseIn; |
1283 break; | 1283 break; |
1284 case CubicBezierTimingFunction::EaseType::EASE_OUT: | 1284 case CubicBezierTimingFunction::EaseType::EASE_OUT: |
1285 valueId = CSSValueEaseOut; | 1285 valueId = CSSValueEaseOut; |
1286 break; | 1286 break; |
1287 case CubicBezierTimingFunction::EaseType::EASE_IN_OUT: | 1287 case CubicBezierTimingFunction::EaseType::EASE_IN_OUT: |
1288 valueId = CSSValueEaseInOut; | 1288 valueId = CSSValueEaseInOut; |
1289 break; | 1289 break; |
1290 default: | 1290 default: |
1291 ASSERT_NOT_REACHED(); | 1291 NOTREACHED(); |
1292 return nullptr; | 1292 return nullptr; |
1293 } | 1293 } |
1294 return CSSIdentifierValue::create(valueId); | 1294 return CSSIdentifierValue::create(valueId); |
1295 } | 1295 } |
1296 return CSSCubicBezierTimingFunctionValue::create( | 1296 return CSSCubicBezierTimingFunctionValue::create( |
1297 bezierTimingFunction->x1(), bezierTimingFunction->y1(), | 1297 bezierTimingFunction->x1(), bezierTimingFunction->y1(), |
1298 bezierTimingFunction->x2(), bezierTimingFunction->y2()); | 1298 bezierTimingFunction->x2(), bezierTimingFunction->y2()); |
1299 } | 1299 } |
1300 | 1300 |
1301 case TimingFunction::Type::STEPS: { | 1301 case TimingFunction::Type::STEPS: { |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1442 | 1442 |
1443 return list; | 1443 return list; |
1444 } | 1444 } |
1445 | 1445 |
1446 static CSSValue* createTransitionPropertyValue( | 1446 static CSSValue* createTransitionPropertyValue( |
1447 const CSSTransitionData::TransitionProperty& property) { | 1447 const CSSTransitionData::TransitionProperty& property) { |
1448 if (property.propertyType == CSSTransitionData::TransitionNone) | 1448 if (property.propertyType == CSSTransitionData::TransitionNone) |
1449 return CSSIdentifierValue::create(CSSValueNone); | 1449 return CSSIdentifierValue::create(CSSValueNone); |
1450 if (property.propertyType == CSSTransitionData::TransitionUnknownProperty) | 1450 if (property.propertyType == CSSTransitionData::TransitionUnknownProperty) |
1451 return CSSCustomIdentValue::create(property.propertyString); | 1451 return CSSCustomIdentValue::create(property.propertyString); |
1452 ASSERT(property.propertyType == CSSTransitionData::TransitionKnownProperty); | 1452 DCHECK_EQ(property.propertyType, CSSTransitionData::TransitionKnownProperty); |
1453 return CSSCustomIdentValue::create( | 1453 return CSSCustomIdentValue::create( |
1454 getPropertyNameAtomicString(property.unresolvedProperty)); | 1454 getPropertyNameAtomicString(property.unresolvedProperty)); |
1455 } | 1455 } |
1456 | 1456 |
1457 static CSSValue* valueForTransitionProperty( | 1457 static CSSValue* valueForTransitionProperty( |
1458 const CSSTransitionData* transitionData) { | 1458 const CSSTransitionData* transitionData) { |
1459 CSSValueList* list = CSSValueList::createCommaSeparated(); | 1459 CSSValueList* list = CSSValueList::createCommaSeparated(); |
1460 if (transitionData) { | 1460 if (transitionData) { |
1461 for (size_t i = 0; i < transitionData->propertyList().size(); ++i) | 1461 for (size_t i = 0; i < transitionData->propertyList().size(); ++i) |
1462 list->append( | 1462 list->append( |
1463 *createTransitionPropertyValue(transitionData->propertyList()[i])); | 1463 *createTransitionPropertyValue(transitionData->propertyList()[i])); |
1464 } else { | 1464 } else { |
1465 list->append(*CSSIdentifierValue::create(CSSValueAll)); | 1465 list->append(*CSSIdentifierValue::create(CSSValueAll)); |
1466 } | 1466 } |
1467 return list; | 1467 return list; |
1468 } | 1468 } |
1469 | 1469 |
1470 CSSValueID valueForQuoteType(const QuoteType quoteType) { | 1470 CSSValueID valueForQuoteType(const QuoteType quoteType) { |
1471 switch (quoteType) { | 1471 switch (quoteType) { |
1472 case NO_OPEN_QUOTE: | 1472 case NO_OPEN_QUOTE: |
1473 return CSSValueNoOpenQuote; | 1473 return CSSValueNoOpenQuote; |
1474 case NO_CLOSE_QUOTE: | 1474 case NO_CLOSE_QUOTE: |
1475 return CSSValueNoCloseQuote; | 1475 return CSSValueNoCloseQuote; |
1476 case CLOSE_QUOTE: | 1476 case CLOSE_QUOTE: |
1477 return CSSValueCloseQuote; | 1477 return CSSValueCloseQuote; |
1478 case OPEN_QUOTE: | 1478 case OPEN_QUOTE: |
1479 return CSSValueOpenQuote; | 1479 return CSSValueOpenQuote; |
1480 } | 1480 } |
1481 ASSERT_NOT_REACHED(); | 1481 NOTREACHED(); |
1482 return CSSValueInvalid; | 1482 return CSSValueInvalid; |
1483 } | 1483 } |
1484 | 1484 |
1485 static CSSValue* valueForContentData(const ComputedStyle& style) { | 1485 static CSSValue* valueForContentData(const ComputedStyle& style) { |
1486 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 1486 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
1487 for (const ContentData* contentData = style.contentData(); contentData; | 1487 for (const ContentData* contentData = style.contentData(); contentData; |
1488 contentData = contentData->next()) { | 1488 contentData = contentData->next()) { |
1489 if (contentData->isCounter()) { | 1489 if (contentData->isCounter()) { |
1490 const CounterContent* counter = | 1490 const CounterContent* counter = |
1491 toCounterContentData(contentData)->counter(); | 1491 toCounterContentData(contentData)->counter(); |
1492 ASSERT(counter); | 1492 DCHECK(counter); |
1493 CSSCustomIdentValue* identifier = | 1493 CSSCustomIdentValue* identifier = |
1494 CSSCustomIdentValue::create(counter->identifier()); | 1494 CSSCustomIdentValue::create(counter->identifier()); |
1495 CSSStringValue* separator = CSSStringValue::create(counter->separator()); | 1495 CSSStringValue* separator = CSSStringValue::create(counter->separator()); |
1496 CSSValueID listStyleIdent = CSSValueNone; | 1496 CSSValueID listStyleIdent = CSSValueNone; |
1497 if (counter->listStyle() != EListStyleType::kNone) { | 1497 if (counter->listStyle() != EListStyleType::kNone) { |
1498 // TODO(sashab): Change this to use a converter instead of | 1498 // TODO(sashab): Change this to use a converter instead of |
1499 // CSSPrimitiveValueMappings. | 1499 // CSSPrimitiveValueMappings. |
1500 listStyleIdent = | 1500 listStyleIdent = |
1501 CSSIdentifierValue::create(counter->listStyle())->getValueID(); | 1501 CSSIdentifierValue::create(counter->listStyle())->getValueID(); |
1502 } | 1502 } |
1503 CSSIdentifierValue* listStyle = | 1503 CSSIdentifierValue* listStyle = |
1504 CSSIdentifierValue::create(listStyleIdent); | 1504 CSSIdentifierValue::create(listStyleIdent); |
1505 list->append(*CSSCounterValue::create(identifier, listStyle, separator)); | 1505 list->append(*CSSCounterValue::create(identifier, listStyle, separator)); |
1506 } else if (contentData->isImage()) { | 1506 } else if (contentData->isImage()) { |
1507 const StyleImage* image = toImageContentData(contentData)->image(); | 1507 const StyleImage* image = toImageContentData(contentData)->image(); |
1508 ASSERT(image); | 1508 DCHECK(image); |
1509 list->append(*image->computedCSSValue()); | 1509 list->append(*image->computedCSSValue()); |
1510 } else if (contentData->isText()) { | 1510 } else if (contentData->isText()) { |
1511 list->append( | 1511 list->append( |
1512 *CSSStringValue::create(toTextContentData(contentData)->text())); | 1512 *CSSStringValue::create(toTextContentData(contentData)->text())); |
1513 } else if (contentData->isQuote()) { | 1513 } else if (contentData->isQuote()) { |
1514 const QuoteType quoteType = toQuoteContentData(contentData)->quote(); | 1514 const QuoteType quoteType = toQuoteContentData(contentData)->quote(); |
1515 list->append(*CSSIdentifierValue::create(valueForQuoteType(quoteType))); | 1515 list->append(*CSSIdentifierValue::create(valueForQuoteType(quoteType))); |
1516 } else { | 1516 } else { |
1517 ASSERT_NOT_REACHED(); | 1517 NOTREACHED(); |
1518 } | 1518 } |
1519 } | 1519 } |
1520 return list; | 1520 return list; |
1521 } | 1521 } |
1522 | 1522 |
1523 static CSSValue* valueForCounterDirectives(const ComputedStyle& style, | 1523 static CSSValue* valueForCounterDirectives(const ComputedStyle& style, |
1524 CSSPropertyID propertyID) { | 1524 CSSPropertyID propertyID) { |
1525 const CounterDirectiveMap* map = style.counterDirectives(); | 1525 const CounterDirectiveMap* map = style.counterDirectives(); |
1526 if (!map) | 1526 if (!map) |
1527 return CSSIdentifierValue::create(CSSValueNone); | 1527 return CSSIdentifierValue::create(CSSValueNone); |
(...skipping 25 matching lines...) Expand all Loading... | |
1553 if (!shapeValue) | 1553 if (!shapeValue) |
1554 return CSSIdentifierValue::create(CSSValueNone); | 1554 return CSSIdentifierValue::create(CSSValueNone); |
1555 if (shapeValue->type() == ShapeValue::Box) | 1555 if (shapeValue->type() == ShapeValue::Box) |
1556 return CSSIdentifierValue::create(shapeValue->cssBox()); | 1556 return CSSIdentifierValue::create(shapeValue->cssBox()); |
1557 if (shapeValue->type() == ShapeValue::Image) { | 1557 if (shapeValue->type() == ShapeValue::Image) { |
1558 if (shapeValue->image()) | 1558 if (shapeValue->image()) |
1559 return shapeValue->image()->computedCSSValue(); | 1559 return shapeValue->image()->computedCSSValue(); |
1560 return CSSIdentifierValue::create(CSSValueNone); | 1560 return CSSIdentifierValue::create(CSSValueNone); |
1561 } | 1561 } |
1562 | 1562 |
1563 ASSERT(shapeValue->type() == ShapeValue::Shape); | 1563 DCHECK_EQ(shapeValue->type(), ShapeValue::Shape); |
1564 | 1564 |
1565 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 1565 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
1566 list->append(*valueForBasicShape(style, shapeValue->shape())); | 1566 list->append(*valueForBasicShape(style, shapeValue->shape())); |
1567 if (shapeValue->cssBox() != BoxMissing) | 1567 if (shapeValue->cssBox() != BoxMissing) |
1568 list->append(*CSSIdentifierValue::create(shapeValue->cssBox())); | 1568 list->append(*CSSIdentifierValue::create(shapeValue->cssBox())); |
1569 return list; | 1569 return list; |
1570 } | 1570 } |
1571 | 1571 |
1572 static CSSValueList* valuesForSidesShorthand( | 1572 static CSSValueList* valuesForSidesShorthand( |
1573 const StylePropertyShorthand& shorthand, | 1573 const StylePropertyShorthand& shorthand, |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1682 for (int i = 0; i < 3; i++) { | 1682 for (int i = 0; i < 3; i++) { |
1683 EPaintOrderType paintOrderType = svgStyle.paintOrderType(i); | 1683 EPaintOrderType paintOrderType = svgStyle.paintOrderType(i); |
1684 switch (paintOrderType) { | 1684 switch (paintOrderType) { |
1685 case PT_FILL: | 1685 case PT_FILL: |
1686 case PT_STROKE: | 1686 case PT_STROKE: |
1687 case PT_MARKERS: | 1687 case PT_MARKERS: |
1688 list->append(*CSSIdentifierValue::create(paintOrderType)); | 1688 list->append(*CSSIdentifierValue::create(paintOrderType)); |
1689 break; | 1689 break; |
1690 case PT_NONE: | 1690 case PT_NONE: |
1691 default: | 1691 default: |
1692 ASSERT_NOT_REACHED(); | 1692 NOTREACHED(); |
1693 break; | 1693 break; |
1694 } | 1694 } |
1695 } | 1695 } |
1696 | 1696 |
1697 return list; | 1697 return list; |
1698 } | 1698 } |
1699 | 1699 |
1700 static CSSValue* adjustSVGPaintForCurrentColor(SVGPaintType paintType, | 1700 static CSSValue* adjustSVGPaintForCurrentColor(SVGPaintType paintType, |
1701 const String& url, | 1701 const String& url, |
1702 const Color& color, | 1702 const Color& color, |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1832 const auto& dropShadowOperation = | 1832 const auto& dropShadowOperation = |
1833 toDropShadowFilterOperation(*filterOperation); | 1833 toDropShadowFilterOperation(*filterOperation); |
1834 filterValue = CSSFunctionValue::create(CSSValueDropShadow); | 1834 filterValue = CSSFunctionValue::create(CSSValueDropShadow); |
1835 // We want our computed style to look like that of a text shadow (has | 1835 // We want our computed style to look like that of a text shadow (has |
1836 // neither spread nor inset style). | 1836 // neither spread nor inset style). |
1837 filterValue->append( | 1837 filterValue->append( |
1838 *valueForShadowData(dropShadowOperation.shadow(), style, false)); | 1838 *valueForShadowData(dropShadowOperation.shadow(), style, false)); |
1839 break; | 1839 break; |
1840 } | 1840 } |
1841 default: | 1841 default: |
1842 ASSERT_NOT_REACHED(); | 1842 NOTREACHED(); |
1843 break; | 1843 break; |
1844 } | 1844 } |
1845 list->append(*filterValue); | 1845 list->append(*filterValue); |
1846 } | 1846 } |
1847 | 1847 |
1848 return list; | 1848 return list; |
1849 } | 1849 } |
1850 | 1850 |
1851 CSSValue* ComputedStyleCSSValueMapping::valueForFont( | 1851 CSSValue* ComputedStyleCSSValueMapping::valueForFont( |
1852 const ComputedStyle& style) { | 1852 const ComputedStyle& style) { |
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2425 switch (style.getGridAutoFlow()) { | 2425 switch (style.getGridAutoFlow()) { |
2426 case AutoFlowRow: | 2426 case AutoFlowRow: |
2427 case AutoFlowRowDense: | 2427 case AutoFlowRowDense: |
2428 list->append(*CSSIdentifierValue::create(CSSValueRow)); | 2428 list->append(*CSSIdentifierValue::create(CSSValueRow)); |
2429 break; | 2429 break; |
2430 case AutoFlowColumn: | 2430 case AutoFlowColumn: |
2431 case AutoFlowColumnDense: | 2431 case AutoFlowColumnDense: |
2432 list->append(*CSSIdentifierValue::create(CSSValueColumn)); | 2432 list->append(*CSSIdentifierValue::create(CSSValueColumn)); |
2433 break; | 2433 break; |
2434 default: | 2434 default: |
2435 ASSERT_NOT_REACHED(); | 2435 NOTREACHED(); |
2436 } | 2436 } |
2437 | 2437 |
2438 switch (style.getGridAutoFlow()) { | 2438 switch (style.getGridAutoFlow()) { |
2439 case AutoFlowRowDense: | 2439 case AutoFlowRowDense: |
2440 case AutoFlowColumnDense: | 2440 case AutoFlowColumnDense: |
2441 list->append(*CSSIdentifierValue::create(CSSValueDense)); | 2441 list->append(*CSSIdentifierValue::create(CSSValueDense)); |
2442 break; | 2442 break; |
2443 default: | 2443 default: |
2444 // Do nothing. | 2444 // Do nothing. |
2445 break; | 2445 break; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2483 styledNode, allowVisitedStyle); | 2483 styledNode, allowVisitedStyle); |
2484 case CSSPropertyGridTemplate: | 2484 case CSSPropertyGridTemplate: |
2485 return valuesForGridShorthand(gridTemplateShorthand(), style, | 2485 return valuesForGridShorthand(gridTemplateShorthand(), style, |
2486 layoutObject, styledNode, | 2486 layoutObject, styledNode, |
2487 allowVisitedStyle); | 2487 allowVisitedStyle); |
2488 case CSSPropertyGrid: | 2488 case CSSPropertyGrid: |
2489 return valuesForGridShorthand(gridShorthand(), style, layoutObject, | 2489 return valuesForGridShorthand(gridShorthand(), style, layoutObject, |
2490 styledNode, allowVisitedStyle); | 2490 styledNode, allowVisitedStyle); |
2491 case CSSPropertyGridTemplateAreas: | 2491 case CSSPropertyGridTemplateAreas: |
2492 if (!style.namedGridAreaRowCount()) { | 2492 if (!style.namedGridAreaRowCount()) { |
2493 ASSERT(!style.namedGridAreaColumnCount()); | 2493 DCHECK(!style.namedGridAreaColumnCount()); |
2494 return CSSIdentifierValue::create(CSSValueNone); | 2494 return CSSIdentifierValue::create(CSSValueNone); |
2495 } | 2495 } |
2496 | 2496 |
2497 return CSSGridTemplateAreasValue::create( | 2497 return CSSGridTemplateAreasValue::create( |
2498 style.namedGridArea(), style.namedGridAreaRowCount(), | 2498 style.namedGridArea(), style.namedGridAreaRowCount(), |
2499 style.namedGridAreaColumnCount()); | 2499 style.namedGridAreaColumnCount()); |
2500 case CSSPropertyGridColumnGap: | 2500 case CSSPropertyGridColumnGap: |
2501 return zoomAdjustedPixelValueForLength(style.gridColumnGap(), style); | 2501 return zoomAdjustedPixelValueForLength(style.gridColumnGap(), style); |
2502 case CSSPropertyGridRowGap: | 2502 case CSSPropertyGridRowGap: |
2503 return zoomAdjustedPixelValueForLength(style.gridRowGap(), style); | 2503 return zoomAdjustedPixelValueForLength(style.gridRowGap(), style); |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2774 return currentColorOrValidColor(style, style.textEmphasisColor()); | 2774 return currentColorOrValidColor(style, style.textEmphasisColor()); |
2775 case CSSPropertyWebkitTextEmphasisPosition: | 2775 case CSSPropertyWebkitTextEmphasisPosition: |
2776 return CSSIdentifierValue::create(style.getTextEmphasisPosition()); | 2776 return CSSIdentifierValue::create(style.getTextEmphasisPosition()); |
2777 case CSSPropertyWebkitTextEmphasisStyle: | 2777 case CSSPropertyWebkitTextEmphasisStyle: |
2778 switch (style.getTextEmphasisMark()) { | 2778 switch (style.getTextEmphasisMark()) { |
2779 case TextEmphasisMarkNone: | 2779 case TextEmphasisMarkNone: |
2780 return CSSIdentifierValue::create(CSSValueNone); | 2780 return CSSIdentifierValue::create(CSSValueNone); |
2781 case TextEmphasisMarkCustom: | 2781 case TextEmphasisMarkCustom: |
2782 return CSSStringValue::create(style.textEmphasisCustomMark()); | 2782 return CSSStringValue::create(style.textEmphasisCustomMark()); |
2783 case TextEmphasisMarkAuto: | 2783 case TextEmphasisMarkAuto: |
2784 ASSERT_NOT_REACHED(); | 2784 NOTREACHED(); |
2785 // Fall through | 2785 // Fall through |
2786 case TextEmphasisMarkDot: | 2786 case TextEmphasisMarkDot: |
2787 case TextEmphasisMarkCircle: | 2787 case TextEmphasisMarkCircle: |
2788 case TextEmphasisMarkDoubleCircle: | 2788 case TextEmphasisMarkDoubleCircle: |
2789 case TextEmphasisMarkTriangle: | 2789 case TextEmphasisMarkTriangle: |
2790 case TextEmphasisMarkSesame: { | 2790 case TextEmphasisMarkSesame: { |
2791 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 2791 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
2792 list->append( | 2792 list->append( |
2793 *CSSIdentifierValue::create(style.getTextEmphasisFill())); | 2793 *CSSIdentifierValue::create(style.getTextEmphasisFill())); |
2794 list->append( | 2794 list->append( |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2849 case EVerticalAlign::kTop: | 2849 case EVerticalAlign::kTop: |
2850 return CSSIdentifierValue::create(CSSValueTop); | 2850 return CSSIdentifierValue::create(CSSValueTop); |
2851 case EVerticalAlign::kBottom: | 2851 case EVerticalAlign::kBottom: |
2852 return CSSIdentifierValue::create(CSSValueBottom); | 2852 return CSSIdentifierValue::create(CSSValueBottom); |
2853 case EVerticalAlign::kBaselineMiddle: | 2853 case EVerticalAlign::kBaselineMiddle: |
2854 return CSSIdentifierValue::create(CSSValueWebkitBaselineMiddle); | 2854 return CSSIdentifierValue::create(CSSValueWebkitBaselineMiddle); |
2855 case EVerticalAlign::kLength: | 2855 case EVerticalAlign::kLength: |
2856 return zoomAdjustedPixelValueForLength(style.getVerticalAlignLength(), | 2856 return zoomAdjustedPixelValueForLength(style.getVerticalAlignLength(), |
2857 style); | 2857 style); |
2858 } | 2858 } |
2859 ASSERT_NOT_REACHED(); | 2859 NOTREACHED(); |
2860 return nullptr; | 2860 return nullptr; |
2861 case CSSPropertyVisibility: | 2861 case CSSPropertyVisibility: |
2862 return CSSIdentifierValue::create(style.visibility()); | 2862 return CSSIdentifierValue::create(style.visibility()); |
2863 case CSSPropertyWhiteSpace: | 2863 case CSSPropertyWhiteSpace: |
2864 return CSSIdentifierValue::create(style.whiteSpace()); | 2864 return CSSIdentifierValue::create(style.whiteSpace()); |
2865 case CSSPropertyWidows: | 2865 case CSSPropertyWidows: |
2866 return CSSPrimitiveValue::create(style.widows(), | 2866 return CSSPrimitiveValue::create(style.widows(), |
2867 CSSPrimitiveValue::UnitType::Number); | 2867 CSSPrimitiveValue::UnitType::Number); |
2868 case CSSPropertyWidth: | 2868 case CSSPropertyWidth: |
2869 if (layoutObject) { | 2869 if (layoutObject) { |
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3411 case CSSPropertyWebkitPaddingEnd: | 3411 case CSSPropertyWebkitPaddingEnd: |
3412 case CSSPropertyWebkitPaddingStart: | 3412 case CSSPropertyWebkitPaddingStart: |
3413 case CSSPropertyWebkitPaddingAfter: | 3413 case CSSPropertyWebkitPaddingAfter: |
3414 case CSSPropertyWebkitPaddingBefore: | 3414 case CSSPropertyWebkitPaddingBefore: |
3415 case CSSPropertyWebkitLogicalWidth: | 3415 case CSSPropertyWebkitLogicalWidth: |
3416 case CSSPropertyWebkitLogicalHeight: | 3416 case CSSPropertyWebkitLogicalHeight: |
3417 case CSSPropertyWebkitMinLogicalWidth: | 3417 case CSSPropertyWebkitMinLogicalWidth: |
3418 case CSSPropertyWebkitMinLogicalHeight: | 3418 case CSSPropertyWebkitMinLogicalHeight: |
3419 case CSSPropertyWebkitMaxLogicalWidth: | 3419 case CSSPropertyWebkitMaxLogicalWidth: |
3420 case CSSPropertyWebkitMaxLogicalHeight: | 3420 case CSSPropertyWebkitMaxLogicalHeight: |
3421 ASSERT_NOT_REACHED(); | 3421 NOTREACHED(); |
3422 return nullptr; | 3422 return nullptr; |
3423 | 3423 |
3424 // Unimplemented @font-face properties. | 3424 // Unimplemented @font-face properties. |
3425 case CSSPropertySrc: | 3425 case CSSPropertySrc: |
3426 case CSSPropertyUnicodeRange: | 3426 case CSSPropertyUnicodeRange: |
3427 return nullptr; | 3427 return nullptr; |
3428 | 3428 |
3429 // Other unimplemented properties. | 3429 // Other unimplemented properties. |
3430 case CSSPropertyPage: // for @page | 3430 case CSSPropertyPage: // for @page |
3431 case CSSPropertySize: // for @page | 3431 case CSSPropertySize: // for @page |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3533 case CSSPropertyBaselineShift: { | 3533 case CSSPropertyBaselineShift: { |
3534 switch (svgStyle.baselineShift()) { | 3534 switch (svgStyle.baselineShift()) { |
3535 case BS_SUPER: | 3535 case BS_SUPER: |
3536 return CSSIdentifierValue::create(CSSValueSuper); | 3536 return CSSIdentifierValue::create(CSSValueSuper); |
3537 case BS_SUB: | 3537 case BS_SUB: |
3538 return CSSIdentifierValue::create(CSSValueSub); | 3538 return CSSIdentifierValue::create(CSSValueSub); |
3539 case BS_LENGTH: | 3539 case BS_LENGTH: |
3540 return zoomAdjustedPixelValueForLength(svgStyle.baselineShiftValue(), | 3540 return zoomAdjustedPixelValueForLength(svgStyle.baselineShiftValue(), |
3541 style); | 3541 style); |
3542 } | 3542 } |
3543 ASSERT_NOT_REACHED(); | 3543 NOTREACHED(); |
3544 return nullptr; | 3544 return nullptr; |
3545 } | 3545 } |
3546 case CSSPropertyBufferedRendering: | 3546 case CSSPropertyBufferedRendering: |
3547 return CSSIdentifierValue::create(svgStyle.bufferedRendering()); | 3547 return CSSIdentifierValue::create(svgStyle.bufferedRendering()); |
3548 case CSSPropertyPaintOrder: | 3548 case CSSPropertyPaintOrder: |
3549 return paintOrderToCSSValueList(svgStyle); | 3549 return paintOrderToCSSValueList(svgStyle); |
3550 case CSSPropertyVectorEffect: | 3550 case CSSPropertyVectorEffect: |
3551 return CSSIdentifierValue::create(svgStyle.vectorEffect()); | 3551 return CSSIdentifierValue::create(svgStyle.vectorEffect()); |
3552 case CSSPropertyMaskType: | 3552 case CSSPropertyMaskType: |
3553 return CSSIdentifierValue::create(svgStyle.maskType()); | 3553 return CSSIdentifierValue::create(svgStyle.maskType()); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3658 | 3658 |
3659 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 3659 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
3660 if (style.containsStyle()) | 3660 if (style.containsStyle()) |
3661 list->append(*CSSIdentifierValue::create(CSSValueStyle)); | 3661 list->append(*CSSIdentifierValue::create(CSSValueStyle)); |
3662 if (style.contain() & ContainsLayout) | 3662 if (style.contain() & ContainsLayout) |
3663 list->append(*CSSIdentifierValue::create(CSSValueLayout)); | 3663 list->append(*CSSIdentifierValue::create(CSSValueLayout)); |
3664 if (style.containsPaint()) | 3664 if (style.containsPaint()) |
3665 list->append(*CSSIdentifierValue::create(CSSValuePaint)); | 3665 list->append(*CSSIdentifierValue::create(CSSValuePaint)); |
3666 if (style.containsSize()) | 3666 if (style.containsSize()) |
3667 list->append(*CSSIdentifierValue::create(CSSValueSize)); | 3667 list->append(*CSSIdentifierValue::create(CSSValueSize)); |
3668 ASSERT(list->length()); | 3668 DCHECK(list->length()); |
3669 return list; | 3669 return list; |
3670 } | 3670 } |
3671 case CSSPropertyVariable: | 3671 case CSSPropertyVariable: |
3672 // Variables are retrieved via get(AtomicString). | 3672 // Variables are retrieved via get(AtomicString). |
3673 ASSERT_NOT_REACHED(); | 3673 NOTREACHED(); |
3674 return nullptr; | 3674 return nullptr; |
3675 case CSSPropertyAll: | 3675 case CSSPropertyAll: |
3676 return nullptr; | 3676 return nullptr; |
3677 default: | 3677 default: |
3678 break; | 3678 break; |
3679 } | 3679 } |
3680 ASSERT_NOT_REACHED(); | 3680 NOTREACHED(); |
3681 return nullptr; | 3681 return nullptr; |
3682 } | 3682 } |
3683 | 3683 |
3684 } // namespace blink | 3684 } // namespace blink |
OLD | NEW |