Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Side by Side Diff: third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h

Issue 2702173002: Generate mappings between CSSValueID and ComputedStyle enums. (Closed)
Patch Set: Forgot case Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Alexey Proskuryakov <ap@nypop.com>. 2 * Copyright (C) 2007 Alexey Proskuryakov <ap@nypop.com>.
3 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
4 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. 4 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved.
5 * (http://www.torchmobile.com/) 5 * (http://www.torchmobile.com/)
6 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com> 6 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com>
7 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 7 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
(...skipping 29 matching lines...) Expand all
40 #include "core/style/ComputedStyleConstants.h" 40 #include "core/style/ComputedStyleConstants.h"
41 #include "core/style/LineClampValue.h" 41 #include "core/style/LineClampValue.h"
42 #include "core/style/SVGComputedStyleDefs.h" 42 #include "core/style/SVGComputedStyleDefs.h"
43 #include "platform/Length.h" 43 #include "platform/Length.h"
44 #include "platform/ThemeTypes.h" 44 #include "platform/ThemeTypes.h"
45 #include "platform/fonts/FontDescription.h" 45 #include "platform/fonts/FontDescription.h"
46 #include "platform/fonts/FontSmoothingMode.h" 46 #include "platform/fonts/FontSmoothingMode.h"
47 #include "platform/fonts/TextRenderingMode.h" 47 #include "platform/fonts/TextRenderingMode.h"
48 #include "platform/graphics/GraphicsTypes.h" 48 #include "platform/graphics/GraphicsTypes.h"
49 #include "platform/scroll/ScrollableArea.h" 49 #include "platform/scroll/ScrollableArea.h"
50 #include "platform/text/TextDirection.h"
51 #include "platform/text/TextRun.h" 50 #include "platform/text/TextRun.h"
52 #include "platform/text/UnicodeBidi.h"
53 #include "platform/text/WritingMode.h" 51 #include "platform/text/WritingMode.h"
54 #include "public/platform/WebBlendMode.h" 52 #include "public/platform/WebBlendMode.h"
55 #include "wtf/MathExtras.h" 53 #include "wtf/MathExtras.h"
56 54
57 namespace blink { 55 namespace blink {
58 56
59 // TODO(sashab): Move these to CSSPrimitiveValue.h. 57 // TODO(sashab): Move these to CSSPrimitiveValue.h.
60 template <> 58 template <>
61 inline short CSSPrimitiveValue::convertTo() const { 59 inline short CSSPrimitiveValue::convertTo() const {
62 ASSERT(isNumber()); 60 ASSERT(isNumber());
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 return ColumnSpanAll; 186 return ColumnSpanAll;
189 default: 187 default:
190 ASSERT_NOT_REACHED(); 188 ASSERT_NOT_REACHED();
191 // fall-through 189 // fall-through
192 case CSSValueNone: 190 case CSSValueNone:
193 return ColumnSpanNone; 191 return ColumnSpanNone;
194 } 192 }
195 } 193 }
196 194
197 template <> 195 template <>
198 inline CSSIdentifierValue::CSSIdentifierValue(EPrintColorAdjust value)
199 : CSSValue(IdentifierClass) {
200 switch (value) {
201 case EPrintColorAdjust::kExact:
202 m_valueID = CSSValueExact;
203 break;
204 case EPrintColorAdjust::kEconomy:
205 m_valueID = CSSValueEconomy;
206 break;
207 }
208 }
209
210 template <>
211 inline EPrintColorAdjust CSSIdentifierValue::convertTo() const {
212 switch (m_valueID) {
213 case CSSValueEconomy:
214 return EPrintColorAdjust::kEconomy;
215 case CSSValueExact:
216 return EPrintColorAdjust::kExact;
217 default:
218 break;
219 }
220
221 ASSERT_NOT_REACHED();
222 return EPrintColorAdjust::kEconomy;
223 }
224
225 template <>
226 inline CSSIdentifierValue::CSSIdentifierValue(EBorderStyle e) 196 inline CSSIdentifierValue::CSSIdentifierValue(EBorderStyle e)
227 : CSSValue(IdentifierClass) { 197 : CSSValue(IdentifierClass) {
228 switch (e) { 198 switch (e) {
229 case BorderStyleNone: 199 case BorderStyleNone:
230 m_valueID = CSSValueNone; 200 m_valueID = CSSValueNone;
231 break; 201 break;
232 case BorderStyleHidden: 202 case BorderStyleHidden:
233 m_valueID = CSSValueHidden; 203 m_valueID = CSSValueHidden;
234 break; 204 break;
235 case BorderStyleInset: 205 case BorderStyleInset:
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
830 return EBoxSizing::kContentBox; 800 return EBoxSizing::kContentBox;
831 default: 801 default:
832 break; 802 break;
833 } 803 }
834 804
835 ASSERT_NOT_REACHED(); 805 ASSERT_NOT_REACHED();
836 return EBoxSizing::kBorderBox; 806 return EBoxSizing::kBorderBox;
837 } 807 }
838 808
839 template <> 809 template <>
840 inline CSSIdentifierValue::CSSIdentifierValue(EBoxDirection e)
841 : CSSValue(IdentifierClass) {
842 switch (e) {
843 case EBoxDirection::kNormal:
844 m_valueID = CSSValueNormal;
845 break;
846 case EBoxDirection::kReverse:
847 m_valueID = CSSValueReverse;
848 break;
849 }
850 }
851
852 template <>
853 inline EBoxDirection CSSIdentifierValue::convertTo() const {
854 switch (m_valueID) {
855 case CSSValueNormal:
856 return EBoxDirection::kNormal;
857 case CSSValueReverse:
858 return EBoxDirection::kReverse;
859 default:
860 break;
861 }
862
863 ASSERT_NOT_REACHED();
864 return EBoxDirection::kNormal;
865 }
866
867 template <>
868 inline CSSIdentifierValue::CSSIdentifierValue(EBoxLines e) 810 inline CSSIdentifierValue::CSSIdentifierValue(EBoxLines e)
869 : CSSValue(IdentifierClass) { 811 : CSSValue(IdentifierClass) {
870 switch (e) { 812 switch (e) {
871 case SINGLE: 813 case SINGLE:
872 m_valueID = CSSValueSingle; 814 m_valueID = CSSValueSingle;
873 break; 815 break;
874 case MULTIPLE: 816 case MULTIPLE:
875 m_valueID = CSSValueMultiple; 817 m_valueID = CSSValueMultiple;
876 break; 818 break;
877 } 819 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
916 return VERTICAL; 858 return VERTICAL;
917 default: 859 default:
918 break; 860 break;
919 } 861 }
920 862
921 ASSERT_NOT_REACHED(); 863 ASSERT_NOT_REACHED();
922 return HORIZONTAL; 864 return HORIZONTAL;
923 } 865 }
924 866
925 template <> 867 template <>
926 inline CSSIdentifierValue::CSSIdentifierValue(ECaptionSide e)
927 : CSSValue(IdentifierClass) {
928 switch (e) {
929 case ECaptionSide::kLeft:
930 m_valueID = CSSValueLeft;
931 break;
932 case ECaptionSide::kRight:
933 m_valueID = CSSValueRight;
934 break;
935 case ECaptionSide::kTop:
936 m_valueID = CSSValueTop;
937 break;
938 case ECaptionSide::kBottom:
939 m_valueID = CSSValueBottom;
940 break;
941 }
942 }
943
944 template <>
945 inline ECaptionSide CSSIdentifierValue::convertTo() const {
946 switch (m_valueID) {
947 case CSSValueLeft:
948 return ECaptionSide::kLeft;
949 case CSSValueRight:
950 return ECaptionSide::kRight;
951 case CSSValueTop:
952 return ECaptionSide::kTop;
953 case CSSValueBottom:
954 return ECaptionSide::kBottom;
955 default:
956 break;
957 }
958
959 ASSERT_NOT_REACHED();
960 return ECaptionSide::kTop;
961 }
962
963 template <>
964 inline CSSIdentifierValue::CSSIdentifierValue(EClear e)
965 : CSSValue(IdentifierClass) {
966 switch (e) {
967 case EClear::kNone:
968 m_valueID = CSSValueNone;
969 break;
970 case EClear::kLeft:
971 m_valueID = CSSValueLeft;
972 break;
973 case EClear::kRight:
974 m_valueID = CSSValueRight;
975 break;
976 case EClear::kBoth:
977 m_valueID = CSSValueBoth;
978 break;
979 }
980 }
981
982 template <>
983 inline EClear CSSIdentifierValue::convertTo() const {
984 switch (m_valueID) {
985 case CSSValueNone:
986 return EClear::kNone;
987 case CSSValueLeft:
988 return EClear::kLeft;
989 case CSSValueRight:
990 return EClear::kRight;
991 case CSSValueBoth:
992 return EClear::kBoth;
993 default:
994 break;
995 }
996
997 ASSERT_NOT_REACHED();
998 return EClear::kNone;
999 }
1000
1001 template <>
1002 inline CSSIdentifierValue::CSSIdentifierValue(ECursor e) 868 inline CSSIdentifierValue::CSSIdentifierValue(ECursor e)
1003 : CSSValue(IdentifierClass) { 869 : CSSValue(IdentifierClass) {
1004 switch (e) { 870 switch (e) {
1005 case ECursor::kAuto: 871 case ECursor::kAuto:
1006 m_valueID = CSSValueAuto; 872 m_valueID = CSSValueAuto;
1007 break; 873 break;
1008 case ECursor::kCrosshair: 874 case ECursor::kCrosshair:
1009 m_valueID = CSSValueCrosshair; 875 m_valueID = CSSValueCrosshair;
1010 break; 876 break;
1011 case ECursor::kDefault: 877 case ECursor::kDefault:
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
1324 case CSSValueNone: 1190 case CSSValueNone:
1325 return EDisplay::None; 1191 return EDisplay::None;
1326 break; 1192 break;
1327 default: 1193 default:
1328 NOTREACHED(); 1194 NOTREACHED();
1329 return EDisplay::None; 1195 return EDisplay::None;
1330 } 1196 }
1331 } 1197 }
1332 1198
1333 template <> 1199 template <>
1334 inline CSSIdentifierValue::CSSIdentifierValue(EEmptyCells e)
1335 : CSSValue(IdentifierClass) {
1336 switch (e) {
1337 case EEmptyCells::kShow:
1338 m_valueID = CSSValueShow;
1339 break;
1340 case EEmptyCells::kHide:
1341 m_valueID = CSSValueHide;
1342 break;
1343 }
1344 }
1345
1346 template <>
1347 inline EEmptyCells CSSIdentifierValue::convertTo() const {
1348 switch (m_valueID) {
1349 case CSSValueShow:
1350 return EEmptyCells::kShow;
1351 case CSSValueHide:
1352 return EEmptyCells::kHide;
1353 default:
1354 break;
1355 }
1356
1357 ASSERT_NOT_REACHED();
1358 return EEmptyCells::kShow;
1359 }
1360
1361 template <>
1362 inline CSSIdentifierValue::CSSIdentifierValue(EFlexDirection e) 1200 inline CSSIdentifierValue::CSSIdentifierValue(EFlexDirection e)
1363 : CSSValue(IdentifierClass) { 1201 : CSSValue(IdentifierClass) {
1364 switch (e) { 1202 switch (e) {
1365 case FlowRow: 1203 case FlowRow:
1366 m_valueID = CSSValueRow; 1204 m_valueID = CSSValueRow;
1367 break; 1205 break;
1368 case FlowRowReverse: 1206 case FlowRowReverse:
1369 m_valueID = CSSValueRowReverse; 1207 m_valueID = CSSValueRowReverse;
1370 break; 1208 break;
1371 case FlowColumn: 1209 case FlowColumn:
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
1532 return LineBreakAfterWhiteSpace; 1370 return LineBreakAfterWhiteSpace;
1533 default: 1371 default:
1534 break; 1372 break;
1535 } 1373 }
1536 1374
1537 ASSERT_NOT_REACHED(); 1375 ASSERT_NOT_REACHED();
1538 return LineBreakAuto; 1376 return LineBreakAuto;
1539 } 1377 }
1540 1378
1541 template <> 1379 template <>
1542 inline CSSIdentifierValue::CSSIdentifierValue(EListStylePosition e)
1543 : CSSValue(IdentifierClass) {
1544 switch (e) {
1545 case EListStylePosition::kOutside:
1546 m_valueID = CSSValueOutside;
1547 break;
1548 case EListStylePosition::kInside:
1549 m_valueID = CSSValueInside;
1550 break;
1551 }
1552 }
1553
1554 template <>
1555 inline EListStylePosition CSSIdentifierValue::convertTo() const {
1556 switch (m_valueID) {
1557 case CSSValueOutside:
1558 return EListStylePosition::kOutside;
1559 case CSSValueInside:
1560 return EListStylePosition::kInside;
1561 default:
1562 break;
1563 }
1564
1565 ASSERT_NOT_REACHED();
1566 return EListStylePosition::kOutside;
1567 }
1568
1569 template <>
1570 inline CSSIdentifierValue::CSSIdentifierValue(EListStyleType e)
1571 : CSSValue(IdentifierClass) {
1572 switch (e) {
1573 case EListStyleType::kArabicIndic:
1574 m_valueID = CSSValueArabicIndic;
1575 break;
1576 case EListStyleType::kArmenian:
1577 m_valueID = CSSValueArmenian;
1578 break;
1579 case EListStyleType::kBengali:
1580 m_valueID = CSSValueBengali;
1581 break;
1582 case EListStyleType::kCambodian:
1583 m_valueID = CSSValueCambodian;
1584 break;
1585 case EListStyleType::kCircle:
1586 m_valueID = CSSValueCircle;
1587 break;
1588 case EListStyleType::kCjkEarthlyBranch:
1589 m_valueID = CSSValueCjkEarthlyBranch;
1590 break;
1591 case EListStyleType::kCjkHeavenlyStem:
1592 m_valueID = CSSValueCjkHeavenlyStem;
1593 break;
1594 case EListStyleType::kCjkIdeographic:
1595 m_valueID = CSSValueCjkIdeographic;
1596 break;
1597 case EListStyleType::kDecimalLeadingZero:
1598 m_valueID = CSSValueDecimalLeadingZero;
1599 break;
1600 case EListStyleType::kDecimal:
1601 m_valueID = CSSValueDecimal;
1602 break;
1603 case EListStyleType::kDevanagari:
1604 m_valueID = CSSValueDevanagari;
1605 break;
1606 case EListStyleType::kDisc:
1607 m_valueID = CSSValueDisc;
1608 break;
1609 case EListStyleType::kEthiopicHalehame:
1610 m_valueID = CSSValueEthiopicHalehame;
1611 break;
1612 case EListStyleType::kEthiopicHalehameAm:
1613 m_valueID = CSSValueEthiopicHalehameAm;
1614 break;
1615 case EListStyleType::kEthiopicHalehameTiEt:
1616 m_valueID = CSSValueEthiopicHalehameTiEt;
1617 break;
1618 case EListStyleType::kEthiopicHalehameTiEr:
1619 m_valueID = CSSValueEthiopicHalehameTiEr;
1620 break;
1621 case EListStyleType::kGeorgian:
1622 m_valueID = CSSValueGeorgian;
1623 break;
1624 case EListStyleType::kGujarati:
1625 m_valueID = CSSValueGujarati;
1626 break;
1627 case EListStyleType::kGurmukhi:
1628 m_valueID = CSSValueGurmukhi;
1629 break;
1630 case EListStyleType::kHangul:
1631 m_valueID = CSSValueHangul;
1632 break;
1633 case EListStyleType::kHangulConsonant:
1634 m_valueID = CSSValueHangulConsonant;
1635 break;
1636 case EListStyleType::kKoreanHangulFormal:
1637 m_valueID = CSSValueKoreanHangulFormal;
1638 break;
1639 case EListStyleType::kKoreanHanjaFormal:
1640 m_valueID = CSSValueKoreanHanjaFormal;
1641 break;
1642 case EListStyleType::kKoreanHanjaInformal:
1643 m_valueID = CSSValueKoreanHanjaInformal;
1644 break;
1645 case EListStyleType::kHebrew:
1646 m_valueID = CSSValueHebrew;
1647 break;
1648 case EListStyleType::kHiragana:
1649 m_valueID = CSSValueHiragana;
1650 break;
1651 case EListStyleType::kHiraganaIroha:
1652 m_valueID = CSSValueHiraganaIroha;
1653 break;
1654 case EListStyleType::kKannada:
1655 m_valueID = CSSValueKannada;
1656 break;
1657 case EListStyleType::kKatakana:
1658 m_valueID = CSSValueKatakana;
1659 break;
1660 case EListStyleType::kKatakanaIroha:
1661 m_valueID = CSSValueKatakanaIroha;
1662 break;
1663 case EListStyleType::kKhmer:
1664 m_valueID = CSSValueKhmer;
1665 break;
1666 case EListStyleType::kLao:
1667 m_valueID = CSSValueLao;
1668 break;
1669 case EListStyleType::kLowerAlpha:
1670 m_valueID = CSSValueLowerAlpha;
1671 break;
1672 case EListStyleType::kLowerArmenian:
1673 m_valueID = CSSValueLowerArmenian;
1674 break;
1675 case EListStyleType::kLowerGreek:
1676 m_valueID = CSSValueLowerGreek;
1677 break;
1678 case EListStyleType::kLowerLatin:
1679 m_valueID = CSSValueLowerLatin;
1680 break;
1681 case EListStyleType::kLowerRoman:
1682 m_valueID = CSSValueLowerRoman;
1683 break;
1684 case EListStyleType::kMalayalam:
1685 m_valueID = CSSValueMalayalam;
1686 break;
1687 case EListStyleType::kMongolian:
1688 m_valueID = CSSValueMongolian;
1689 break;
1690 case EListStyleType::kMyanmar:
1691 m_valueID = CSSValueMyanmar;
1692 break;
1693 case EListStyleType::kNone:
1694 m_valueID = CSSValueNone;
1695 break;
1696 case EListStyleType::kOriya:
1697 m_valueID = CSSValueOriya;
1698 break;
1699 case EListStyleType::kPersian:
1700 m_valueID = CSSValuePersian;
1701 break;
1702 case EListStyleType::kSimpChineseFormal:
1703 m_valueID = CSSValueSimpChineseFormal;
1704 break;
1705 case EListStyleType::kSimpChineseInformal:
1706 m_valueID = CSSValueSimpChineseInformal;
1707 break;
1708 case EListStyleType::kSquare:
1709 m_valueID = CSSValueSquare;
1710 break;
1711 case EListStyleType::kTelugu:
1712 m_valueID = CSSValueTelugu;
1713 break;
1714 case EListStyleType::kThai:
1715 m_valueID = CSSValueThai;
1716 break;
1717 case EListStyleType::kTibetan:
1718 m_valueID = CSSValueTibetan;
1719 break;
1720 case EListStyleType::kTradChineseFormal:
1721 m_valueID = CSSValueTradChineseFormal;
1722 break;
1723 case EListStyleType::kTradChineseInformal:
1724 m_valueID = CSSValueTradChineseInformal;
1725 break;
1726 case EListStyleType::kUpperAlpha:
1727 m_valueID = CSSValueUpperAlpha;
1728 break;
1729 case EListStyleType::kUpperArmenian:
1730 m_valueID = CSSValueUpperArmenian;
1731 break;
1732 case EListStyleType::kUpperLatin:
1733 m_valueID = CSSValueUpperLatin;
1734 break;
1735 case EListStyleType::kUpperRoman:
1736 m_valueID = CSSValueUpperRoman;
1737 break;
1738 case EListStyleType::kUrdu:
1739 m_valueID = CSSValueUrdu;
1740 break;
1741 }
1742 }
1743
1744 template <>
1745 inline EListStyleType CSSIdentifierValue::convertTo() const {
1746 switch (m_valueID) {
1747 case CSSValueNone:
1748 return EListStyleType::kNone;
1749 case CSSValueArabicIndic:
1750 return EListStyleType::kArabicIndic;
1751 case CSSValueArmenian:
1752 return EListStyleType::kArmenian;
1753 case CSSValueBengali:
1754 return EListStyleType::kBengali;
1755 case CSSValueCambodian:
1756 return EListStyleType::kCambodian;
1757 case CSSValueCircle:
1758 return EListStyleType::kCircle;
1759 case CSSValueCjkEarthlyBranch:
1760 return EListStyleType::kCjkEarthlyBranch;
1761 case CSSValueCjkHeavenlyStem:
1762 return EListStyleType::kCjkHeavenlyStem;
1763 case CSSValueCjkIdeographic:
1764 return EListStyleType::kCjkIdeographic;
1765 case CSSValueDecimalLeadingZero:
1766 return EListStyleType::kDecimalLeadingZero;
1767 case CSSValueDecimal:
1768 return EListStyleType::kDecimal;
1769 case CSSValueDevanagari:
1770 return EListStyleType::kDevanagari;
1771 case CSSValueDisc:
1772 return EListStyleType::kDisc;
1773 case CSSValueEthiopicHalehame:
1774 return EListStyleType::kEthiopicHalehame;
1775 case CSSValueEthiopicHalehameAm:
1776 return EListStyleType::kEthiopicHalehameAm;
1777 case CSSValueEthiopicHalehameTiEt:
1778 return EListStyleType::kEthiopicHalehameTiEt;
1779 case CSSValueEthiopicHalehameTiEr:
1780 return EListStyleType::kEthiopicHalehameTiEr;
1781 case CSSValueGeorgian:
1782 return EListStyleType::kGeorgian;
1783 case CSSValueGujarati:
1784 return EListStyleType::kGujarati;
1785 case CSSValueGurmukhi:
1786 return EListStyleType::kGurmukhi;
1787 case CSSValueHangul:
1788 return EListStyleType::kHangul;
1789 case CSSValueHangulConsonant:
1790 return EListStyleType::kHangulConsonant;
1791 case CSSValueKoreanHangulFormal:
1792 return EListStyleType::kKoreanHangulFormal;
1793 case CSSValueKoreanHanjaFormal:
1794 return EListStyleType::kKoreanHanjaFormal;
1795 case CSSValueKoreanHanjaInformal:
1796 return EListStyleType::kKoreanHanjaInformal;
1797 case CSSValueHebrew:
1798 return EListStyleType::kHebrew;
1799 case CSSValueHiragana:
1800 return EListStyleType::kHiragana;
1801 case CSSValueHiraganaIroha:
1802 return EListStyleType::kHiraganaIroha;
1803 case CSSValueKannada:
1804 return EListStyleType::kKannada;
1805 case CSSValueKatakana:
1806 return EListStyleType::kKatakana;
1807 case CSSValueKatakanaIroha:
1808 return EListStyleType::kKatakanaIroha;
1809 case CSSValueKhmer:
1810 return EListStyleType::kKhmer;
1811 case CSSValueLao:
1812 return EListStyleType::kLao;
1813 case CSSValueLowerAlpha:
1814 return EListStyleType::kLowerAlpha;
1815 case CSSValueLowerArmenian:
1816 return EListStyleType::kLowerArmenian;
1817 case CSSValueLowerGreek:
1818 return EListStyleType::kLowerGreek;
1819 case CSSValueLowerLatin:
1820 return EListStyleType::kLowerLatin;
1821 case CSSValueLowerRoman:
1822 return EListStyleType::kLowerRoman;
1823 case CSSValueMalayalam:
1824 return EListStyleType::kMalayalam;
1825 case CSSValueMongolian:
1826 return EListStyleType::kMongolian;
1827 case CSSValueMyanmar:
1828 return EListStyleType::kMyanmar;
1829 case CSSValueOriya:
1830 return EListStyleType::kOriya;
1831 case CSSValuePersian:
1832 return EListStyleType::kPersian;
1833 case CSSValueSimpChineseFormal:
1834 return EListStyleType::kSimpChineseFormal;
1835 case CSSValueSimpChineseInformal:
1836 return EListStyleType::kSimpChineseInformal;
1837 case CSSValueSquare:
1838 return EListStyleType::kSquare;
1839 case CSSValueTelugu:
1840 return EListStyleType::kTelugu;
1841 case CSSValueThai:
1842 return EListStyleType::kThai;
1843 case CSSValueTibetan:
1844 return EListStyleType::kTibetan;
1845 case CSSValueTradChineseFormal:
1846 return EListStyleType::kTradChineseFormal;
1847 case CSSValueTradChineseInformal:
1848 return EListStyleType::kTradChineseInformal;
1849 case CSSValueUpperAlpha:
1850 return EListStyleType::kUpperAlpha;
1851 case CSSValueUpperArmenian:
1852 return EListStyleType::kUpperArmenian;
1853 case CSSValueUpperLatin:
1854 return EListStyleType::kUpperLatin;
1855 case CSSValueUpperRoman:
1856 return EListStyleType::kUpperRoman;
1857 case CSSValueUrdu:
1858 return EListStyleType::kUrdu;
1859 default:
1860 break;
1861 }
1862
1863 NOTREACHED();
1864 return EListStyleType::kNone;
1865 }
1866
1867 template <>
1868 inline CSSIdentifierValue::CSSIdentifierValue(EMarginCollapse e) 1380 inline CSSIdentifierValue::CSSIdentifierValue(EMarginCollapse e)
1869 : CSSValue(IdentifierClass) { 1381 : CSSValue(IdentifierClass) {
1870 switch (e) { 1382 switch (e) {
1871 case MarginCollapseCollapse: 1383 case MarginCollapseCollapse:
1872 m_valueID = CSSValueCollapse; 1384 m_valueID = CSSValueCollapse;
1873 break; 1385 break;
1874 case MarginCollapseSeparate: 1386 case MarginCollapseSeparate:
1875 m_valueID = CSSValueSeparate; 1387 m_valueID = CSSValueSeparate;
1876 break; 1388 break;
1877 case MarginCollapseDiscard: 1389 case MarginCollapseDiscard:
1878 m_valueID = CSSValueDiscard; 1390 m_valueID = CSSValueDiscard;
1879 break; 1391 break;
1880 } 1392 }
1881 } 1393 }
1882 1394
1883 template <> 1395 template <>
1884 inline EMarginCollapse CSSIdentifierValue::convertTo() const { 1396 inline EMarginCollapse CSSIdentifierValue::convertTo() const {
1885 switch (m_valueID) { 1397 switch (m_valueID) {
1886 case CSSValueCollapse: 1398 case CSSValueCollapse:
1887 return MarginCollapseCollapse; 1399 return MarginCollapseCollapse;
1888 case CSSValueSeparate: 1400 case CSSValueSeparate:
1889 return MarginCollapseSeparate; 1401 return MarginCollapseSeparate;
1890 case CSSValueDiscard: 1402 case CSSValueDiscard:
1891 return MarginCollapseDiscard; 1403 return MarginCollapseDiscard;
1892 default: 1404 default:
1893 break; 1405 break;
1894 } 1406 }
1895 1407
1896 ASSERT_NOT_REACHED(); 1408 NOTREACHED();
1897 return MarginCollapseCollapse; 1409 return MarginCollapseCollapse;
1898 } 1410 }
1899 1411
1900 template <> 1412 template <>
1901 inline CSSIdentifierValue::CSSIdentifierValue(EOverflow e)
1902 : CSSValue(IdentifierClass) {
1903 switch (e) {
1904 case EOverflow::kVisible:
1905 m_valueID = CSSValueVisible;
1906 break;
1907 case EOverflow::kHidden:
1908 m_valueID = CSSValueHidden;
1909 break;
1910 case EOverflow::kScroll:
1911 m_valueID = CSSValueScroll;
1912 break;
1913 case EOverflow::kAuto:
1914 m_valueID = CSSValueAuto;
1915 break;
1916 case EOverflow::kOverlay:
1917 m_valueID = CSSValueOverlay;
1918 break;
1919 case EOverflow::kWebkitPagedX:
1920 m_valueID = CSSValueWebkitPagedX;
1921 break;
1922 case EOverflow::kWebkitPagedY:
1923 m_valueID = CSSValueWebkitPagedY;
1924 break;
1925 }
1926 }
1927
1928 template <>
1929 inline EOverflow CSSIdentifierValue::convertTo() const {
1930 switch (m_valueID) {
1931 case CSSValueVisible:
1932 return EOverflow::kVisible;
1933 case CSSValueHidden:
1934 return EOverflow::kHidden;
1935 case CSSValueScroll:
1936 return EOverflow::kScroll;
1937 case CSSValueAuto:
1938 return EOverflow::kAuto;
1939 case CSSValueOverlay:
1940 return EOverflow::kOverlay;
1941 case CSSValueWebkitPagedX:
1942 return EOverflow::kWebkitPagedX;
1943 case CSSValueWebkitPagedY:
1944 return EOverflow::kWebkitPagedY;
1945 default:
1946 break;
1947 }
1948
1949 ASSERT_NOT_REACHED();
1950 return EOverflow::kVisible;
1951 }
1952
1953 template <>
1954 inline CSSIdentifierValue::CSSIdentifierValue(EBreakBetween e)
1955 : CSSValue(IdentifierClass) {
1956 switch (e) {
1957 default:
1958 ASSERT_NOT_REACHED();
1959 case EBreakBetween::kAuto:
1960 m_valueID = CSSValueAuto;
1961 break;
1962 case EBreakBetween::kAvoid:
1963 m_valueID = CSSValueAvoid;
1964 break;
1965 case EBreakBetween::kAvoidColumn:
1966 m_valueID = CSSValueAvoidColumn;
1967 break;
1968 case EBreakBetween::kAvoidPage:
1969 m_valueID = CSSValueAvoidPage;
1970 break;
1971 case EBreakBetween::kColumn:
1972 m_valueID = CSSValueColumn;
1973 break;
1974 case EBreakBetween::kLeft:
1975 m_valueID = CSSValueLeft;
1976 break;
1977 case EBreakBetween::kPage:
1978 m_valueID = CSSValuePage;
1979 break;
1980 case EBreakBetween::kRecto:
1981 m_valueID = CSSValueRecto;
1982 break;
1983 case EBreakBetween::kRight:
1984 m_valueID = CSSValueRight;
1985 break;
1986 case EBreakBetween::kVerso:
1987 m_valueID = CSSValueVerso;
1988 break;
1989 }
1990 }
1991
1992 template <>
1993 inline EBreakBetween CSSIdentifierValue::convertTo() const {
1994 switch (m_valueID) {
1995 default:
1996 ASSERT_NOT_REACHED();
1997 case CSSValueAuto:
1998 return EBreakBetween::kAuto;
1999 case CSSValueAvoid:
2000 return EBreakBetween::kAvoid;
2001 case CSSValueAvoidColumn:
2002 return EBreakBetween::kAvoidColumn;
2003 case CSSValueAvoidPage:
2004 return EBreakBetween::kAvoidPage;
2005 case CSSValueColumn:
2006 return EBreakBetween::kColumn;
2007 case CSSValueLeft:
2008 return EBreakBetween::kLeft;
2009 case CSSValuePage:
2010 return EBreakBetween::kPage;
2011 case CSSValueRecto:
2012 return EBreakBetween::kRecto;
2013 case CSSValueRight:
2014 return EBreakBetween::kRight;
2015 case CSSValueVerso:
2016 return EBreakBetween::kVerso;
2017 }
2018 }
2019
2020 template <>
2021 inline CSSIdentifierValue::CSSIdentifierValue(EBreakInside e)
2022 : CSSValue(IdentifierClass) {
2023 switch (e) {
2024 default:
2025 NOTREACHED();
2026 case EBreakInside::kAuto:
2027 m_valueID = CSSValueAuto;
2028 break;
2029 case EBreakInside::kAvoid:
2030 m_valueID = CSSValueAvoid;
2031 break;
2032 case EBreakInside::kAvoidColumn:
2033 m_valueID = CSSValueAvoidColumn;
2034 break;
2035 case EBreakInside::kAvoidPage:
2036 m_valueID = CSSValueAvoidPage;
2037 break;
2038 }
2039 }
2040
2041 template <>
2042 inline EBreakInside CSSIdentifierValue::convertTo() const {
2043 switch (m_valueID) {
2044 default:
2045 NOTREACHED();
2046 case CSSValueAuto:
2047 return EBreakInside::kAuto;
2048 case CSSValueAvoid:
2049 return EBreakInside::kAvoid;
2050 case CSSValueAvoidColumn:
2051 return EBreakInside::kAvoidColumn;
2052 case CSSValueAvoidPage:
2053 return EBreakInside::kAvoidPage;
2054 }
2055 }
2056
2057 template <>
2058 inline CSSIdentifierValue::CSSIdentifierValue(EPosition e) 1413 inline CSSIdentifierValue::CSSIdentifierValue(EPosition e)
2059 : CSSValue(IdentifierClass) { 1414 : CSSValue(IdentifierClass) {
2060 switch (e) { 1415 switch (e) {
2061 case EPosition::kStatic: 1416 case EPosition::kStatic:
2062 m_valueID = CSSValueStatic; 1417 m_valueID = CSSValueStatic;
2063 break; 1418 break;
2064 case EPosition::kRelative: 1419 case EPosition::kRelative:
2065 m_valueID = CSSValueRelative; 1420 m_valueID = CSSValueRelative;
2066 break; 1421 break;
2067 case EPosition::kAbsolute: 1422 case EPosition::kAbsolute:
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
2161 return ETableLayout::kAuto; 1516 return ETableLayout::kAuto;
2162 default: 1517 default:
2163 break; 1518 break;
2164 } 1519 }
2165 1520
2166 ASSERT_NOT_REACHED(); 1521 ASSERT_NOT_REACHED();
2167 return ETableLayout::kAuto; 1522 return ETableLayout::kAuto;
2168 } 1523 }
2169 1524
2170 template <> 1525 template <>
2171 inline CSSIdentifierValue::CSSIdentifierValue(ETextAlign e)
2172 : CSSValue(IdentifierClass) {
2173 switch (e) {
2174 case ETextAlign::kStart:
2175 m_valueID = CSSValueStart;
2176 break;
2177 case ETextAlign::kEnd:
2178 m_valueID = CSSValueEnd;
2179 break;
2180 case ETextAlign::kLeft:
2181 m_valueID = CSSValueLeft;
2182 break;
2183 case ETextAlign::kRight:
2184 m_valueID = CSSValueRight;
2185 break;
2186 case ETextAlign::kCenter:
2187 m_valueID = CSSValueCenter;
2188 break;
2189 case ETextAlign::kJustify:
2190 m_valueID = CSSValueJustify;
2191 break;
2192 case ETextAlign::kWebkitLeft:
2193 m_valueID = CSSValueWebkitLeft;
2194 break;
2195 case ETextAlign::kWebkitRight:
2196 m_valueID = CSSValueWebkitRight;
2197 break;
2198 case ETextAlign::kWebkitCenter:
2199 m_valueID = CSSValueWebkitCenter;
2200 break;
2201 }
2202 }
2203
2204 template <>
2205 inline ETextAlign CSSIdentifierValue::convertTo() const {
2206 switch (m_valueID) {
2207 case CSSValueWebkitAuto: // Legacy -webkit-auto. Eqiuvalent to start.
2208 case CSSValueStart:
2209 return ETextAlign::kStart;
2210 case CSSValueEnd:
2211 return ETextAlign::kEnd;
2212 case CSSValueCenter:
2213 case CSSValueInternalCenter:
2214 return ETextAlign::kCenter;
2215 case CSSValueLeft:
2216 return ETextAlign::kLeft;
2217 case CSSValueRight:
2218 return ETextAlign::kRight;
2219 case CSSValueJustify:
2220 return ETextAlign::kJustify;
2221 case CSSValueWebkitLeft:
2222 return ETextAlign::kWebkitLeft;
2223 case CSSValueWebkitRight:
2224 return ETextAlign::kWebkitRight;
2225 case CSSValueWebkitCenter:
2226 return ETextAlign::kWebkitCenter;
2227 default:
2228 NOTREACHED();
2229 return ETextAlign::kLeft;
2230 }
2231 }
2232
2233 template <>
2234 inline CSSIdentifierValue::CSSIdentifierValue(TextAlignLast e) 1526 inline CSSIdentifierValue::CSSIdentifierValue(TextAlignLast e)
2235 : CSSValue(IdentifierClass) { 1527 : CSSValue(IdentifierClass) {
2236 switch (e) { 1528 switch (e) {
2237 case TextAlignLastStart: 1529 case TextAlignLastStart:
2238 m_valueID = CSSValueStart; 1530 m_valueID = CSSValueStart;
2239 break; 1531 break;
2240 case TextAlignLastEnd: 1532 case TextAlignLastEnd:
2241 m_valueID = CSSValueEnd; 1533 m_valueID = CSSValueEnd;
2242 break; 1534 break;
2243 case TextAlignLastLeft: 1535 case TextAlignLastLeft:
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
2442 return TSSQUARE; 1734 return TSSQUARE;
2443 default: 1735 default:
2444 break; 1736 break;
2445 } 1737 }
2446 1738
2447 ASSERT_NOT_REACHED(); 1739 ASSERT_NOT_REACHED();
2448 return TSNONE; 1740 return TSNONE;
2449 } 1741 }
2450 1742
2451 template <> 1743 template <>
2452 inline CSSIdentifierValue::CSSIdentifierValue(ETextTransform e)
2453 : CSSValue(IdentifierClass) {
2454 switch (e) {
2455 case ETextTransform::kCapitalize:
2456 m_valueID = CSSValueCapitalize;
2457 break;
2458 case ETextTransform::kUppercase:
2459 m_valueID = CSSValueUppercase;
2460 break;
2461 case ETextTransform::kLowercase:
2462 m_valueID = CSSValueLowercase;
2463 break;
2464 case ETextTransform::kNone:
2465 m_valueID = CSSValueNone;
2466 break;
2467 }
2468 }
2469
2470 template <>
2471 inline ETextTransform CSSIdentifierValue::convertTo() const {
2472 switch (m_valueID) {
2473 case CSSValueCapitalize:
2474 return ETextTransform::kCapitalize;
2475 case CSSValueUppercase:
2476 return ETextTransform::kUppercase;
2477 case CSSValueLowercase:
2478 return ETextTransform::kLowercase;
2479 case CSSValueNone:
2480 return ETextTransform::kNone;
2481 default:
2482 break;
2483 }
2484
2485 ASSERT_NOT_REACHED();
2486 return ETextTransform::kNone;
2487 }
2488
2489 template <>
2490 inline CSSIdentifierValue::CSSIdentifierValue(UnicodeBidi e)
2491 : CSSValue(IdentifierClass) {
2492 switch (e) {
2493 case UnicodeBidi::kNormal:
2494 m_valueID = CSSValueNormal;
2495 break;
2496 case UnicodeBidi::kEmbed:
2497 m_valueID = CSSValueEmbed;
2498 break;
2499 case UnicodeBidi::kBidiOverride:
2500 m_valueID = CSSValueBidiOverride;
2501 break;
2502 case UnicodeBidi::kIsolate:
2503 m_valueID = CSSValueIsolate;
2504 break;
2505 case UnicodeBidi::kIsolateOverride:
2506 m_valueID = CSSValueIsolateOverride;
2507 break;
2508 case UnicodeBidi::kPlaintext:
2509 m_valueID = CSSValuePlaintext;
2510 break;
2511 }
2512 }
2513
2514 template <>
2515 inline UnicodeBidi CSSIdentifierValue::convertTo() const {
2516 switch (m_valueID) {
2517 case CSSValueNormal:
2518 return UnicodeBidi::kNormal;
2519 case CSSValueEmbed:
2520 return UnicodeBidi::kEmbed;
2521 case CSSValueBidiOverride:
2522 return UnicodeBidi::kBidiOverride;
2523 case CSSValueIsolate:
2524 case CSSValueWebkitIsolate:
2525 return UnicodeBidi::kIsolate;
2526 case CSSValueIsolateOverride:
2527 case CSSValueWebkitIsolateOverride:
2528 return UnicodeBidi::kIsolateOverride;
2529 case CSSValuePlaintext:
2530 case CSSValueWebkitPlaintext:
2531 return UnicodeBidi::kPlaintext;
2532 default:
2533 break;
2534 }
2535
2536 ASSERT_NOT_REACHED();
2537 return UnicodeBidi::kNormal;
2538 }
2539
2540 template <>
2541 inline CSSIdentifierValue::CSSIdentifierValue(EUserDrag e) 1744 inline CSSIdentifierValue::CSSIdentifierValue(EUserDrag e)
2542 : CSSValue(IdentifierClass) { 1745 : CSSValue(IdentifierClass) {
2543 switch (e) { 1746 switch (e) {
2544 case DRAG_AUTO: 1747 case DRAG_AUTO:
2545 m_valueID = CSSValueAuto; 1748 m_valueID = CSSValueAuto;
2546 break; 1749 break;
2547 case DRAG_NONE: 1750 case DRAG_NONE:
2548 m_valueID = CSSValueNone; 1751 m_valueID = CSSValueNone;
2549 break; 1752 break;
2550 case DRAG_ELEMENT: 1753 case DRAG_ELEMENT:
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
2699 return EVerticalAlign::kBaselineMiddle; 1902 return EVerticalAlign::kBaselineMiddle;
2700 default: 1903 default:
2701 break; 1904 break;
2702 } 1905 }
2703 1906
2704 ASSERT_NOT_REACHED(); 1907 ASSERT_NOT_REACHED();
2705 return EVerticalAlign::kTop; 1908 return EVerticalAlign::kTop;
2706 } 1909 }
2707 1910
2708 template <> 1911 template <>
2709 inline CSSIdentifierValue::CSSIdentifierValue(EVisibility e)
2710 : CSSValue(IdentifierClass) {
2711 switch (e) {
2712 case EVisibility::kVisible:
2713 m_valueID = CSSValueVisible;
2714 break;
2715 case EVisibility::kHidden:
2716 m_valueID = CSSValueHidden;
2717 break;
2718 case EVisibility::kCollapse:
2719 m_valueID = CSSValueCollapse;
2720 break;
2721 }
2722 }
2723
2724 template <>
2725 inline EVisibility CSSIdentifierValue::convertTo() const {
2726 switch (m_valueID) {
2727 case CSSValueHidden:
2728 return EVisibility::kHidden;
2729 case CSSValueVisible:
2730 return EVisibility::kVisible;
2731 case CSSValueCollapse:
2732 return EVisibility::kCollapse;
2733 default:
2734 break;
2735 }
2736
2737 ASSERT_NOT_REACHED();
2738 return EVisibility::kVisible;
2739 }
2740
2741 template <>
2742 inline CSSIdentifierValue::CSSIdentifierValue(EWhiteSpace e)
2743 : CSSValue(IdentifierClass) {
2744 switch (e) {
2745 case EWhiteSpace::kNormal:
2746 m_valueID = CSSValueNormal;
2747 break;
2748 case EWhiteSpace::kPre:
2749 m_valueID = CSSValuePre;
2750 break;
2751 case EWhiteSpace::kPreWrap:
2752 m_valueID = CSSValuePreWrap;
2753 break;
2754 case EWhiteSpace::kPreLine:
2755 m_valueID = CSSValuePreLine;
2756 break;
2757 case EWhiteSpace::kNowrap:
2758 m_valueID = CSSValueNowrap;
2759 break;
2760 case EWhiteSpace::kWebkitNowrap:
2761 m_valueID = CSSValueWebkitNowrap;
2762 break;
2763 }
2764 }
2765
2766 template <>
2767 inline EWhiteSpace CSSIdentifierValue::convertTo() const {
2768 switch (m_valueID) {
2769 case CSSValueWebkitNowrap:
2770 return EWhiteSpace::kWebkitNowrap;
2771 case CSSValueNowrap:
2772 return EWhiteSpace::kNowrap;
2773 case CSSValuePre:
2774 return EWhiteSpace::kPre;
2775 case CSSValuePreWrap:
2776 return EWhiteSpace::kPreWrap;
2777 case CSSValuePreLine:
2778 return EWhiteSpace::kPreLine;
2779 case CSSValueNormal:
2780 return EWhiteSpace::kNormal;
2781 default:
2782 break;
2783 }
2784
2785 ASSERT_NOT_REACHED();
2786 return EWhiteSpace::kNormal;
2787 }
2788
2789 template <>
2790 inline CSSIdentifierValue::CSSIdentifierValue(EWordBreak e) 1912 inline CSSIdentifierValue::CSSIdentifierValue(EWordBreak e)
2791 : CSSValue(IdentifierClass) { 1913 : CSSValue(IdentifierClass) {
2792 switch (e) { 1914 switch (e) {
2793 case NormalWordBreak: 1915 case NormalWordBreak:
2794 m_valueID = CSSValueNormal; 1916 m_valueID = CSSValueNormal;
2795 break; 1917 break;
2796 case BreakAllWordBreak: 1918 case BreakAllWordBreak:
2797 m_valueID = CSSValueBreakAll; 1919 m_valueID = CSSValueBreakAll;
2798 break; 1920 break;
2799 case BreakWordBreak: 1921 case BreakWordBreak:
(...skipping 18 matching lines...) Expand all
2818 return KeepAllWordBreak; 1940 return KeepAllWordBreak;
2819 default: 1941 default:
2820 break; 1942 break;
2821 } 1943 }
2822 1944
2823 ASSERT_NOT_REACHED(); 1945 ASSERT_NOT_REACHED();
2824 return NormalWordBreak; 1946 return NormalWordBreak;
2825 } 1947 }
2826 1948
2827 template <> 1949 template <>
2828 inline CSSIdentifierValue::CSSIdentifierValue(EOverflowAnchor e)
2829 : CSSValue(IdentifierClass) {
2830 switch (e) {
2831 case EOverflowAnchor::kVisible:
2832 m_valueID = CSSValueVisible;
2833 break;
2834 case EOverflowAnchor::kNone:
2835 m_valueID = CSSValueNone;
2836 break;
2837 case EOverflowAnchor::kAuto:
2838 m_valueID = CSSValueAuto;
2839 break;
2840 }
2841 }
2842
2843 template <>
2844 inline EOverflowAnchor CSSIdentifierValue::convertTo() const {
2845 switch (m_valueID) {
2846 case CSSValueVisible:
2847 return EOverflowAnchor::kVisible;
2848 case CSSValueNone:
2849 return EOverflowAnchor::kNone;
2850 case CSSValueAuto:
2851 return EOverflowAnchor::kAuto;
2852 default:
2853 break;
2854 }
2855
2856 NOTREACHED();
2857 return EOverflowAnchor::kNone;
2858 }
2859
2860 template <>
2861 inline CSSIdentifierValue::CSSIdentifierValue(EOverflowWrap e) 1950 inline CSSIdentifierValue::CSSIdentifierValue(EOverflowWrap e)
2862 : CSSValue(IdentifierClass) { 1951 : CSSValue(IdentifierClass) {
2863 switch (e) { 1952 switch (e) {
2864 case NormalOverflowWrap: 1953 case NormalOverflowWrap:
2865 m_valueID = CSSValueNormal; 1954 m_valueID = CSSValueNormal;
2866 break; 1955 break;
2867 case BreakOverflowWrap: 1956 case BreakOverflowWrap:
2868 m_valueID = CSSValueBreakWord; 1957 m_valueID = CSSValueBreakWord;
2869 break; 1958 break;
2870 } 1959 }
2871 } 1960 }
2872 1961
2873 template <> 1962 template <>
2874 inline EOverflowWrap CSSIdentifierValue::convertTo() const { 1963 inline EOverflowWrap CSSIdentifierValue::convertTo() const {
2875 switch (m_valueID) { 1964 switch (m_valueID) {
2876 case CSSValueBreakWord: 1965 case CSSValueBreakWord:
2877 return BreakOverflowWrap; 1966 return BreakOverflowWrap;
2878 case CSSValueNormal: 1967 case CSSValueNormal:
2879 return NormalOverflowWrap; 1968 return NormalOverflowWrap;
2880 default: 1969 default:
2881 break; 1970 break;
2882 } 1971 }
2883 1972
2884 ASSERT_NOT_REACHED(); 1973 ASSERT_NOT_REACHED();
2885 return NormalOverflowWrap; 1974 return NormalOverflowWrap;
2886 } 1975 }
2887 1976
2888 template <> 1977 template <>
2889 inline CSSIdentifierValue::CSSIdentifierValue(TextDirection e)
2890 : CSSValue(IdentifierClass) {
2891 switch (e) {
2892 case TextDirection::kLtr:
2893 m_valueID = CSSValueLtr;
2894 break;
2895 case TextDirection::kRtl:
2896 m_valueID = CSSValueRtl;
2897 break;
2898 }
2899 }
2900
2901 template <>
2902 inline TextDirection CSSIdentifierValue::convertTo() const {
2903 switch (m_valueID) {
2904 case CSSValueLtr:
2905 return TextDirection::kLtr;
2906 case CSSValueRtl:
2907 return TextDirection::kRtl;
2908 default:
2909 break;
2910 }
2911
2912 ASSERT_NOT_REACHED();
2913 return TextDirection::kLtr;
2914 }
2915
2916 template <>
2917 inline CSSIdentifierValue::CSSIdentifierValue(WritingMode e)
2918 : CSSValue(IdentifierClass) {
2919 switch (e) {
2920 case WritingMode::kHorizontalTb:
2921 m_valueID = CSSValueHorizontalTb;
2922 break;
2923 case WritingMode::kVerticalRl:
2924 m_valueID = CSSValueVerticalRl;
2925 break;
2926 case WritingMode::kVerticalLr:
2927 m_valueID = CSSValueVerticalLr;
2928 break;
2929 }
2930 }
2931
2932 template <>
2933 inline WritingMode CSSIdentifierValue::convertTo() const {
2934 switch (m_valueID) {
2935 case CSSValueHorizontalTb:
2936 case CSSValueLr:
2937 case CSSValueLrTb:
2938 case CSSValueRl:
2939 case CSSValueRlTb:
2940 return WritingMode::kHorizontalTb;
2941 case CSSValueVerticalRl:
2942 case CSSValueTb:
2943 case CSSValueTbRl:
2944 return WritingMode::kVerticalRl;
2945 case CSSValueVerticalLr:
2946 return WritingMode::kVerticalLr;
2947 default:
2948 break;
2949 }
2950
2951 ASSERT_NOT_REACHED();
2952 return WritingMode::kHorizontalTb;
2953 }
2954
2955 template <>
2956 inline CSSIdentifierValue::CSSIdentifierValue(TextCombine e) 1978 inline CSSIdentifierValue::CSSIdentifierValue(TextCombine e)
2957 : CSSValue(IdentifierClass) { 1979 : CSSValue(IdentifierClass) {
2958 switch (e) { 1980 switch (e) {
2959 case TextCombineNone: 1981 case TextCombineNone:
2960 m_valueID = CSSValueNone; 1982 m_valueID = CSSValueNone;
2961 break; 1983 break;
2962 case TextCombineAll: 1984 case TextCombineAll:
2963 m_valueID = CSSValueAll; 1985 m_valueID = CSSValueAll;
2964 break; 1986 break;
2965 } 1987 }
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
3173 return TextOrientationUpright; 2195 return TextOrientationUpright;
3174 default: 2196 default:
3175 break; 2197 break;
3176 } 2198 }
3177 2199
3178 ASSERT_NOT_REACHED(); 2200 ASSERT_NOT_REACHED();
3179 return TextOrientationMixed; 2201 return TextOrientationMixed;
3180 } 2202 }
3181 2203
3182 template <> 2204 template <>
3183 inline CSSIdentifierValue::CSSIdentifierValue(EPointerEvents e)
3184 : CSSValue(IdentifierClass) {
3185 switch (e) {
3186 case EPointerEvents::kNone:
3187 m_valueID = CSSValueNone;
3188 break;
3189 case EPointerEvents::kStroke:
3190 m_valueID = CSSValueStroke;
3191 break;
3192 case EPointerEvents::kFill:
3193 m_valueID = CSSValueFill;
3194 break;
3195 case EPointerEvents::kPainted:
3196 m_valueID = CSSValuePainted;
3197 break;
3198 case EPointerEvents::kVisible:
3199 m_valueID = CSSValueVisible;
3200 break;
3201 case EPointerEvents::kVisibleStroke:
3202 m_valueID = CSSValueVisibleStroke;
3203 break;
3204 case EPointerEvents::kVisibleFill:
3205 m_valueID = CSSValueVisibleFill;
3206 break;
3207 case EPointerEvents::kVisiblePainted:
3208 m_valueID = CSSValueVisiblePainted;
3209 break;
3210 case EPointerEvents::kAuto:
3211 m_valueID = CSSValueAuto;
3212 break;
3213 case EPointerEvents::kAll:
3214 m_valueID = CSSValueAll;
3215 break;
3216 case EPointerEvents::kBoundingBox:
3217 m_valueID = CSSValueBoundingBox;
3218 break;
3219 }
3220 }
3221
3222 template <>
3223 inline EPointerEvents CSSIdentifierValue::convertTo() const {
3224 switch (m_valueID) {
3225 case CSSValueAll:
3226 return EPointerEvents::kAll;
3227 case CSSValueAuto:
3228 return EPointerEvents::kAuto;
3229 case CSSValueNone:
3230 return EPointerEvents::kNone;
3231 case CSSValueVisiblePainted:
3232 return EPointerEvents::kVisiblePainted;
3233 case CSSValueVisibleFill:
3234 return EPointerEvents::kVisibleFill;
3235 case CSSValueVisibleStroke:
3236 return EPointerEvents::kVisibleStroke;
3237 case CSSValueVisible:
3238 return EPointerEvents::kVisible;
3239 case CSSValuePainted:
3240 return EPointerEvents::kPainted;
3241 case CSSValueFill:
3242 return EPointerEvents::kFill;
3243 case CSSValueStroke:
3244 return EPointerEvents::kStroke;
3245 case CSSValueBoundingBox:
3246 return EPointerEvents::kBoundingBox;
3247 default:
3248 break;
3249 }
3250
3251 ASSERT_NOT_REACHED();
3252 return EPointerEvents::kAll;
3253 }
3254
3255 template <>
3256 inline CSSIdentifierValue::CSSIdentifierValue(FontDescription::Kerning kerning) 2205 inline CSSIdentifierValue::CSSIdentifierValue(FontDescription::Kerning kerning)
3257 : CSSValue(IdentifierClass) { 2206 : CSSValue(IdentifierClass) {
3258 switch (kerning) { 2207 switch (kerning) {
3259 case FontDescription::AutoKerning: 2208 case FontDescription::AutoKerning:
3260 m_valueID = CSSValueAuto; 2209 m_valueID = CSSValueAuto;
3261 return; 2210 return;
3262 case FontDescription::NormalKerning: 2211 case FontDescription::NormalKerning:
3263 m_valueID = CSSValueNormal; 2212 m_valueID = CSSValueNormal;
3264 return; 2213 return;
3265 case FontDescription::NoneKerning: 2214 case FontDescription::NoneKerning:
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after
3938 return AB_MATHEMATICAL; 2887 return AB_MATHEMATICAL;
3939 default: 2888 default:
3940 break; 2889 break;
3941 } 2890 }
3942 2891
3943 ASSERT_NOT_REACHED(); 2892 ASSERT_NOT_REACHED();
3944 return AB_AUTO; 2893 return AB_AUTO;
3945 } 2894 }
3946 2895
3947 template <> 2896 template <>
3948 inline CSSIdentifierValue::CSSIdentifierValue(EBorderCollapse e)
3949 : CSSValue(IdentifierClass) {
3950 switch (e) {
3951 case EBorderCollapse::kSeparate:
3952 m_valueID = CSSValueSeparate;
3953 break;
3954 case EBorderCollapse::kCollapse:
3955 m_valueID = CSSValueCollapse;
3956 break;
3957 }
3958 }
3959
3960 template <>
3961 inline EBorderCollapse CSSIdentifierValue::convertTo() const {
3962 switch (m_valueID) {
3963 case CSSValueSeparate:
3964 return EBorderCollapse::kSeparate;
3965 case CSSValueCollapse:
3966 return EBorderCollapse::kCollapse;
3967 default:
3968 break;
3969 }
3970
3971 ASSERT_NOT_REACHED();
3972 return EBorderCollapse::kSeparate;
3973 }
3974
3975 template <>
3976 inline CSSIdentifierValue::CSSIdentifierValue(EImageRendering e) 2897 inline CSSIdentifierValue::CSSIdentifierValue(EImageRendering e)
3977 : CSSValue(IdentifierClass) { 2898 : CSSValue(IdentifierClass) {
3978 switch (e) { 2899 switch (e) {
3979 case ImageRenderingAuto: 2900 case ImageRenderingAuto:
3980 m_valueID = CSSValueAuto; 2901 m_valueID = CSSValueAuto;
3981 break; 2902 break;
3982 case ImageRenderingOptimizeSpeed: 2903 case ImageRenderingOptimizeSpeed:
3983 m_valueID = CSSValueOptimizeSpeed; 2904 m_valueID = CSSValueOptimizeSpeed;
3984 break; 2905 break;
3985 case ImageRenderingOptimizeQuality: 2906 case ImageRenderingOptimizeQuality:
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after
4822 default: 3743 default:
4823 break; 3744 break;
4824 } 3745 }
4825 ASSERT_NOT_REACHED(); 3746 ASSERT_NOT_REACHED();
4826 return ContainsNone; 3747 return ContainsNone;
4827 } 3748 }
4828 3749
4829 } // namespace blink 3750 } // namespace blink
4830 3751
4831 #endif 3752 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSIdentifierValue.h ('k') | third_party/WebKit/Source/core/css/CSSValueIDMappings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698