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

Side by Side Diff: Source/core/css/CSSParser-in.cpp

Issue 19041005: Introduce css3TextEnabled instead of CSS3_TEXT. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing Created 7 years, 5 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) 2003 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. 8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.
9 * Copyright (C) 2012 Intel Corporation. All rights reserved. 9 * Copyright (C) 2012 Intel Corporation. All rights reserved.
10 * 10 *
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 return true; 679 return true;
680 break; 680 break;
681 case CSSPropertySpeak: // none | normal | spell-out | digits | literal-punct uation | no-punctuation | inherit 681 case CSSPropertySpeak: // none | normal | spell-out | digits | literal-punct uation | no-punctuation | inherit
682 if (valueID == CSSValueNone || valueID == CSSValueNormal || valueID == C SSValueSpellOut || valueID == CSSValueDigits || valueID == CSSValueLiteralPunctu ation || valueID == CSSValueNoPunctuation) 682 if (valueID == CSSValueNone || valueID == CSSValueNormal || valueID == C SSValueSpellOut || valueID == CSSValueDigits || valueID == CSSValueLiteralPunctu ation || valueID == CSSValueNoPunctuation)
683 return true; 683 return true;
684 break; 684 break;
685 case CSSPropertyTableLayout: // auto | fixed | inherit 685 case CSSPropertyTableLayout: // auto | fixed | inherit
686 if (valueID == CSSValueAuto || valueID == CSSValueFixed) 686 if (valueID == CSSValueAuto || valueID == CSSValueFixed)
687 return true; 687 return true;
688 break; 688 break;
689 case CSSPropertyTextAlignLast:
690 // auto | start | end | left | right | center | justify
691 if (RuntimeEnabledFeatures::css3TextEnabled()
692 && ((valueID >= CSSValueLeft && valueID <= CSSValueJustify) || value ID == CSSValueStart || valueID == CSSValueEnd || valueID == CSSValueAuto))
693 return true;
694 break;
689 case CSSPropertyTextLineThroughMode: 695 case CSSPropertyTextLineThroughMode:
690 case CSSPropertyTextOverlineMode: 696 case CSSPropertyTextOverlineMode:
691 case CSSPropertyTextUnderlineMode: 697 case CSSPropertyTextUnderlineMode:
692 if (valueID == CSSValueContinuous || valueID == CSSValueSkipWhiteSpace) 698 if (valueID == CSSValueContinuous || valueID == CSSValueSkipWhiteSpace)
693 return true; 699 return true;
694 break; 700 break;
695 case CSSPropertyTextLineThroughStyle: 701 case CSSPropertyTextLineThroughStyle:
696 case CSSPropertyTextOverlineStyle: 702 case CSSPropertyTextOverlineStyle:
697 case CSSPropertyTextUnderlineStyle: 703 case CSSPropertyTextUnderlineStyle:
698 if (valueID == CSSValueNone || valueID == CSSValueSolid || valueID == CS SValueDouble || valueID == CSSValueDashed || valueID == CSSValueDotDash || value ID == CSSValueDotDotDash || valueID == CSSValueWave) 704 if (valueID == CSSValueNone || valueID == CSSValueSolid || valueID == CS SValueDouble || valueID == CSSValueDashed || valueID == CSSValueDotDash || value ID == CSSValueDotDotDash || valueID == CSSValueWave)
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 case CSSPropertyWebkitRtlOrdering: 856 case CSSPropertyWebkitRtlOrdering:
851 if (valueID == CSSValueLogical || valueID == CSSValueVisual) 857 if (valueID == CSSValueLogical || valueID == CSSValueVisual)
852 return true; 858 return true;
853 break; 859 break;
854 860
855 case CSSPropertyWebkitRubyPosition: 861 case CSSPropertyWebkitRubyPosition:
856 if (valueID == CSSValueBefore || valueID == CSSValueAfter) 862 if (valueID == CSSValueBefore || valueID == CSSValueAfter)
857 return true; 863 return true;
858 break; 864 break;
859 865
860 #if ENABLE(CSS3_TEXT)
861 case CSSPropertyWebkitTextAlignLast:
862 // auto | start | end | left | right | center | justify
863 if ((valueID >= CSSValueLeft && valueID <= CSSValueJustify) || valueID = = CSSValueStart || valueID == CSSValueEnd || valueID == CSSValueAuto)
864 return true;
865 break;
866 #endif // CSS3_TEXT
867 case CSSPropertyWebkitTextCombine: 866 case CSSPropertyWebkitTextCombine:
868 if (valueID == CSSValueNone || valueID == CSSValueHorizontal) 867 if (valueID == CSSValueNone || valueID == CSSValueHorizontal)
869 return true; 868 return true;
870 break; 869 break;
871 case CSSPropertyWebkitTextEmphasisPosition: 870 case CSSPropertyWebkitTextEmphasisPosition:
872 if (valueID == CSSValueOver || valueID == CSSValueUnder) 871 if (valueID == CSSValueOver || valueID == CSSValueUnder)
873 return true; 872 return true;
874 break; 873 break;
875 case CSSPropertyWebkitTextSecurity: 874 case CSSPropertyWebkitTextSecurity:
876 // disc | circle | square | none | inherit 875 // disc | circle | square | none | inherit
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
922 return false; 921 return false;
923 } 922 }
924 return false; 923 return false;
925 } 924 }
926 925
927 static inline bool isKeywordPropertyID(CSSPropertyID propertyId) 926 static inline bool isKeywordPropertyID(CSSPropertyID propertyId)
928 { 927 {
929 switch (propertyId) { 928 switch (propertyId) {
930 case CSSPropertyMixBlendMode: 929 case CSSPropertyMixBlendMode:
931 return RuntimeEnabledFeatures::cssCompositingEnabled(); 930 return RuntimeEnabledFeatures::cssCompositingEnabled();
931 case CSSPropertyTextAlignLast:
932 return RuntimeEnabledFeatures::css3TextEnabled();
932 case CSSPropertyBorderBottomStyle: 933 case CSSPropertyBorderBottomStyle:
933 case CSSPropertyBorderCollapse: 934 case CSSPropertyBorderCollapse:
934 case CSSPropertyBorderLeftStyle: 935 case CSSPropertyBorderLeftStyle:
935 case CSSPropertyBorderRightStyle: 936 case CSSPropertyBorderRightStyle:
936 case CSSPropertyBorderTopStyle: 937 case CSSPropertyBorderTopStyle:
937 case CSSPropertyBoxSizing: 938 case CSSPropertyBoxSizing:
938 case CSSPropertyCaptionSide: 939 case CSSPropertyCaptionSide:
939 case CSSPropertyClear: 940 case CSSPropertyClear:
940 case CSSPropertyDirection: 941 case CSSPropertyDirection:
941 case CSSPropertyDisplay: 942 case CSSPropertyDisplay:
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
1004 case CSSPropertyWebkitMarginTopCollapse: 1005 case CSSPropertyWebkitMarginTopCollapse:
1005 case CSSPropertyWebkitMarqueeDirection: 1006 case CSSPropertyWebkitMarqueeDirection:
1006 case CSSPropertyWebkitMarqueeStyle: 1007 case CSSPropertyWebkitMarqueeStyle:
1007 case CSSPropertyWebkitPrintColorAdjust: 1008 case CSSPropertyWebkitPrintColorAdjust:
1008 case CSSPropertyWebkitRegionBreakAfter: 1009 case CSSPropertyWebkitRegionBreakAfter:
1009 case CSSPropertyWebkitRegionBreakBefore: 1010 case CSSPropertyWebkitRegionBreakBefore:
1010 case CSSPropertyWebkitRegionBreakInside: 1011 case CSSPropertyWebkitRegionBreakInside:
1011 case CSSPropertyWebkitRegionFragment: 1012 case CSSPropertyWebkitRegionFragment:
1012 case CSSPropertyWebkitRtlOrdering: 1013 case CSSPropertyWebkitRtlOrdering:
1013 case CSSPropertyWebkitRubyPosition: 1014 case CSSPropertyWebkitRubyPosition:
1014 #if ENABLE(CSS3_TEXT)
1015 case CSSPropertyWebkitTextAlignLast:
1016 #endif // CSS3_TEXT
1017 case CSSPropertyWebkitTextCombine: 1015 case CSSPropertyWebkitTextCombine:
1018 case CSSPropertyWebkitTextEmphasisPosition: 1016 case CSSPropertyWebkitTextEmphasisPosition:
1019 case CSSPropertyWebkitTextSecurity: 1017 case CSSPropertyWebkitTextSecurity:
1020 case CSSPropertyWebkitTransformStyle: 1018 case CSSPropertyWebkitTransformStyle:
1021 case CSSPropertyWebkitUserDrag: 1019 case CSSPropertyWebkitUserDrag:
1022 case CSSPropertyWebkitUserModify: 1020 case CSSPropertyWebkitUserModify:
1023 case CSSPropertyWebkitUserSelect: 1021 case CSSPropertyWebkitUserSelect:
1024 case CSSPropertyWebkitWrapFlow: 1022 case CSSPropertyWebkitWrapFlow:
1025 case CSSPropertyWebkitWrapThrough: 1023 case CSSPropertyWebkitWrapThrough:
1026 case CSSPropertyWebkitWritingMode: 1024 case CSSPropertyWebkitWritingMode:
(...skipping 1732 matching lines...) Expand 10 before | Expand all | Expand 10 after
2759 case CSSPropertyOverflowX: 2757 case CSSPropertyOverflowX:
2760 case CSSPropertyOverflowY: 2758 case CSSPropertyOverflowY:
2761 case CSSPropertyPageBreakAfter: 2759 case CSSPropertyPageBreakAfter:
2762 case CSSPropertyPageBreakBefore: 2760 case CSSPropertyPageBreakBefore:
2763 case CSSPropertyPageBreakInside: 2761 case CSSPropertyPageBreakInside:
2764 case CSSPropertyPointerEvents: 2762 case CSSPropertyPointerEvents:
2765 case CSSPropertyPosition: 2763 case CSSPropertyPosition:
2766 case CSSPropertyResize: 2764 case CSSPropertyResize:
2767 case CSSPropertySpeak: 2765 case CSSPropertySpeak:
2768 case CSSPropertyTableLayout: 2766 case CSSPropertyTableLayout:
2767 case CSSPropertyTextAlignLast:
2769 case CSSPropertyTextLineThroughMode: 2768 case CSSPropertyTextLineThroughMode:
2770 case CSSPropertyTextLineThroughStyle: 2769 case CSSPropertyTextLineThroughStyle:
2771 case CSSPropertyTextOverflow: 2770 case CSSPropertyTextOverflow:
2772 case CSSPropertyTextOverlineMode: 2771 case CSSPropertyTextOverlineMode:
2773 case CSSPropertyTextOverlineStyle: 2772 case CSSPropertyTextOverlineStyle:
2774 case CSSPropertyTextRendering: 2773 case CSSPropertyTextRendering:
2775 case CSSPropertyTextTransform: 2774 case CSSPropertyTextTransform:
2776 case CSSPropertyTextUnderlineMode: 2775 case CSSPropertyTextUnderlineMode:
2777 case CSSPropertyTextUnderlineStyle: 2776 case CSSPropertyTextUnderlineStyle:
2778 case CSSPropertyTouchAction: 2777 case CSSPropertyTouchAction:
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
2814 case CSSPropertyWebkitMarginTopCollapse: 2813 case CSSPropertyWebkitMarginTopCollapse:
2815 case CSSPropertyWebkitMarqueeDirection: 2814 case CSSPropertyWebkitMarqueeDirection:
2816 case CSSPropertyWebkitMarqueeStyle: 2815 case CSSPropertyWebkitMarqueeStyle:
2817 case CSSPropertyWebkitPrintColorAdjust: 2816 case CSSPropertyWebkitPrintColorAdjust:
2818 case CSSPropertyWebkitRegionBreakAfter: 2817 case CSSPropertyWebkitRegionBreakAfter:
2819 case CSSPropertyWebkitRegionBreakBefore: 2818 case CSSPropertyWebkitRegionBreakBefore:
2820 case CSSPropertyWebkitRegionBreakInside: 2819 case CSSPropertyWebkitRegionBreakInside:
2821 case CSSPropertyWebkitRegionFragment: 2820 case CSSPropertyWebkitRegionFragment:
2822 case CSSPropertyWebkitRtlOrdering: 2821 case CSSPropertyWebkitRtlOrdering:
2823 case CSSPropertyWebkitRubyPosition: 2822 case CSSPropertyWebkitRubyPosition:
2824 #if ENABLE(CSS3_TEXT)
2825 case CSSPropertyWebkitTextAlignLast:
2826 #endif // CSS3_TEXT
2827 case CSSPropertyWebkitTextCombine: 2823 case CSSPropertyWebkitTextCombine:
2828 case CSSPropertyWebkitTextEmphasisPosition: 2824 case CSSPropertyWebkitTextEmphasisPosition:
2829 case CSSPropertyWebkitTextSecurity: 2825 case CSSPropertyWebkitTextSecurity:
2830 case CSSPropertyWebkitTransformStyle: 2826 case CSSPropertyWebkitTransformStyle:
2831 case CSSPropertyWebkitUserDrag: 2827 case CSSPropertyWebkitUserDrag:
2832 case CSSPropertyWebkitUserModify: 2828 case CSSPropertyWebkitUserModify:
2833 case CSSPropertyWebkitUserSelect: 2829 case CSSPropertyWebkitUserSelect:
2834 case CSSPropertyWebkitWrapFlow: 2830 case CSSPropertyWebkitWrapFlow:
2835 case CSSPropertyWebkitWrapThrough: 2831 case CSSPropertyWebkitWrapThrough:
2836 case CSSPropertyWebkitWritingMode: 2832 case CSSPropertyWebkitWritingMode:
(...skipping 8884 matching lines...) Expand 10 before | Expand all | Expand 10 after
11721 { 11717 {
11722 // The tokenizer checks for the construct of an+b. 11718 // The tokenizer checks for the construct of an+b.
11723 // However, since the {ident} rule precedes the {nth} rule, some of those 11719 // However, since the {ident} rule precedes the {nth} rule, some of those
11724 // tokens are identified as string literal. Furthermore we need to accept 11720 // tokens are identified as string literal. Furthermore we need to accept
11725 // "odd" and "even" which does not match to an+b. 11721 // "odd" and "even" which does not match to an+b.
11726 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even") 11722 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even")
11727 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n"); 11723 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n");
11728 } 11724 }
11729 11725
11730 } 11726 }
OLDNEW
« no previous file with comments | « Source/core/css/CSSComputedStyleDeclaration.cpp ('k') | Source/core/css/CSSPrimitiveValueMappings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698