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

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

Issue 23111004: Re-land "[css3-text] Implement text-decoration property shorthand" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased after Alexis' function name changes in CSSComputedStyleDeclaration.cpp Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/css/CSSComputedStyleDeclaration.cpp ('k') | Source/core/css/CSSShorthands.in » ('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) 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 2096 matching lines...) Expand 10 before | Expand all | Expand 10 after
2107 validPrimitive = true; 2107 validPrimitive = true;
2108 break; 2108 break;
2109 case CSSPropertyFontFamily: 2109 case CSSPropertyFontFamily:
2110 // [[ <family-name> | <generic-family> ],]* [<family-name> | <generic-fa mily>] | inherit 2110 // [[ <family-name> | <generic-family> ],]* [<family-name> | <generic-fa mily>] | inherit
2111 { 2111 {
2112 parsedValue = parseFontFamily(); 2112 parsedValue = parseFontFamily();
2113 break; 2113 break;
2114 } 2114 }
2115 2115
2116 case CSSPropertyTextDecoration: 2116 case CSSPropertyTextDecoration:
2117 // Fall through 'text-decoration-line' parsing if CSS 3 Text Decoration
2118 // is disabled to match CSS 2.1 rules for parsing 'text-decoration'.
2119 if (RuntimeEnabledFeatures::css3TextDecorationsEnabled()) {
2120 // [ <text-decoration-line> || <text-decoration-style> || <text-deco ration-color> ] | inherit
2121 return parseShorthand(CSSPropertyTextDecoration, textDecorationShort hand(), important);
2122 }
2117 case CSSPropertyWebkitTextDecorationsInEffect: 2123 case CSSPropertyWebkitTextDecorationsInEffect:
2118 case CSSPropertyTextDecorationLine: 2124 case CSSPropertyTextDecorationLine:
2119 // none | [ underline || overline || line-through || blink ] | inherit 2125 // none | [ underline || overline || line-through || blink ] | inherit
2120 return parseTextDecoration(propId, important); 2126 return parseTextDecoration(propId, important);
2121 2127
2122 case CSSPropertyTextDecorationStyle: 2128 case CSSPropertyTextDecorationStyle:
2123 // solid | double | dotted | dashed | wavy 2129 // solid | double | dotted | dashed | wavy
2124 if (RuntimeEnabledFeatures::css3TextDecorationsEnabled() 2130 if (RuntimeEnabledFeatures::css3TextDecorationsEnabled()
2125 && (id == CSSValueSolid || id == CSSValueDouble || id == CSSValueDot ted || id == CSSValueDashed || id == CSSValueWavy)) 2131 && (id == CSSValueSolid || id == CSSValueDouble || id == CSSValueDot ted || id == CSSValueDashed || id == CSSValueWavy))
2126 validPrimitive = true; 2132 validPrimitive = true;
(...skipping 6895 matching lines...) Expand 10 before | Expand all | Expand 10 after
9022 list->append(cssValuePool().createIdentifierValue(value->id)); 9028 list->append(cssValuePool().createIdentifierValue(value->id));
9023 break; 9029 break;
9024 default: 9030 default:
9025 isValid = false; 9031 isValid = false;
9026 break; 9032 break;
9027 } 9033 }
9028 if (isValid) 9034 if (isValid)
9029 value = m_valueList->next(); 9035 value = m_valueList->next();
9030 } 9036 }
9031 9037
9032 if (list->length() && isValid) { 9038 // Values are either valid or in shorthand scope.
9039 if (list->length() && (isValid || inShorthand())) {
9033 addTextDecorationProperty(propId, list.release(), important); 9040 addTextDecorationProperty(propId, list.release(), important);
9034 return true; 9041 return true;
9035 } 9042 }
9036 9043
9037 return false; 9044 return false;
9038 } 9045 }
9039 9046
9040 #if ENABLE(CSS3_TEXT) 9047 #if ENABLE(CSS3_TEXT)
9041 bool CSSParser::parseTextUnderlinePosition(bool important) 9048 bool CSSParser::parseTextUnderlinePosition(bool important)
9042 { 9049 {
(...skipping 2897 matching lines...) Expand 10 before | Expand all | Expand 10 after
11940 { 11947 {
11941 // The tokenizer checks for the construct of an+b. 11948 // The tokenizer checks for the construct of an+b.
11942 // However, since the {ident} rule precedes the {nth} rule, some of those 11949 // However, since the {ident} rule precedes the {nth} rule, some of those
11943 // tokens are identified as string literal. Furthermore we need to accept 11950 // tokens are identified as string literal. Furthermore we need to accept
11944 // "odd" and "even" which does not match to an+b. 11951 // "odd" and "even" which does not match to an+b.
11945 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even") 11952 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even")
11946 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n"); 11953 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n");
11947 } 11954 }
11948 11955
11949 } 11956 }
OLDNEW
« no previous file with comments | « Source/core/css/CSSComputedStyleDeclaration.cpp ('k') | Source/core/css/CSSShorthands.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698