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

Unified Diff: Source/core/css/CSSParser.cpp

Issue 17101024: Add support for CSS3 "text-decoration" shorthand (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Added missing code pointed out by Alexis Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/CSSComputedStyleDeclaration.cpp ('k') | Source/core/css/StylePropertyShorthand.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSParser.cpp
diff --git a/Source/core/css/CSSParser.cpp b/Source/core/css/CSSParser.cpp
index 7fc56703e0ac30392f93629a398a3faab28a06d3..fa7b7abf239c9b46334192c57430380ed6e2dfd9 100644
--- a/Source/core/css/CSSParser.cpp
+++ b/Source/core/css/CSSParser.cpp
@@ -2118,6 +2118,9 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important)
}
case CSSPropertyTextDecoration:
+ // [ <text-decoration-line> || <text-decoration-style> || <text-decoration-color> ] | inherit
+ return parseShorthand(CSSPropertyTextDecoration, textDecorationShorthand(), important);
+
case CSSPropertyWebkitTextDecorationsInEffect:
case CSSPropertyTextDecorationLine:
// none | [ underline || overline || line-through || blink ] | inherit
@@ -8855,7 +8858,7 @@ bool CSSParser::parseTextDecoration(CSSPropertyID propId, bool important)
return false;
CSSParserValue* value = m_valueList->current();
- if (value->id == CSSValueNone) {
+ if (value && value->id == CSSValueNone) {
addTextDecorationProperty(propId, cssValuePool().createIdentifierValue(CSSValueNone), important);
m_valueList->next();
return true;
@@ -8879,7 +8882,8 @@ bool CSSParser::parseTextDecoration(CSSPropertyID propId, bool important)
value = m_valueList->next();
}
- if (list->length() && isValid) {
+ // Values are either valid or in shorthand scope.
+ if (list->length() && (isValid || inShorthand())) {
addTextDecorationProperty(propId, list.release(), important);
return true;
}
« no previous file with comments | « Source/core/css/CSSComputedStyleDeclaration.cpp ('k') | Source/core/css/StylePropertyShorthand.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698