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

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

Issue 2900633003: Make TextEmphasisMark an enum class. (Closed)
Patch Set: Rebase Created 3 years, 6 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1608 matching lines...) Expand 10 before | Expand all | Expand 10 after
1619 } 1619 }
1620 1620
1621 NOTREACHED(); 1621 NOTREACHED();
1622 return TextEmphasisFill::kFilled; 1622 return TextEmphasisFill::kFilled;
1623 } 1623 }
1624 1624
1625 template <> 1625 template <>
1626 inline CSSIdentifierValue::CSSIdentifierValue(TextEmphasisMark mark) 1626 inline CSSIdentifierValue::CSSIdentifierValue(TextEmphasisMark mark)
1627 : CSSValue(kIdentifierClass) { 1627 : CSSValue(kIdentifierClass) {
1628 switch (mark) { 1628 switch (mark) {
1629 case kTextEmphasisMarkDot: 1629 case TextEmphasisMark::kDot:
1630 value_id_ = CSSValueDot; 1630 value_id_ = CSSValueDot;
1631 break; 1631 break;
1632 case kTextEmphasisMarkCircle: 1632 case TextEmphasisMark::kCircle:
1633 value_id_ = CSSValueCircle; 1633 value_id_ = CSSValueCircle;
1634 break; 1634 break;
1635 case kTextEmphasisMarkDoubleCircle: 1635 case TextEmphasisMark::kDoubleCircle:
1636 value_id_ = CSSValueDoubleCircle; 1636 value_id_ = CSSValueDoubleCircle;
1637 break; 1637 break;
1638 case kTextEmphasisMarkTriangle: 1638 case TextEmphasisMark::kTriangle:
1639 value_id_ = CSSValueTriangle; 1639 value_id_ = CSSValueTriangle;
1640 break; 1640 break;
1641 case kTextEmphasisMarkSesame: 1641 case TextEmphasisMark::kSesame:
1642 value_id_ = CSSValueSesame; 1642 value_id_ = CSSValueSesame;
1643 break; 1643 break;
1644 case kTextEmphasisMarkNone: 1644 case TextEmphasisMark::kNone:
1645 case kTextEmphasisMarkAuto: 1645 case TextEmphasisMark::kAuto:
1646 case kTextEmphasisMarkCustom: 1646 case TextEmphasisMark::kCustom:
1647 NOTREACHED(); 1647 NOTREACHED();
1648 value_id_ = CSSValueNone; 1648 value_id_ = CSSValueNone;
1649 break; 1649 break;
1650 } 1650 }
1651 } 1651 }
1652 1652
1653 template <> 1653 template <>
1654 inline TextEmphasisMark CSSIdentifierValue::ConvertTo() const { 1654 inline TextEmphasisMark CSSIdentifierValue::ConvertTo() const {
1655 switch (value_id_) { 1655 switch (value_id_) {
1656 case CSSValueNone: 1656 case CSSValueNone:
1657 return kTextEmphasisMarkNone; 1657 return TextEmphasisMark::kNone;
1658 case CSSValueDot: 1658 case CSSValueDot:
1659 return kTextEmphasisMarkDot; 1659 return TextEmphasisMark::kDot;
1660 case CSSValueCircle: 1660 case CSSValueCircle:
1661 return kTextEmphasisMarkCircle; 1661 return TextEmphasisMark::kCircle;
1662 case CSSValueDoubleCircle: 1662 case CSSValueDoubleCircle:
1663 return kTextEmphasisMarkDoubleCircle; 1663 return TextEmphasisMark::kDoubleCircle;
1664 case CSSValueTriangle: 1664 case CSSValueTriangle:
1665 return kTextEmphasisMarkTriangle; 1665 return TextEmphasisMark::kTriangle;
1666 case CSSValueSesame: 1666 case CSSValueSesame:
1667 return kTextEmphasisMarkSesame; 1667 return TextEmphasisMark::kSesame;
1668 default: 1668 default:
1669 break; 1669 break;
1670 } 1670 }
1671 1671
1672 NOTREACHED(); 1672 NOTREACHED();
1673 return kTextEmphasisMarkNone; 1673 return TextEmphasisMark::kNone;
1674 } 1674 }
1675 1675
1676 template <> 1676 template <>
1677 inline CSSIdentifierValue::CSSIdentifierValue(TextOrientation e) 1677 inline CSSIdentifierValue::CSSIdentifierValue(TextOrientation e)
1678 : CSSValue(kIdentifierClass) { 1678 : CSSValue(kIdentifierClass) {
1679 switch (e) { 1679 switch (e) {
1680 case kTextOrientationSideways: 1680 case kTextOrientationSideways:
1681 value_id_ = CSSValueSideways; 1681 value_id_ = CSSValueSideways;
1682 break; 1682 break;
1683 case kTextOrientationMixed: 1683 case kTextOrientationMixed:
(...skipping 1570 matching lines...) Expand 10 before | Expand all | Expand 10 after
3254 default: 3254 default:
3255 break; 3255 break;
3256 } 3256 }
3257 NOTREACHED(); 3257 NOTREACHED();
3258 return kContainsNone; 3258 return kContainsNone;
3259 } 3259 }
3260 3260
3261 } // namespace blink 3261 } // namespace blink
3262 3262
3263 #endif 3263 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698