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

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

Issue 2913723002: Generate enum/getters/setters/mappings for text-orientation. (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 1585 matching lines...) Expand 10 before | Expand all | Expand 10 after
1596 return TextEmphasisMark::kSesame; 1596 return TextEmphasisMark::kSesame;
1597 default: 1597 default:
1598 break; 1598 break;
1599 } 1599 }
1600 1600
1601 NOTREACHED(); 1601 NOTREACHED();
1602 return TextEmphasisMark::kNone; 1602 return TextEmphasisMark::kNone;
1603 } 1603 }
1604 1604
1605 template <> 1605 template <>
1606 inline CSSIdentifierValue::CSSIdentifierValue(TextOrientation e)
1607 : CSSValue(kIdentifierClass) {
1608 switch (e) {
1609 case TextOrientation::kSideways:
1610 value_id_ = CSSValueSideways;
1611 break;
1612 case TextOrientation::kMixed:
1613 value_id_ = CSSValueMixed;
1614 break;
1615 case TextOrientation::kUpright:
1616 value_id_ = CSSValueUpright;
1617 break;
1618 }
1619 }
1620
1621 template <>
1622 inline TextOrientation CSSIdentifierValue::ConvertTo() const {
1623 switch (value_id_) {
1624 case CSSValueSideways:
1625 case CSSValueSidewaysRight:
shend 2017/05/30 20:48:43 Special case here, gotta override it in CSSValueID
nainar 2017/05/31 03:59:57 Done.
1626 return TextOrientation::kSideways;
1627 case CSSValueMixed:
1628 case CSSValueVerticalRight: // -webkit-text-orientation
shend 2017/05/30 20:48:43 Same here.
nainar 2017/05/31 03:59:57 Done.
1629 return TextOrientation::kMixed;
1630 case CSSValueUpright:
1631 return TextOrientation::kUpright;
1632 default:
1633 break;
1634 }
1635
1636 NOTREACHED();
1637 return TextOrientation::kMixed;
1638 }
1639
1640 template <>
1641 inline CSSIdentifierValue::CSSIdentifierValue(FontDescription::Kerning kerning) 1606 inline CSSIdentifierValue::CSSIdentifierValue(FontDescription::Kerning kerning)
1642 : CSSValue(kIdentifierClass) { 1607 : CSSValue(kIdentifierClass) {
1643 switch (kerning) { 1608 switch (kerning) {
1644 case FontDescription::kAutoKerning: 1609 case FontDescription::kAutoKerning:
1645 value_id_ = CSSValueAuto; 1610 value_id_ = CSSValueAuto;
1646 return; 1611 return;
1647 case FontDescription::kNormalKerning: 1612 case FontDescription::kNormalKerning:
1648 value_id_ = CSSValueNormal; 1613 value_id_ = CSSValueNormal;
1649 return; 1614 return;
1650 case FontDescription::kNoneKerning: 1615 case FontDescription::kNoneKerning:
(...skipping 1482 matching lines...) Expand 10 before | Expand all | Expand 10 after
3133 default: 3098 default:
3134 break; 3099 break;
3135 } 3100 }
3136 NOTREACHED(); 3101 NOTREACHED();
3137 return kContainsNone; 3102 return kContainsNone;
3138 } 3103 }
3139 3104
3140 } // namespace blink 3105 } // namespace blink
3141 3106
3142 #endif 3107 #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