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

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

Issue 2910123002: Make TextOrientation an enum class. (Closed)
Patch Set: 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/CSSProperties.json5 » ('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 1621 matching lines...) Expand 10 before | Expand all | Expand 10 after
1632 } 1632 }
1633 1633
1634 NOTREACHED(); 1634 NOTREACHED();
1635 return TextEmphasisMark::kNone; 1635 return TextEmphasisMark::kNone;
1636 } 1636 }
1637 1637
1638 template <> 1638 template <>
1639 inline CSSIdentifierValue::CSSIdentifierValue(TextOrientation e) 1639 inline CSSIdentifierValue::CSSIdentifierValue(TextOrientation e)
1640 : CSSValue(kIdentifierClass) { 1640 : CSSValue(kIdentifierClass) {
1641 switch (e) { 1641 switch (e) {
1642 case kTextOrientationSideways: 1642 case TextOrientation::kSideways:
1643 value_id_ = CSSValueSideways; 1643 value_id_ = CSSValueSideways;
1644 break; 1644 break;
1645 case kTextOrientationMixed: 1645 case TextOrientation::kMixed:
1646 value_id_ = CSSValueMixed; 1646 value_id_ = CSSValueMixed;
1647 break; 1647 break;
1648 case kTextOrientationUpright: 1648 case TextOrientation::kUpright:
1649 value_id_ = CSSValueUpright; 1649 value_id_ = CSSValueUpright;
1650 break; 1650 break;
1651 } 1651 }
1652 } 1652 }
1653 1653
1654 template <> 1654 template <>
1655 inline TextOrientation CSSIdentifierValue::ConvertTo() const { 1655 inline TextOrientation CSSIdentifierValue::ConvertTo() const {
1656 switch (value_id_) { 1656 switch (value_id_) {
1657 case CSSValueSideways: 1657 case CSSValueSideways:
1658 case CSSValueSidewaysRight: 1658 case CSSValueSidewaysRight:
1659 return kTextOrientationSideways; 1659 return TextOrientation::kSideways;
1660 case CSSValueMixed: 1660 case CSSValueMixed:
1661 case CSSValueVerticalRight: // -webkit-text-orientation 1661 case CSSValueVerticalRight: // -webkit-text-orientation
1662 return kTextOrientationMixed; 1662 return TextOrientation::kMixed;
1663 case CSSValueUpright: 1663 case CSSValueUpright:
1664 return kTextOrientationUpright; 1664 return TextOrientation::kUpright;
1665 default: 1665 default:
1666 break; 1666 break;
1667 } 1667 }
1668 1668
1669 NOTREACHED(); 1669 NOTREACHED();
1670 return kTextOrientationMixed; 1670 return TextOrientation::kMixed;
1671 } 1671 }
1672 1672
1673 template <> 1673 template <>
1674 inline CSSIdentifierValue::CSSIdentifierValue(FontDescription::Kerning kerning) 1674 inline CSSIdentifierValue::CSSIdentifierValue(FontDescription::Kerning kerning)
1675 : CSSValue(kIdentifierClass) { 1675 : CSSValue(kIdentifierClass) {
1676 switch (kerning) { 1676 switch (kerning) {
1677 case FontDescription::kAutoKerning: 1677 case FontDescription::kAutoKerning:
1678 value_id_ = CSSValueAuto; 1678 value_id_ = CSSValueAuto;
1679 return; 1679 return;
1680 case FontDescription::kNormalKerning: 1680 case FontDescription::kNormalKerning:
(...skipping 1487 matching lines...) Expand 10 before | Expand all | Expand 10 after
3168 default: 3168 default:
3169 break; 3169 break;
3170 } 3170 }
3171 NOTREACHED(); 3171 NOTREACHED();
3172 return kContainsNone; 3172 return kContainsNone;
3173 } 3173 }
3174 3174
3175 } // namespace blink 3175 } // namespace blink
3176 3176
3177 #endif 3177 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/CSSProperties.json5 » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698