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)); |
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(result->length() > |
677 ASSERT(result->length() <= 3); | 677 0); // DCHECK_GT giving error for const unsigned long and const int |
Srirama
2017/03/16 14:22:24
remove comment here and add in review comment.
| |
678 DCHECK(result->length() <= | |
Srirama
2017/03/16 14:22:24
ditto
| |
679 3); // DCHECK_LE giving error for const unsigned long and const int | |
678 return result; | 680 return result; |
679 } | 681 } |
680 | 682 |
681 static CSSValue* valueForLineHeight(const ComputedStyle& style) { | 683 static CSSValue* valueForLineHeight(const ComputedStyle& style) { |
682 Length length = style.lineHeight(); | 684 Length length = style.lineHeight(); |
683 if (length.isNegative()) | 685 if (length.isNegative()) |
684 return CSSIdentifierValue::create(CSSValueNormal); | 686 return CSSIdentifierValue::create(CSSValueNormal); |
685 | 687 |
686 return zoomAdjustedPixelValue( | 688 return zoomAdjustedPixelValue( |
687 floatValueForLength(length, style.getFontDescription().computedSize()), | 689 floatValueForLength(length, style.getFontDescription().computedSize()), |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
885 return minMaxTrackBreadths; | 887 return minMaxTrackBreadths; |
886 } | 888 } |
887 case FitContentTrackSizing: { | 889 case FitContentTrackSizing: { |
888 auto* fitContentTrackBreadth = | 890 auto* fitContentTrackBreadth = |
889 CSSFunctionValue::create(CSSValueFitContent); | 891 CSSFunctionValue::create(CSSValueFitContent); |
890 fitContentTrackBreadth->append(*specifiedValueForGridTrackBreadth( | 892 fitContentTrackBreadth->append(*specifiedValueForGridTrackBreadth( |
891 trackSize.fitContentTrackBreadth(), style)); | 893 trackSize.fitContentTrackBreadth(), style)); |
892 return fitContentTrackBreadth; | 894 return fitContentTrackBreadth; |
893 } | 895 } |
894 } | 896 } |
895 ASSERT_NOT_REACHED(); | 897 NOTREACHED(); |
896 return nullptr; | 898 return nullptr; |
897 } | 899 } |
898 | 900 |
899 class OrderedNamedLinesCollector { | 901 class OrderedNamedLinesCollector { |
900 STACK_ALLOCATED(); | 902 STACK_ALLOCATED(); |
901 WTF_MAKE_NONCOPYABLE(OrderedNamedLinesCollector); | 903 WTF_MAKE_NONCOPYABLE(OrderedNamedLinesCollector); |
902 | 904 |
903 public: | 905 public: |
904 OrderedNamedLinesCollector(const ComputedStyle& style, | 906 OrderedNamedLinesCollector(const ComputedStyle& style, |
905 bool isRowAxis, | 907 bool isRowAxis, |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1122 case TextDecorationStyleDouble: | 1124 case TextDecorationStyleDouble: |
1123 return CSSIdentifierValue::create(CSSValueDouble); | 1125 return CSSIdentifierValue::create(CSSValueDouble); |
1124 case TextDecorationStyleDotted: | 1126 case TextDecorationStyleDotted: |
1125 return CSSIdentifierValue::create(CSSValueDotted); | 1127 return CSSIdentifierValue::create(CSSValueDotted); |
1126 case TextDecorationStyleDashed: | 1128 case TextDecorationStyleDashed: |
1127 return CSSIdentifierValue::create(CSSValueDashed); | 1129 return CSSIdentifierValue::create(CSSValueDashed); |
1128 case TextDecorationStyleWavy: | 1130 case TextDecorationStyleWavy: |
1129 return CSSIdentifierValue::create(CSSValueWavy); | 1131 return CSSIdentifierValue::create(CSSValueWavy); |
1130 } | 1132 } |
1131 | 1133 |
1132 ASSERT_NOT_REACHED(); | 1134 NOTREACHED(); |
1133 return CSSInitialValue::create(); | 1135 return CSSInitialValue::create(); |
1134 } | 1136 } |
1135 | 1137 |
1136 static CSSValue* valueForTextDecorationSkip( | 1138 static CSSValue* valueForTextDecorationSkip( |
1137 TextDecorationSkip textDecorationSkip) { | 1139 TextDecorationSkip textDecorationSkip) { |
1138 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 1140 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
1139 if (textDecorationSkip & TextDecorationSkipObjects) | 1141 if (textDecorationSkip & TextDecorationSkipObjects) |
1140 list->append(*CSSIdentifierValue::create(CSSValueObjects)); | 1142 list->append(*CSSIdentifierValue::create(CSSValueObjects)); |
1141 if (textDecorationSkip & TextDecorationSkipInk) | 1143 if (textDecorationSkip & TextDecorationSkipInk) |
1142 list->append(*CSSIdentifierValue::create(CSSValueInk)); | 1144 list->append(*CSSIdentifierValue::create(CSSValueInk)); |
(...skipping 21 matching lines...) Expand all Loading... | |
1164 list->append(*CSSIdentifierValue::create(CSSValuePanY)); | 1166 list->append(*CSSIdentifierValue::create(CSSValuePanY)); |
1165 else if (touchAction & TouchActionPanUp) | 1167 else if (touchAction & TouchActionPanUp) |
1166 list->append(*CSSIdentifierValue::create(CSSValuePanUp)); | 1168 list->append(*CSSIdentifierValue::create(CSSValuePanUp)); |
1167 else if (touchAction & TouchActionPanDown) | 1169 else if (touchAction & TouchActionPanDown) |
1168 list->append(*CSSIdentifierValue::create(CSSValuePanDown)); | 1170 list->append(*CSSIdentifierValue::create(CSSValuePanDown)); |
1169 | 1171 |
1170 if ((touchAction & TouchActionPinchZoom) == TouchActionPinchZoom) | 1172 if ((touchAction & TouchActionPinchZoom) == TouchActionPinchZoom) |
1171 list->append(*CSSIdentifierValue::create(CSSValuePinchZoom)); | 1173 list->append(*CSSIdentifierValue::create(CSSValuePinchZoom)); |
1172 } | 1174 } |
1173 | 1175 |
1174 ASSERT(list->length()); | 1176 DCHECK(list->length()); |
1175 return list; | 1177 return list; |
1176 } | 1178 } |
1177 | 1179 |
1178 static CSSValue* valueForWillChange( | 1180 static CSSValue* valueForWillChange( |
1179 const Vector<CSSPropertyID>& willChangeProperties, | 1181 const Vector<CSSPropertyID>& willChangeProperties, |
1180 bool willChangeContents, | 1182 bool willChangeContents, |
1181 bool willChangeScrollPosition) { | 1183 bool willChangeScrollPosition) { |
1182 CSSValueList* list = CSSValueList::createCommaSeparated(); | 1184 CSSValueList* list = CSSValueList::createCommaSeparated(); |
1183 if (willChangeContents) | 1185 if (willChangeContents) |
1184 list->append(*CSSIdentifierValue::create(CSSValueContents)); | 1186 list->append(*CSSIdentifierValue::create(CSSValueContents)); |
(...skipping 24 matching lines...) Expand all Loading... | |
1209 switch (direction) { | 1211 switch (direction) { |
1210 case Timing::PlaybackDirection::NORMAL: | 1212 case Timing::PlaybackDirection::NORMAL: |
1211 return CSSIdentifierValue::create(CSSValueNormal); | 1213 return CSSIdentifierValue::create(CSSValueNormal); |
1212 case Timing::PlaybackDirection::ALTERNATE_NORMAL: | 1214 case Timing::PlaybackDirection::ALTERNATE_NORMAL: |
1213 return CSSIdentifierValue::create(CSSValueAlternate); | 1215 return CSSIdentifierValue::create(CSSValueAlternate); |
1214 case Timing::PlaybackDirection::REVERSE: | 1216 case Timing::PlaybackDirection::REVERSE: |
1215 return CSSIdentifierValue::create(CSSValueReverse); | 1217 return CSSIdentifierValue::create(CSSValueReverse); |
1216 case Timing::PlaybackDirection::ALTERNATE_REVERSE: | 1218 case Timing::PlaybackDirection::ALTERNATE_REVERSE: |
1217 return CSSIdentifierValue::create(CSSValueAlternateReverse); | 1219 return CSSIdentifierValue::create(CSSValueAlternateReverse); |
1218 default: | 1220 default: |
1219 ASSERT_NOT_REACHED(); | 1221 NOTREACHED(); |
1220 return nullptr; | 1222 return nullptr; |
1221 } | 1223 } |
1222 } | 1224 } |
1223 | 1225 |
1224 static CSSValue* valueForAnimationDuration(const CSSTimingData* timingData) { | 1226 static CSSValue* valueForAnimationDuration(const CSSTimingData* timingData) { |
1225 CSSValueList* list = CSSValueList::createCommaSeparated(); | 1227 CSSValueList* list = CSSValueList::createCommaSeparated(); |
1226 if (timingData) { | 1228 if (timingData) { |
1227 for (size_t i = 0; i < timingData->durationList().size(); ++i) | 1229 for (size_t i = 0; i < timingData->durationList().size(); ++i) |
1228 list->append(*CSSPrimitiveValue::create( | 1230 list->append(*CSSPrimitiveValue::create( |
1229 timingData->durationList()[i], CSSPrimitiveValue::UnitType::Seconds)); | 1231 timingData->durationList()[i], CSSPrimitiveValue::UnitType::Seconds)); |
1230 } else { | 1232 } else { |
1231 list->append( | 1233 list->append( |
1232 *CSSPrimitiveValue::create(CSSTimingData::initialDuration(), | 1234 *CSSPrimitiveValue::create(CSSTimingData::initialDuration(), |
1233 CSSPrimitiveValue::UnitType::Seconds)); | 1235 CSSPrimitiveValue::UnitType::Seconds)); |
1234 } | 1236 } |
1235 return list; | 1237 return list; |
1236 } | 1238 } |
1237 | 1239 |
1238 static CSSValue* valueForAnimationFillMode(Timing::FillMode fillMode) { | 1240 static CSSValue* valueForAnimationFillMode(Timing::FillMode fillMode) { |
1239 switch (fillMode) { | 1241 switch (fillMode) { |
1240 case Timing::FillMode::NONE: | 1242 case Timing::FillMode::NONE: |
1241 return CSSIdentifierValue::create(CSSValueNone); | 1243 return CSSIdentifierValue::create(CSSValueNone); |
1242 case Timing::FillMode::FORWARDS: | 1244 case Timing::FillMode::FORWARDS: |
1243 return CSSIdentifierValue::create(CSSValueForwards); | 1245 return CSSIdentifierValue::create(CSSValueForwards); |
1244 case Timing::FillMode::BACKWARDS: | 1246 case Timing::FillMode::BACKWARDS: |
1245 return CSSIdentifierValue::create(CSSValueBackwards); | 1247 return CSSIdentifierValue::create(CSSValueBackwards); |
1246 case Timing::FillMode::BOTH: | 1248 case Timing::FillMode::BOTH: |
1247 return CSSIdentifierValue::create(CSSValueBoth); | 1249 return CSSIdentifierValue::create(CSSValueBoth); |
1248 default: | 1250 default: |
1249 ASSERT_NOT_REACHED(); | 1251 NOTREACHED(); |
1250 return nullptr; | 1252 return nullptr; |
1251 } | 1253 } |
1252 } | 1254 } |
1253 | 1255 |
1254 static CSSValue* valueForAnimationIterationCount(double iterationCount) { | 1256 static CSSValue* valueForAnimationIterationCount(double iterationCount) { |
1255 if (iterationCount == std::numeric_limits<double>::infinity()) | 1257 if (iterationCount == std::numeric_limits<double>::infinity()) |
1256 return CSSIdentifierValue::create(CSSValueInfinite); | 1258 return CSSIdentifierValue::create(CSSValueInfinite); |
1257 return CSSPrimitiveValue::create(iterationCount, | 1259 return CSSPrimitiveValue::create(iterationCount, |
1258 CSSPrimitiveValue::UnitType::Number); | 1260 CSSPrimitiveValue::UnitType::Number); |
1259 } | 1261 } |
1260 | 1262 |
1261 static CSSValue* valueForAnimationPlayState(EAnimPlayState playState) { | 1263 static CSSValue* valueForAnimationPlayState(EAnimPlayState playState) { |
1262 if (playState == AnimPlayStatePlaying) | 1264 if (playState == AnimPlayStatePlaying) |
1263 return CSSIdentifierValue::create(CSSValueRunning); | 1265 return CSSIdentifierValue::create(CSSValueRunning); |
1264 ASSERT(playState == AnimPlayStatePaused); | 1266 DCHECK_EQ(playState, AnimPlayStatePaused); |
1265 return CSSIdentifierValue::create(CSSValuePaused); | 1267 return CSSIdentifierValue::create(CSSValuePaused); |
1266 } | 1268 } |
1267 | 1269 |
1268 static CSSValue* createTimingFunctionValue( | 1270 static CSSValue* createTimingFunctionValue( |
1269 const TimingFunction* timingFunction) { | 1271 const TimingFunction* timingFunction) { |
1270 switch (timingFunction->getType()) { | 1272 switch (timingFunction->getType()) { |
1271 case TimingFunction::Type::CUBIC_BEZIER: { | 1273 case TimingFunction::Type::CUBIC_BEZIER: { |
1272 const CubicBezierTimingFunction* bezierTimingFunction = | 1274 const CubicBezierTimingFunction* bezierTimingFunction = |
1273 toCubicBezierTimingFunction(timingFunction); | 1275 toCubicBezierTimingFunction(timingFunction); |
1274 if (bezierTimingFunction->getEaseType() != | 1276 if (bezierTimingFunction->getEaseType() != |
1275 CubicBezierTimingFunction::EaseType::CUSTOM) { | 1277 CubicBezierTimingFunction::EaseType::CUSTOM) { |
1276 CSSValueID valueId = CSSValueInvalid; | 1278 CSSValueID valueId = CSSValueInvalid; |
1277 switch (bezierTimingFunction->getEaseType()) { | 1279 switch (bezierTimingFunction->getEaseType()) { |
1278 case CubicBezierTimingFunction::EaseType::EASE: | 1280 case CubicBezierTimingFunction::EaseType::EASE: |
1279 valueId = CSSValueEase; | 1281 valueId = CSSValueEase; |
1280 break; | 1282 break; |
1281 case CubicBezierTimingFunction::EaseType::EASE_IN: | 1283 case CubicBezierTimingFunction::EaseType::EASE_IN: |
1282 valueId = CSSValueEaseIn; | 1284 valueId = CSSValueEaseIn; |
1283 break; | 1285 break; |
1284 case CubicBezierTimingFunction::EaseType::EASE_OUT: | 1286 case CubicBezierTimingFunction::EaseType::EASE_OUT: |
1285 valueId = CSSValueEaseOut; | 1287 valueId = CSSValueEaseOut; |
1286 break; | 1288 break; |
1287 case CubicBezierTimingFunction::EaseType::EASE_IN_OUT: | 1289 case CubicBezierTimingFunction::EaseType::EASE_IN_OUT: |
1288 valueId = CSSValueEaseInOut; | 1290 valueId = CSSValueEaseInOut; |
1289 break; | 1291 break; |
1290 default: | 1292 default: |
1291 ASSERT_NOT_REACHED(); | 1293 NOTREACHED(); |
1292 return nullptr; | 1294 return nullptr; |
1293 } | 1295 } |
1294 return CSSIdentifierValue::create(valueId); | 1296 return CSSIdentifierValue::create(valueId); |
1295 } | 1297 } |
1296 return CSSCubicBezierTimingFunctionValue::create( | 1298 return CSSCubicBezierTimingFunctionValue::create( |
1297 bezierTimingFunction->x1(), bezierTimingFunction->y1(), | 1299 bezierTimingFunction->x1(), bezierTimingFunction->y1(), |
1298 bezierTimingFunction->x2(), bezierTimingFunction->y2()); | 1300 bezierTimingFunction->x2(), bezierTimingFunction->y2()); |
1299 } | 1301 } |
1300 | 1302 |
1301 case TimingFunction::Type::STEPS: { | 1303 case TimingFunction::Type::STEPS: { |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1442 | 1444 |
1443 return list; | 1445 return list; |
1444 } | 1446 } |
1445 | 1447 |
1446 static CSSValue* createTransitionPropertyValue( | 1448 static CSSValue* createTransitionPropertyValue( |
1447 const CSSTransitionData::TransitionProperty& property) { | 1449 const CSSTransitionData::TransitionProperty& property) { |
1448 if (property.propertyType == CSSTransitionData::TransitionNone) | 1450 if (property.propertyType == CSSTransitionData::TransitionNone) |
1449 return CSSIdentifierValue::create(CSSValueNone); | 1451 return CSSIdentifierValue::create(CSSValueNone); |
1450 if (property.propertyType == CSSTransitionData::TransitionUnknownProperty) | 1452 if (property.propertyType == CSSTransitionData::TransitionUnknownProperty) |
1451 return CSSCustomIdentValue::create(property.propertyString); | 1453 return CSSCustomIdentValue::create(property.propertyString); |
1452 ASSERT(property.propertyType == CSSTransitionData::TransitionKnownProperty); | 1454 DCHECK_EQ(property.propertyType, CSSTransitionData::TransitionKnownProperty); |
1453 return CSSCustomIdentValue::create( | 1455 return CSSCustomIdentValue::create( |
1454 getPropertyNameAtomicString(property.unresolvedProperty)); | 1456 getPropertyNameAtomicString(property.unresolvedProperty)); |
1455 } | 1457 } |
1456 | 1458 |
1457 static CSSValue* valueForTransitionProperty( | 1459 static CSSValue* valueForTransitionProperty( |
1458 const CSSTransitionData* transitionData) { | 1460 const CSSTransitionData* transitionData) { |
1459 CSSValueList* list = CSSValueList::createCommaSeparated(); | 1461 CSSValueList* list = CSSValueList::createCommaSeparated(); |
1460 if (transitionData) { | 1462 if (transitionData) { |
1461 for (size_t i = 0; i < transitionData->propertyList().size(); ++i) | 1463 for (size_t i = 0; i < transitionData->propertyList().size(); ++i) |
1462 list->append( | 1464 list->append( |
1463 *createTransitionPropertyValue(transitionData->propertyList()[i])); | 1465 *createTransitionPropertyValue(transitionData->propertyList()[i])); |
1464 } else { | 1466 } else { |
1465 list->append(*CSSIdentifierValue::create(CSSValueAll)); | 1467 list->append(*CSSIdentifierValue::create(CSSValueAll)); |
1466 } | 1468 } |
1467 return list; | 1469 return list; |
1468 } | 1470 } |
1469 | 1471 |
1470 CSSValueID valueForQuoteType(const QuoteType quoteType) { | 1472 CSSValueID valueForQuoteType(const QuoteType quoteType) { |
1471 switch (quoteType) { | 1473 switch (quoteType) { |
1472 case NO_OPEN_QUOTE: | 1474 case NO_OPEN_QUOTE: |
1473 return CSSValueNoOpenQuote; | 1475 return CSSValueNoOpenQuote; |
1474 case NO_CLOSE_QUOTE: | 1476 case NO_CLOSE_QUOTE: |
1475 return CSSValueNoCloseQuote; | 1477 return CSSValueNoCloseQuote; |
1476 case CLOSE_QUOTE: | 1478 case CLOSE_QUOTE: |
1477 return CSSValueCloseQuote; | 1479 return CSSValueCloseQuote; |
1478 case OPEN_QUOTE: | 1480 case OPEN_QUOTE: |
1479 return CSSValueOpenQuote; | 1481 return CSSValueOpenQuote; |
1480 } | 1482 } |
1481 ASSERT_NOT_REACHED(); | 1483 NOTREACHED(); |
1482 return CSSValueInvalid; | 1484 return CSSValueInvalid; |
1483 } | 1485 } |
1484 | 1486 |
1485 static CSSValue* valueForContentData(const ComputedStyle& style) { | 1487 static CSSValue* valueForContentData(const ComputedStyle& style) { |
1486 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 1488 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
1487 for (const ContentData* contentData = style.contentData(); contentData; | 1489 for (const ContentData* contentData = style.contentData(); contentData; |
1488 contentData = contentData->next()) { | 1490 contentData = contentData->next()) { |
1489 if (contentData->isCounter()) { | 1491 if (contentData->isCounter()) { |
1490 const CounterContent* counter = | 1492 const CounterContent* counter = |
1491 toCounterContentData(contentData)->counter(); | 1493 toCounterContentData(contentData)->counter(); |
1492 ASSERT(counter); | 1494 DCHECK(counter); |
1493 CSSCustomIdentValue* identifier = | 1495 CSSCustomIdentValue* identifier = |
1494 CSSCustomIdentValue::create(counter->identifier()); | 1496 CSSCustomIdentValue::create(counter->identifier()); |
1495 CSSStringValue* separator = CSSStringValue::create(counter->separator()); | 1497 CSSStringValue* separator = CSSStringValue::create(counter->separator()); |
1496 CSSValueID listStyleIdent = CSSValueNone; | 1498 CSSValueID listStyleIdent = CSSValueNone; |
1497 if (counter->listStyle() != EListStyleType::kNone) { | 1499 if (counter->listStyle() != EListStyleType::kNone) { |
1498 // TODO(sashab): Change this to use a converter instead of | 1500 // TODO(sashab): Change this to use a converter instead of |
1499 // CSSPrimitiveValueMappings. | 1501 // CSSPrimitiveValueMappings. |
1500 listStyleIdent = | 1502 listStyleIdent = |
1501 CSSIdentifierValue::create(counter->listStyle())->getValueID(); | 1503 CSSIdentifierValue::create(counter->listStyle())->getValueID(); |
1502 } | 1504 } |
1503 CSSIdentifierValue* listStyle = | 1505 CSSIdentifierValue* listStyle = |
1504 CSSIdentifierValue::create(listStyleIdent); | 1506 CSSIdentifierValue::create(listStyleIdent); |
1505 list->append(*CSSCounterValue::create(identifier, listStyle, separator)); | 1507 list->append(*CSSCounterValue::create(identifier, listStyle, separator)); |
1506 } else if (contentData->isImage()) { | 1508 } else if (contentData->isImage()) { |
1507 const StyleImage* image = toImageContentData(contentData)->image(); | 1509 const StyleImage* image = toImageContentData(contentData)->image(); |
1508 ASSERT(image); | 1510 DCHECK(image); |
1509 list->append(*image->computedCSSValue()); | 1511 list->append(*image->computedCSSValue()); |
1510 } else if (contentData->isText()) { | 1512 } else if (contentData->isText()) { |
1511 list->append( | 1513 list->append( |
1512 *CSSStringValue::create(toTextContentData(contentData)->text())); | 1514 *CSSStringValue::create(toTextContentData(contentData)->text())); |
1513 } else if (contentData->isQuote()) { | 1515 } else if (contentData->isQuote()) { |
1514 const QuoteType quoteType = toQuoteContentData(contentData)->quote(); | 1516 const QuoteType quoteType = toQuoteContentData(contentData)->quote(); |
1515 list->append(*CSSIdentifierValue::create(valueForQuoteType(quoteType))); | 1517 list->append(*CSSIdentifierValue::create(valueForQuoteType(quoteType))); |
1516 } else { | 1518 } else { |
1517 ASSERT_NOT_REACHED(); | 1519 NOTREACHED(); |
1518 } | 1520 } |
1519 } | 1521 } |
1520 return list; | 1522 return list; |
1521 } | 1523 } |
1522 | 1524 |
1523 static CSSValue* valueForCounterDirectives(const ComputedStyle& style, | 1525 static CSSValue* valueForCounterDirectives(const ComputedStyle& style, |
1524 CSSPropertyID propertyID) { | 1526 CSSPropertyID propertyID) { |
1525 const CounterDirectiveMap* map = style.counterDirectives(); | 1527 const CounterDirectiveMap* map = style.counterDirectives(); |
1526 if (!map) | 1528 if (!map) |
1527 return CSSIdentifierValue::create(CSSValueNone); | 1529 return CSSIdentifierValue::create(CSSValueNone); |
(...skipping 25 matching lines...) Expand all Loading... | |
1553 if (!shapeValue) | 1555 if (!shapeValue) |
1554 return CSSIdentifierValue::create(CSSValueNone); | 1556 return CSSIdentifierValue::create(CSSValueNone); |
1555 if (shapeValue->type() == ShapeValue::Box) | 1557 if (shapeValue->type() == ShapeValue::Box) |
1556 return CSSIdentifierValue::create(shapeValue->cssBox()); | 1558 return CSSIdentifierValue::create(shapeValue->cssBox()); |
1557 if (shapeValue->type() == ShapeValue::Image) { | 1559 if (shapeValue->type() == ShapeValue::Image) { |
1558 if (shapeValue->image()) | 1560 if (shapeValue->image()) |
1559 return shapeValue->image()->computedCSSValue(); | 1561 return shapeValue->image()->computedCSSValue(); |
1560 return CSSIdentifierValue::create(CSSValueNone); | 1562 return CSSIdentifierValue::create(CSSValueNone); |
1561 } | 1563 } |
1562 | 1564 |
1563 ASSERT(shapeValue->type() == ShapeValue::Shape); | 1565 DCHECK_EQ(shapeValue->type(), ShapeValue::Shape); |
1564 | 1566 |
1565 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 1567 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
1566 list->append(*valueForBasicShape(style, shapeValue->shape())); | 1568 list->append(*valueForBasicShape(style, shapeValue->shape())); |
1567 if (shapeValue->cssBox() != BoxMissing) | 1569 if (shapeValue->cssBox() != BoxMissing) |
1568 list->append(*CSSIdentifierValue::create(shapeValue->cssBox())); | 1570 list->append(*CSSIdentifierValue::create(shapeValue->cssBox())); |
1569 return list; | 1571 return list; |
1570 } | 1572 } |
1571 | 1573 |
1572 static CSSValueList* valuesForSidesShorthand( | 1574 static CSSValueList* valuesForSidesShorthand( |
1573 const StylePropertyShorthand& shorthand, | 1575 const StylePropertyShorthand& shorthand, |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1682 for (int i = 0; i < 3; i++) { | 1684 for (int i = 0; i < 3; i++) { |
1683 EPaintOrderType paintOrderType = svgStyle.paintOrderType(i); | 1685 EPaintOrderType paintOrderType = svgStyle.paintOrderType(i); |
1684 switch (paintOrderType) { | 1686 switch (paintOrderType) { |
1685 case PT_FILL: | 1687 case PT_FILL: |
1686 case PT_STROKE: | 1688 case PT_STROKE: |
1687 case PT_MARKERS: | 1689 case PT_MARKERS: |
1688 list->append(*CSSIdentifierValue::create(paintOrderType)); | 1690 list->append(*CSSIdentifierValue::create(paintOrderType)); |
1689 break; | 1691 break; |
1690 case PT_NONE: | 1692 case PT_NONE: |
1691 default: | 1693 default: |
1692 ASSERT_NOT_REACHED(); | 1694 NOTREACHED(); |
1693 break; | 1695 break; |
1694 } | 1696 } |
1695 } | 1697 } |
1696 | 1698 |
1697 return list; | 1699 return list; |
1698 } | 1700 } |
1699 | 1701 |
1700 static CSSValue* adjustSVGPaintForCurrentColor(SVGPaintType paintType, | 1702 static CSSValue* adjustSVGPaintForCurrentColor(SVGPaintType paintType, |
1701 const String& url, | 1703 const String& url, |
1702 const Color& color, | 1704 const Color& color, |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1832 const auto& dropShadowOperation = | 1834 const auto& dropShadowOperation = |
1833 toDropShadowFilterOperation(*filterOperation); | 1835 toDropShadowFilterOperation(*filterOperation); |
1834 filterValue = CSSFunctionValue::create(CSSValueDropShadow); | 1836 filterValue = CSSFunctionValue::create(CSSValueDropShadow); |
1835 // We want our computed style to look like that of a text shadow (has | 1837 // We want our computed style to look like that of a text shadow (has |
1836 // neither spread nor inset style). | 1838 // neither spread nor inset style). |
1837 filterValue->append( | 1839 filterValue->append( |
1838 *valueForShadowData(dropShadowOperation.shadow(), style, false)); | 1840 *valueForShadowData(dropShadowOperation.shadow(), style, false)); |
1839 break; | 1841 break; |
1840 } | 1842 } |
1841 default: | 1843 default: |
1842 ASSERT_NOT_REACHED(); | 1844 NOTREACHED(); |
1843 break; | 1845 break; |
1844 } | 1846 } |
1845 list->append(*filterValue); | 1847 list->append(*filterValue); |
1846 } | 1848 } |
1847 | 1849 |
1848 return list; | 1850 return list; |
1849 } | 1851 } |
1850 | 1852 |
1851 CSSValue* ComputedStyleCSSValueMapping::valueForFont( | 1853 CSSValue* ComputedStyleCSSValueMapping::valueForFont( |
1852 const ComputedStyle& style) { | 1854 const ComputedStyle& style) { |
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2425 switch (style.getGridAutoFlow()) { | 2427 switch (style.getGridAutoFlow()) { |
2426 case AutoFlowRow: | 2428 case AutoFlowRow: |
2427 case AutoFlowRowDense: | 2429 case AutoFlowRowDense: |
2428 list->append(*CSSIdentifierValue::create(CSSValueRow)); | 2430 list->append(*CSSIdentifierValue::create(CSSValueRow)); |
2429 break; | 2431 break; |
2430 case AutoFlowColumn: | 2432 case AutoFlowColumn: |
2431 case AutoFlowColumnDense: | 2433 case AutoFlowColumnDense: |
2432 list->append(*CSSIdentifierValue::create(CSSValueColumn)); | 2434 list->append(*CSSIdentifierValue::create(CSSValueColumn)); |
2433 break; | 2435 break; |
2434 default: | 2436 default: |
2435 ASSERT_NOT_REACHED(); | 2437 NOTREACHED(); |
2436 } | 2438 } |
2437 | 2439 |
2438 switch (style.getGridAutoFlow()) { | 2440 switch (style.getGridAutoFlow()) { |
2439 case AutoFlowRowDense: | 2441 case AutoFlowRowDense: |
2440 case AutoFlowColumnDense: | 2442 case AutoFlowColumnDense: |
2441 list->append(*CSSIdentifierValue::create(CSSValueDense)); | 2443 list->append(*CSSIdentifierValue::create(CSSValueDense)); |
2442 break; | 2444 break; |
2443 default: | 2445 default: |
2444 // Do nothing. | 2446 // Do nothing. |
2445 break; | 2447 break; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2483 styledNode, allowVisitedStyle); | 2485 styledNode, allowVisitedStyle); |
2484 case CSSPropertyGridTemplate: | 2486 case CSSPropertyGridTemplate: |
2485 return valuesForGridShorthand(gridTemplateShorthand(), style, | 2487 return valuesForGridShorthand(gridTemplateShorthand(), style, |
2486 layoutObject, styledNode, | 2488 layoutObject, styledNode, |
2487 allowVisitedStyle); | 2489 allowVisitedStyle); |
2488 case CSSPropertyGrid: | 2490 case CSSPropertyGrid: |
2489 return valuesForGridShorthand(gridShorthand(), style, layoutObject, | 2491 return valuesForGridShorthand(gridShorthand(), style, layoutObject, |
2490 styledNode, allowVisitedStyle); | 2492 styledNode, allowVisitedStyle); |
2491 case CSSPropertyGridTemplateAreas: | 2493 case CSSPropertyGridTemplateAreas: |
2492 if (!style.namedGridAreaRowCount()) { | 2494 if (!style.namedGridAreaRowCount()) { |
2493 ASSERT(!style.namedGridAreaColumnCount()); | 2495 DCHECK(!style.namedGridAreaColumnCount()); |
2494 return CSSIdentifierValue::create(CSSValueNone); | 2496 return CSSIdentifierValue::create(CSSValueNone); |
2495 } | 2497 } |
2496 | 2498 |
2497 return CSSGridTemplateAreasValue::create( | 2499 return CSSGridTemplateAreasValue::create( |
2498 style.namedGridArea(), style.namedGridAreaRowCount(), | 2500 style.namedGridArea(), style.namedGridAreaRowCount(), |
2499 style.namedGridAreaColumnCount()); | 2501 style.namedGridAreaColumnCount()); |
2500 case CSSPropertyGridColumnGap: | 2502 case CSSPropertyGridColumnGap: |
2501 return zoomAdjustedPixelValueForLength(style.gridColumnGap(), style); | 2503 return zoomAdjustedPixelValueForLength(style.gridColumnGap(), style); |
2502 case CSSPropertyGridRowGap: | 2504 case CSSPropertyGridRowGap: |
2503 return zoomAdjustedPixelValueForLength(style.gridRowGap(), style); | 2505 return zoomAdjustedPixelValueForLength(style.gridRowGap(), style); |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2774 return currentColorOrValidColor(style, style.textEmphasisColor()); | 2776 return currentColorOrValidColor(style, style.textEmphasisColor()); |
2775 case CSSPropertyWebkitTextEmphasisPosition: | 2777 case CSSPropertyWebkitTextEmphasisPosition: |
2776 return CSSIdentifierValue::create(style.getTextEmphasisPosition()); | 2778 return CSSIdentifierValue::create(style.getTextEmphasisPosition()); |
2777 case CSSPropertyWebkitTextEmphasisStyle: | 2779 case CSSPropertyWebkitTextEmphasisStyle: |
2778 switch (style.getTextEmphasisMark()) { | 2780 switch (style.getTextEmphasisMark()) { |
2779 case TextEmphasisMarkNone: | 2781 case TextEmphasisMarkNone: |
2780 return CSSIdentifierValue::create(CSSValueNone); | 2782 return CSSIdentifierValue::create(CSSValueNone); |
2781 case TextEmphasisMarkCustom: | 2783 case TextEmphasisMarkCustom: |
2782 return CSSStringValue::create(style.textEmphasisCustomMark()); | 2784 return CSSStringValue::create(style.textEmphasisCustomMark()); |
2783 case TextEmphasisMarkAuto: | 2785 case TextEmphasisMarkAuto: |
2784 ASSERT_NOT_REACHED(); | 2786 NOTREACHED(); |
2785 // Fall through | 2787 // Fall through |
2786 case TextEmphasisMarkDot: | 2788 case TextEmphasisMarkDot: |
2787 case TextEmphasisMarkCircle: | 2789 case TextEmphasisMarkCircle: |
2788 case TextEmphasisMarkDoubleCircle: | 2790 case TextEmphasisMarkDoubleCircle: |
2789 case TextEmphasisMarkTriangle: | 2791 case TextEmphasisMarkTriangle: |
2790 case TextEmphasisMarkSesame: { | 2792 case TextEmphasisMarkSesame: { |
2791 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 2793 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
2792 list->append( | 2794 list->append( |
2793 *CSSIdentifierValue::create(style.getTextEmphasisFill())); | 2795 *CSSIdentifierValue::create(style.getTextEmphasisFill())); |
2794 list->append( | 2796 list->append( |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2849 case EVerticalAlign::kTop: | 2851 case EVerticalAlign::kTop: |
2850 return CSSIdentifierValue::create(CSSValueTop); | 2852 return CSSIdentifierValue::create(CSSValueTop); |
2851 case EVerticalAlign::kBottom: | 2853 case EVerticalAlign::kBottom: |
2852 return CSSIdentifierValue::create(CSSValueBottom); | 2854 return CSSIdentifierValue::create(CSSValueBottom); |
2853 case EVerticalAlign::kBaselineMiddle: | 2855 case EVerticalAlign::kBaselineMiddle: |
2854 return CSSIdentifierValue::create(CSSValueWebkitBaselineMiddle); | 2856 return CSSIdentifierValue::create(CSSValueWebkitBaselineMiddle); |
2855 case EVerticalAlign::kLength: | 2857 case EVerticalAlign::kLength: |
2856 return zoomAdjustedPixelValueForLength(style.getVerticalAlignLength(), | 2858 return zoomAdjustedPixelValueForLength(style.getVerticalAlignLength(), |
2857 style); | 2859 style); |
2858 } | 2860 } |
2859 ASSERT_NOT_REACHED(); | 2861 NOTREACHED(); |
2860 return nullptr; | 2862 return nullptr; |
2861 case CSSPropertyVisibility: | 2863 case CSSPropertyVisibility: |
2862 return CSSIdentifierValue::create(style.visibility()); | 2864 return CSSIdentifierValue::create(style.visibility()); |
2863 case CSSPropertyWhiteSpace: | 2865 case CSSPropertyWhiteSpace: |
2864 return CSSIdentifierValue::create(style.whiteSpace()); | 2866 return CSSIdentifierValue::create(style.whiteSpace()); |
2865 case CSSPropertyWidows: | 2867 case CSSPropertyWidows: |
2866 return CSSPrimitiveValue::create(style.widows(), | 2868 return CSSPrimitiveValue::create(style.widows(), |
2867 CSSPrimitiveValue::UnitType::Number); | 2869 CSSPrimitiveValue::UnitType::Number); |
2868 case CSSPropertyWidth: | 2870 case CSSPropertyWidth: |
2869 if (layoutObject) { | 2871 if (layoutObject) { |
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3411 case CSSPropertyWebkitPaddingEnd: | 3413 case CSSPropertyWebkitPaddingEnd: |
3412 case CSSPropertyWebkitPaddingStart: | 3414 case CSSPropertyWebkitPaddingStart: |
3413 case CSSPropertyWebkitPaddingAfter: | 3415 case CSSPropertyWebkitPaddingAfter: |
3414 case CSSPropertyWebkitPaddingBefore: | 3416 case CSSPropertyWebkitPaddingBefore: |
3415 case CSSPropertyWebkitLogicalWidth: | 3417 case CSSPropertyWebkitLogicalWidth: |
3416 case CSSPropertyWebkitLogicalHeight: | 3418 case CSSPropertyWebkitLogicalHeight: |
3417 case CSSPropertyWebkitMinLogicalWidth: | 3419 case CSSPropertyWebkitMinLogicalWidth: |
3418 case CSSPropertyWebkitMinLogicalHeight: | 3420 case CSSPropertyWebkitMinLogicalHeight: |
3419 case CSSPropertyWebkitMaxLogicalWidth: | 3421 case CSSPropertyWebkitMaxLogicalWidth: |
3420 case CSSPropertyWebkitMaxLogicalHeight: | 3422 case CSSPropertyWebkitMaxLogicalHeight: |
3421 ASSERT_NOT_REACHED(); | 3423 NOTREACHED(); |
3422 return nullptr; | 3424 return nullptr; |
3423 | 3425 |
3424 // Unimplemented @font-face properties. | 3426 // Unimplemented @font-face properties. |
3425 case CSSPropertySrc: | 3427 case CSSPropertySrc: |
3426 case CSSPropertyUnicodeRange: | 3428 case CSSPropertyUnicodeRange: |
3427 return nullptr; | 3429 return nullptr; |
3428 | 3430 |
3429 // Other unimplemented properties. | 3431 // Other unimplemented properties. |
3430 case CSSPropertyPage: // for @page | 3432 case CSSPropertyPage: // for @page |
3431 case CSSPropertySize: // for @page | 3433 case CSSPropertySize: // for @page |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3533 case CSSPropertyBaselineShift: { | 3535 case CSSPropertyBaselineShift: { |
3534 switch (svgStyle.baselineShift()) { | 3536 switch (svgStyle.baselineShift()) { |
3535 case BS_SUPER: | 3537 case BS_SUPER: |
3536 return CSSIdentifierValue::create(CSSValueSuper); | 3538 return CSSIdentifierValue::create(CSSValueSuper); |
3537 case BS_SUB: | 3539 case BS_SUB: |
3538 return CSSIdentifierValue::create(CSSValueSub); | 3540 return CSSIdentifierValue::create(CSSValueSub); |
3539 case BS_LENGTH: | 3541 case BS_LENGTH: |
3540 return zoomAdjustedPixelValueForLength(svgStyle.baselineShiftValue(), | 3542 return zoomAdjustedPixelValueForLength(svgStyle.baselineShiftValue(), |
3541 style); | 3543 style); |
3542 } | 3544 } |
3543 ASSERT_NOT_REACHED(); | 3545 NOTREACHED(); |
3544 return nullptr; | 3546 return nullptr; |
3545 } | 3547 } |
3546 case CSSPropertyBufferedRendering: | 3548 case CSSPropertyBufferedRendering: |
3547 return CSSIdentifierValue::create(svgStyle.bufferedRendering()); | 3549 return CSSIdentifierValue::create(svgStyle.bufferedRendering()); |
3548 case CSSPropertyPaintOrder: | 3550 case CSSPropertyPaintOrder: |
3549 return paintOrderToCSSValueList(svgStyle); | 3551 return paintOrderToCSSValueList(svgStyle); |
3550 case CSSPropertyVectorEffect: | 3552 case CSSPropertyVectorEffect: |
3551 return CSSIdentifierValue::create(svgStyle.vectorEffect()); | 3553 return CSSIdentifierValue::create(svgStyle.vectorEffect()); |
3552 case CSSPropertyMaskType: | 3554 case CSSPropertyMaskType: |
3553 return CSSIdentifierValue::create(svgStyle.maskType()); | 3555 return CSSIdentifierValue::create(svgStyle.maskType()); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3658 | 3660 |
3659 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 3661 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
3660 if (style.containsStyle()) | 3662 if (style.containsStyle()) |
3661 list->append(*CSSIdentifierValue::create(CSSValueStyle)); | 3663 list->append(*CSSIdentifierValue::create(CSSValueStyle)); |
3662 if (style.contain() & ContainsLayout) | 3664 if (style.contain() & ContainsLayout) |
3663 list->append(*CSSIdentifierValue::create(CSSValueLayout)); | 3665 list->append(*CSSIdentifierValue::create(CSSValueLayout)); |
3664 if (style.containsPaint()) | 3666 if (style.containsPaint()) |
3665 list->append(*CSSIdentifierValue::create(CSSValuePaint)); | 3667 list->append(*CSSIdentifierValue::create(CSSValuePaint)); |
3666 if (style.containsSize()) | 3668 if (style.containsSize()) |
3667 list->append(*CSSIdentifierValue::create(CSSValueSize)); | 3669 list->append(*CSSIdentifierValue::create(CSSValueSize)); |
3668 ASSERT(list->length()); | 3670 DCHECK(list->length()); |
3669 return list; | 3671 return list; |
3670 } | 3672 } |
3671 case CSSPropertyVariable: | 3673 case CSSPropertyVariable: |
3672 // Variables are retrieved via get(AtomicString). | 3674 // Variables are retrieved via get(AtomicString). |
3673 ASSERT_NOT_REACHED(); | 3675 NOTREACHED(); |
3674 return nullptr; | 3676 return nullptr; |
3675 case CSSPropertyAll: | 3677 case CSSPropertyAll: |
3676 return nullptr; | 3678 return nullptr; |
3677 default: | 3679 default: |
3678 break; | 3680 break; |
3679 } | 3681 } |
3680 ASSERT_NOT_REACHED(); | 3682 NOTREACHED(); |
3681 return nullptr; | 3683 return nullptr; |
3682 } | 3684 } |
3683 | 3685 |
3684 } // namespace blink | 3686 } // namespace blink |
OLD | NEW |