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

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

Issue 17155007: [CSS3] Parsing the property, text-justify. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@parsingTextJustify
Patch Set: 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 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
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: 689 case CSSPropertyTextAlignLast:
690 // auto | start | end | left | right | center | justify 690 // auto | start | end | left | right | center | justify
691 if (RuntimeEnabledFeatures::css3TextEnabled() 691 if (RuntimeEnabledFeatures::css3TextEnabled()
692 && ((valueID >= CSSValueLeft && valueID <= CSSValueJustify) || value ID == CSSValueStart || valueID == CSSValueEnd || valueID == CSSValueAuto)) 692 && ((valueID >= CSSValueLeft && valueID <= CSSValueJustify) || value ID == CSSValueStart || valueID == CSSValueEnd || valueID == CSSValueAuto))
693 return true; 693 return true;
694 break; 694 break;
695 case CSSPropertyTextJustify:
696 // auto | none | inter-word | distribute
697 if (RuntimeEnabledFeatures::css3TextEnabled()
698 && (valueID == CSSValueInterWord || valueID == CSSValueDistribute || valueID == CSSValueAuto || valueID == CSSValueNone))
699 return true;
700 break;
695 case CSSPropertyTextLineThroughMode: 701 case CSSPropertyTextLineThroughMode:
696 case CSSPropertyTextOverlineMode: 702 case CSSPropertyTextOverlineMode:
697 case CSSPropertyTextUnderlineMode: 703 case CSSPropertyTextUnderlineMode:
698 if (valueID == CSSValueContinuous || valueID == CSSValueSkipWhiteSpace) 704 if (valueID == CSSValueContinuous || valueID == CSSValueSkipWhiteSpace)
699 return true; 705 return true;
700 break; 706 break;
701 case CSSPropertyTextLineThroughStyle: 707 case CSSPropertyTextLineThroughStyle:
702 case CSSPropertyTextOverlineStyle: 708 case CSSPropertyTextOverlineStyle:
703 case CSSPropertyTextUnderlineStyle: 709 case CSSPropertyTextUnderlineStyle:
704 if (valueID == CSSValueNone || valueID == CSSValueSolid || valueID == CS SValueDouble || valueID == CSSValueDashed || valueID == CSSValueDotDash || value ID == CSSValueDotDotDash || valueID == CSSValueWave) 710 if (valueID == CSSValueNone || valueID == CSSValueSolid || valueID == CS SValueDouble || valueID == CSSValueDashed || valueID == CSSValueDotDash || value ID == CSSValueDotDotDash || valueID == CSSValueWave)
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
922 } 928 }
923 return false; 929 return false;
924 } 930 }
925 931
926 static inline bool isKeywordPropertyID(CSSPropertyID propertyId) 932 static inline bool isKeywordPropertyID(CSSPropertyID propertyId)
927 { 933 {
928 switch (propertyId) { 934 switch (propertyId) {
929 case CSSPropertyMixBlendMode: 935 case CSSPropertyMixBlendMode:
930 return RuntimeEnabledFeatures::cssCompositingEnabled(); 936 return RuntimeEnabledFeatures::cssCompositingEnabled();
931 case CSSPropertyTextAlignLast: 937 case CSSPropertyTextAlignLast:
938 case CSSPropertyTextJustify:
932 return RuntimeEnabledFeatures::css3TextEnabled(); 939 return RuntimeEnabledFeatures::css3TextEnabled();
Julien - ping for review 2013/07/15 22:05:47 I don't think this logic is OK. In debug, we will
dw.im 2013/07/16 01:13:56 Then, I think TextAlignLast is also needed to retu
Julien - ping for review 2013/07/16 19:40:09 Right, you need to return false when the flag is o
933 case CSSPropertyBorderBottomStyle: 940 case CSSPropertyBorderBottomStyle:
934 case CSSPropertyBorderCollapse: 941 case CSSPropertyBorderCollapse:
935 case CSSPropertyBorderLeftStyle: 942 case CSSPropertyBorderLeftStyle:
936 case CSSPropertyBorderRightStyle: 943 case CSSPropertyBorderRightStyle:
937 case CSSPropertyBorderTopStyle: 944 case CSSPropertyBorderTopStyle:
938 case CSSPropertyBoxSizing: 945 case CSSPropertyBoxSizing:
939 case CSSPropertyCaptionSide: 946 case CSSPropertyCaptionSide:
940 case CSSPropertyClear: 947 case CSSPropertyClear:
941 case CSSPropertyDirection: 948 case CSSPropertyDirection:
942 case CSSPropertyDisplay: 949 case CSSPropertyDisplay:
(...skipping 1815 matching lines...) Expand 10 before | Expand all | Expand 10 after
2758 case CSSPropertyOverflowY: 2765 case CSSPropertyOverflowY:
2759 case CSSPropertyPageBreakAfter: 2766 case CSSPropertyPageBreakAfter:
2760 case CSSPropertyPageBreakBefore: 2767 case CSSPropertyPageBreakBefore:
2761 case CSSPropertyPageBreakInside: 2768 case CSSPropertyPageBreakInside:
2762 case CSSPropertyPointerEvents: 2769 case CSSPropertyPointerEvents:
2763 case CSSPropertyPosition: 2770 case CSSPropertyPosition:
2764 case CSSPropertyResize: 2771 case CSSPropertyResize:
2765 case CSSPropertySpeak: 2772 case CSSPropertySpeak:
2766 case CSSPropertyTableLayout: 2773 case CSSPropertyTableLayout:
2767 case CSSPropertyTextAlignLast: 2774 case CSSPropertyTextAlignLast:
2775 case CSSPropertyTextJustify:
2768 case CSSPropertyTextLineThroughMode: 2776 case CSSPropertyTextLineThroughMode:
2769 case CSSPropertyTextLineThroughStyle: 2777 case CSSPropertyTextLineThroughStyle:
2770 case CSSPropertyTextOverflow: 2778 case CSSPropertyTextOverflow:
2771 case CSSPropertyTextOverlineMode: 2779 case CSSPropertyTextOverlineMode:
2772 case CSSPropertyTextOverlineStyle: 2780 case CSSPropertyTextOverlineStyle:
2773 case CSSPropertyTextRendering: 2781 case CSSPropertyTextRendering:
2774 case CSSPropertyTextTransform: 2782 case CSSPropertyTextTransform:
2775 case CSSPropertyTextUnderlineMode: 2783 case CSSPropertyTextUnderlineMode:
2776 case CSSPropertyTextUnderlineStyle: 2784 case CSSPropertyTextUnderlineStyle:
2777 case CSSPropertyTouchAction: 2785 case CSSPropertyTouchAction:
(...skipping 8939 matching lines...) Expand 10 before | Expand all | Expand 10 after
11717 { 11725 {
11718 // The tokenizer checks for the construct of an+b. 11726 // The tokenizer checks for the construct of an+b.
11719 // However, since the {ident} rule precedes the {nth} rule, some of those 11727 // However, since the {ident} rule precedes the {nth} rule, some of those
11720 // tokens are identified as string literal. Furthermore we need to accept 11728 // tokens are identified as string literal. Furthermore we need to accept
11721 // "odd" and "even" which does not match to an+b. 11729 // "odd" and "even" which does not match to an+b.
11722 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even") 11730 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even")
11723 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n"); 11731 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n");
11724 } 11732 }
11725 11733
11726 } 11734 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698