Chromium Code Reviews| 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 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1114 case TextDecorationStyleDashed: | 1114 case TextDecorationStyleDashed: |
| 1115 return CSSIdentifierValue::create(CSSValueDashed); | 1115 return CSSIdentifierValue::create(CSSValueDashed); |
| 1116 case TextDecorationStyleWavy: | 1116 case TextDecorationStyleWavy: |
| 1117 return CSSIdentifierValue::create(CSSValueWavy); | 1117 return CSSIdentifierValue::create(CSSValueWavy); |
| 1118 } | 1118 } |
| 1119 | 1119 |
| 1120 ASSERT_NOT_REACHED(); | 1120 ASSERT_NOT_REACHED(); |
| 1121 return CSSInitialValue::create(); | 1121 return CSSInitialValue::create(); |
| 1122 } | 1122 } |
| 1123 | 1123 |
| 1124 static CSSValue* valueForTextDecorationSkip( | |
| 1125 TextDecorationSkip textDecorationSkip) { | |
| 1126 CSSValueList* list = CSSValueList::createSpaceSeparated(); | |
| 1127 if (textDecorationSkip & TextDecorationSkipObjects) | |
| 1128 list->append(*CSSIdentifierValue::create(CSSValueObjects)); | |
| 1129 if (textDecorationSkip & TextDecorationSkipInk) | |
| 1130 list->append(*CSSIdentifierValue::create(CSSValueInk)); | |
| 1131 | |
| 1132 if (!list->length()) | |
| 1133 return CSSIdentifierValue::create(CSSValueObjects); | |
|
Timothy Loh
2016/10/11 00:00:33
Maybe better to DCHECK(list->length()) for now ins
drott
2016/10/11 07:15:27
Done.
| |
| 1134 return list; | |
| 1135 } | |
| 1136 | |
| 1124 static CSSValue* touchActionFlagsToCSSValue(TouchAction touchAction) { | 1137 static CSSValue* touchActionFlagsToCSSValue(TouchAction touchAction) { |
| 1125 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 1138 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
| 1126 if (touchAction == TouchActionAuto) { | 1139 if (touchAction == TouchActionAuto) { |
| 1127 list->append(*CSSIdentifierValue::create(CSSValueAuto)); | 1140 list->append(*CSSIdentifierValue::create(CSSValueAuto)); |
| 1128 } else if (touchAction == TouchActionNone) { | 1141 } else if (touchAction == TouchActionNone) { |
| 1129 list->append(*CSSIdentifierValue::create(CSSValueNone)); | 1142 list->append(*CSSIdentifierValue::create(CSSValueNone)); |
| 1130 } else if (touchAction == TouchActionManipulation) { | 1143 } else if (touchAction == TouchActionManipulation) { |
| 1131 list->append(*CSSIdentifierValue::create(CSSValueManipulation)); | 1144 list->append(*CSSIdentifierValue::create(CSSValueManipulation)); |
| 1132 } else { | 1145 } else { |
| 1133 if ((touchAction & TouchActionPanX) == TouchActionPanX) | 1146 if ((touchAction & TouchActionPanX) == TouchActionPanX) |
| (...skipping 1533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2667 case CSSPropertyTextAlignLast: | 2680 case CSSPropertyTextAlignLast: |
| 2668 return CSSIdentifierValue::create(style.getTextAlignLast()); | 2681 return CSSIdentifierValue::create(style.getTextAlignLast()); |
| 2669 case CSSPropertyTextDecoration: | 2682 case CSSPropertyTextDecoration: |
| 2670 if (RuntimeEnabledFeatures::css3TextDecorationsEnabled()) | 2683 if (RuntimeEnabledFeatures::css3TextDecorationsEnabled()) |
| 2671 return valuesForShorthandProperty(textDecorationShorthand(), style, | 2684 return valuesForShorthandProperty(textDecorationShorthand(), style, |
| 2672 layoutObject, styledNode, | 2685 layoutObject, styledNode, |
| 2673 allowVisitedStyle); | 2686 allowVisitedStyle); |
| 2674 // Fall through. | 2687 // Fall through. |
| 2675 case CSSPropertyTextDecorationLine: | 2688 case CSSPropertyTextDecorationLine: |
| 2676 return renderTextDecorationFlagsToCSSValue(style.getTextDecoration()); | 2689 return renderTextDecorationFlagsToCSSValue(style.getTextDecoration()); |
| 2690 case CSSPropertyTextDecorationSkip: | |
| 2691 return valueForTextDecorationSkip(style.getTextDecorationSkip()); | |
| 2677 case CSSPropertyTextDecorationStyle: | 2692 case CSSPropertyTextDecorationStyle: |
| 2678 return valueForTextDecorationStyle(style.getTextDecorationStyle()); | 2693 return valueForTextDecorationStyle(style.getTextDecorationStyle()); |
| 2679 case CSSPropertyTextDecorationColor: | 2694 case CSSPropertyTextDecorationColor: |
| 2680 return currentColorOrValidColor(style, style.textDecorationColor()); | 2695 return currentColorOrValidColor(style, style.textDecorationColor()); |
| 2681 case CSSPropertyTextJustify: | 2696 case CSSPropertyTextJustify: |
| 2682 return CSSIdentifierValue::create(style.getTextJustify()); | 2697 return CSSIdentifierValue::create(style.getTextJustify()); |
| 2683 case CSSPropertyTextUnderlinePosition: | 2698 case CSSPropertyTextUnderlinePosition: |
| 2684 return CSSIdentifierValue::create(style.getTextUnderlinePosition()); | 2699 return CSSIdentifierValue::create(style.getTextUnderlinePosition()); |
| 2685 case CSSPropertyWebkitTextDecorationsInEffect: | 2700 case CSSPropertyWebkitTextDecorationsInEffect: |
| 2686 return renderTextDecorationFlagsToCSSValue( | 2701 return renderTextDecorationFlagsToCSSValue( |
| (...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3599 case CSSPropertyAll: | 3614 case CSSPropertyAll: |
| 3600 return nullptr; | 3615 return nullptr; |
| 3601 default: | 3616 default: |
| 3602 break; | 3617 break; |
| 3603 } | 3618 } |
| 3604 ASSERT_NOT_REACHED(); | 3619 ASSERT_NOT_REACHED(); |
| 3605 return nullptr; | 3620 return nullptr; |
| 3606 } | 3621 } |
| 3607 | 3622 |
| 3608 } // namespace blink | 3623 } // namespace blink |
| OLD | NEW |