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

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

Issue 2591373003: Changed WritingMode to an enum class and renamed its members (Closed)
Patch Set: Added comment Created 4 years 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/resolver/StyleAdjuster.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 2862 matching lines...) Expand 10 before | Expand all | Expand 10 after
2873 } 2873 }
2874 2874
2875 ASSERT_NOT_REACHED(); 2875 ASSERT_NOT_REACHED();
2876 return TextDirection::Ltr; 2876 return TextDirection::Ltr;
2877 } 2877 }
2878 2878
2879 template <> 2879 template <>
2880 inline CSSIdentifierValue::CSSIdentifierValue(WritingMode e) 2880 inline CSSIdentifierValue::CSSIdentifierValue(WritingMode e)
2881 : CSSValue(IdentifierClass) { 2881 : CSSValue(IdentifierClass) {
2882 switch (e) { 2882 switch (e) {
2883 case TopToBottomWritingMode: 2883 case WritingMode::HorizontalTb:
2884 m_valueID = CSSValueHorizontalTb; 2884 m_valueID = CSSValueHorizontalTb;
2885 break; 2885 break;
2886 case RightToLeftWritingMode: 2886 case WritingMode::VerticalRl:
2887 m_valueID = CSSValueVerticalRl; 2887 m_valueID = CSSValueVerticalRl;
2888 break; 2888 break;
2889 case LeftToRightWritingMode: 2889 case WritingMode::VerticalLr:
2890 m_valueID = CSSValueVerticalLr; 2890 m_valueID = CSSValueVerticalLr;
2891 break; 2891 break;
2892 } 2892 }
2893 } 2893 }
2894 2894
2895 template <> 2895 template <>
2896 inline WritingMode CSSIdentifierValue::convertTo() const { 2896 inline WritingMode CSSIdentifierValue::convertTo() const {
2897 switch (m_valueID) { 2897 switch (m_valueID) {
2898 case CSSValueHorizontalTb: 2898 case CSSValueHorizontalTb:
2899 case CSSValueLr: 2899 case CSSValueLr:
2900 case CSSValueLrTb: 2900 case CSSValueLrTb:
2901 case CSSValueRl: 2901 case CSSValueRl:
2902 case CSSValueRlTb: 2902 case CSSValueRlTb:
2903 return TopToBottomWritingMode; 2903 return WritingMode::HorizontalTb;
2904 case CSSValueVerticalRl: 2904 case CSSValueVerticalRl:
2905 case CSSValueTb: 2905 case CSSValueTb:
2906 case CSSValueTbRl: 2906 case CSSValueTbRl:
2907 return RightToLeftWritingMode; 2907 return WritingMode::VerticalRl;
2908 case CSSValueVerticalLr: 2908 case CSSValueVerticalLr:
2909 return LeftToRightWritingMode; 2909 return WritingMode::VerticalLr;
2910 default: 2910 default:
2911 break; 2911 break;
2912 } 2912 }
2913 2913
2914 ASSERT_NOT_REACHED(); 2914 ASSERT_NOT_REACHED();
2915 return TopToBottomWritingMode; 2915 return WritingMode::HorizontalTb;
2916 } 2916 }
2917 2917
2918 template <> 2918 template <>
2919 inline CSSIdentifierValue::CSSIdentifierValue(TextCombine e) 2919 inline CSSIdentifierValue::CSSIdentifierValue(TextCombine e)
2920 : CSSValue(IdentifierClass) { 2920 : CSSValue(IdentifierClass) {
2921 switch (e) { 2921 switch (e) {
2922 case TextCombineNone: 2922 case TextCombineNone:
2923 m_valueID = CSSValueNone; 2923 m_valueID = CSSValueNone;
2924 break; 2924 break;
2925 case TextCombineAll: 2925 case TextCombineAll:
(...skipping 1859 matching lines...) Expand 10 before | Expand all | Expand 10 after
4785 default: 4785 default:
4786 break; 4786 break;
4787 } 4787 }
4788 ASSERT_NOT_REACHED(); 4788 ASSERT_NOT_REACHED();
4789 return ContainsNone; 4789 return ContainsNone;
4790 } 4790 }
4791 4791
4792 } // namespace blink 4792 } // namespace blink
4793 4793
4794 #endif 4794 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698