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

Side by Side Diff: sky/engine/core/css/CSSPrimitiveValueMappings.h

Issue 1070313003: Remove page-break properties and captions (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 8 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. (http://www.torchmo bile.com/) 4 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
5 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com> 5 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com>
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 case CSSValueBlockAxis: 676 case CSSValueBlockAxis:
677 return VERTICAL; 677 return VERTICAL;
678 default: 678 default:
679 break; 679 break;
680 } 680 }
681 681
682 ASSERT_NOT_REACHED(); 682 ASSERT_NOT_REACHED();
683 return HORIZONTAL; 683 return HORIZONTAL;
684 } 684 }
685 685
686 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ECaptionSide e)
687 : CSSValue(PrimitiveClass)
688 {
689 m_primitiveUnitType = CSS_VALUE_ID;
690 switch (e) {
691 case CAPLEFT:
692 m_value.valueID = CSSValueLeft;
693 break;
694 case CAPRIGHT:
695 m_value.valueID = CSSValueRight;
696 break;
697 case CAPTOP:
698 m_value.valueID = CSSValueTop;
699 break;
700 case CAPBOTTOM:
701 m_value.valueID = CSSValueBottom;
702 break;
703 }
704 }
705
706 template<> inline CSSPrimitiveValue::operator ECaptionSide() const
707 {
708 ASSERT(isValueID());
709 switch (m_value.valueID) {
710 case CSSValueLeft:
711 return CAPLEFT;
712 case CSSValueRight:
713 return CAPRIGHT;
714 case CSSValueTop:
715 return CAPTOP;
716 case CSSValueBottom:
717 return CAPBOTTOM;
718 default:
719 break;
720 }
721
722 ASSERT_NOT_REACHED();
723 return CAPTOP;
724 }
725
726 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EDisplay e) 686 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EDisplay e)
727 : CSSValue(PrimitiveClass) 687 : CSSValue(PrimitiveClass)
728 { 688 {
729 m_primitiveUnitType = CSS_VALUE_ID; 689 m_primitiveUnitType = CSS_VALUE_ID;
730 switch (e) { 690 switch (e) {
731 case INLINE: 691 case INLINE:
732 m_value.valueID = CSSValueInline; 692 m_value.valueID = CSSValueInline;
733 break; 693 break;
734 case PARAGRAPH: 694 case PARAGRAPH:
735 m_value.valueID = CSSValueParagraph; 695 m_value.valueID = CSSValueParagraph;
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
1045 case CSSValueWebkitPagedY: 1005 case CSSValueWebkitPagedY:
1046 return OPAGEDY; 1006 return OPAGEDY;
1047 default: 1007 default:
1048 break; 1008 break;
1049 } 1009 }
1050 1010
1051 ASSERT_NOT_REACHED(); 1011 ASSERT_NOT_REACHED();
1052 return OVISIBLE; 1012 return OVISIBLE;
1053 } 1013 }
1054 1014
1055 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EPageBreak e)
1056 : CSSValue(PrimitiveClass)
1057 {
1058 m_primitiveUnitType = CSS_VALUE_ID;
1059 switch (e) {
1060 case PBAUTO:
1061 m_value.valueID = CSSValueAuto;
1062 break;
1063 case PBALWAYS:
1064 m_value.valueID = CSSValueAlways;
1065 break;
1066 case PBAVOID:
1067 m_value.valueID = CSSValueAvoid;
1068 break;
1069 }
1070 }
1071
1072 template<> inline CSSPrimitiveValue::operator EPageBreak() const
1073 {
1074 ASSERT(isValueID());
1075 switch (m_value.valueID) {
1076 case CSSValueAuto:
1077 return PBAUTO;
1078 case CSSValueLeft:
1079 case CSSValueRight:
1080 case CSSValueAlways:
1081 return PBALWAYS; // CSS2.1: "Conforming user agents may map left/right t o always."
1082 case CSSValueAvoid:
1083 return PBAVOID;
1084 default:
1085 break;
1086 }
1087
1088 ASSERT_NOT_REACHED();
1089 return PBAUTO;
1090 }
1091
1092 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EPosition e) 1015 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EPosition e)
1093 : CSSValue(PrimitiveClass) 1016 : CSSValue(PrimitiveClass)
1094 { 1017 {
1095 m_primitiveUnitType = CSS_VALUE_ID; 1018 m_primitiveUnitType = CSS_VALUE_ID;
1096 switch (e) { 1019 switch (e) {
1097 case StaticPosition: 1020 case StaticPosition:
1098 m_value.valueID = CSSValueStatic; 1021 m_value.valueID = CSSValueStatic;
1099 break; 1022 break;
1100 case AbsolutePosition: 1023 case AbsolutePosition:
1101 m_value.valueID = CSSValueAbsolute; 1024 m_value.valueID = CSSValueAbsolute;
(...skipping 1839 matching lines...) Expand 10 before | Expand all | Expand 10 after
2941 default: 2864 default:
2942 break; 2865 break;
2943 } 2866 }
2944 ASSERT_NOT_REACHED(); 2867 ASSERT_NOT_REACHED();
2945 return OverflowAlignmentTrue; 2868 return OverflowAlignmentTrue;
2946 } 2869 }
2947 2870
2948 } 2871 }
2949 2872
2950 #endif // SKY_ENGINE_CORE_CSS_CSSPRIMITIVEVALUEMAPPINGS_H_ 2873 #endif // SKY_ENGINE_CORE_CSS_CSSPRIMITIVEVALUEMAPPINGS_H_
OLDNEW
« no previous file with comments | « sky/engine/core/css/CSSComputedStyleDeclaration.cpp ('k') | sky/engine/core/css/CSSProperties.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698