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

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

Issue 14576017: Implement CSS3TextDecorations runtime flag in favor of CSS3_TEXT (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed updated on text-underline-position for now (to be discussed & re-added later) Created 7 years, 7 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/CSSPrimitiveValueMappings.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 ee0e6271bd3f974992dbb809dc02a139dfc1cf83..306b22d167d93bef6ee3de14195edc72aa668129 100644
--- a/Source/core/css/CSSParser.cpp
+++ b/Source/core/css/CSSParser.cpp
@@ -486,13 +486,12 @@ static inline bool isColorPropertyID(CSSPropertyID propertyId)
case CSSPropertyWebkitBorderEndColor:
case CSSPropertyWebkitBorderStartColor:
case CSSPropertyWebkitColumnRuleColor:
-#if ENABLE(CSS3_TEXT)
- case CSSPropertyWebkitTextDecorationColor:
-#endif // CSS3_TEXT
case CSSPropertyWebkitTextEmphasisColor:
case CSSPropertyWebkitTextFillColor:
case CSSPropertyWebkitTextStrokeColor:
return true;
+ case CSSPropertyTextDecorationColor:
+ return RuntimeEnabledFeatures::css3TextDecorationsEnabled();
default:
return false;
}
@@ -1871,16 +1870,18 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important)
case CSSPropertyWebkitBorderBeforeColor:
case CSSPropertyWebkitBorderAfterColor:
case CSSPropertyColor: // <color> | inherit
+ case CSSPropertyTextDecorationColor:
case CSSPropertyTextLineThroughColor: // CSS3 text decoration colors
case CSSPropertyTextUnderlineColor:
case CSSPropertyTextOverlineColor:
case CSSPropertyWebkitColumnRuleColor:
-#if ENABLE(CSS3_TEXT)
- case CSSPropertyWebkitTextDecorationColor:
-#endif // CSS3_TEXT
case CSSPropertyWebkitTextEmphasisColor:
case CSSPropertyWebkitTextFillColor:
case CSSPropertyWebkitTextStrokeColor:
+ if (propId == CSSPropertyTextDecorationColor
+ && !RuntimeEnabledFeatures::css3TextDecorationsEnabled())
+ return false;
+
if (id == CSSValueWebkitText)
validPrimitive = true; // Always allow this, even when strict parsing is on,
// since we use this in our UA sheets.
@@ -2173,17 +2174,21 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important)
// none | [ underline || overline || line-through || blink ] | inherit
return parseTextDecoration(propId, important);
-#if ENABLE(CSS3_TEXT)
- case CSSPropertyWebkitTextDecorationLine:
+ case CSSPropertyTextDecorationLine:
+ if (!RuntimeEnabledFeatures::css3TextDecorationsEnabled())
+ return false;
// none | [ underline || overline || line-through ] | inherit
return parseTextDecoration(propId, important);
- case CSSPropertyWebkitTextDecorationStyle:
+ case CSSPropertyTextDecorationStyle:
+ if (!RuntimeEnabledFeatures::css3TextDecorationsEnabled())
+ return false;
// solid | double | dotted | dashed | wavy
if (id == CSSValueSolid || id == CSSValueDouble || id == CSSValueDotted || id == CSSValueDashed || id == CSSValueWavy)
validPrimitive = true;
break;
+#if ENABLE(CSS3_TEXT)
case CSSPropertyWebkitTextUnderlinePosition:
// auto | alphabetic | under
return parseTextUnderlinePosition(important);
@@ -8806,15 +8811,13 @@ bool CSSParser::parsePerspectiveOrigin(CSSPropertyID propId, CSSPropertyID& prop
void CSSParser::addTextDecorationProperty(CSSPropertyID propId, PassRefPtr<CSSValue> value, bool important)
{
-#if ENABLE(CSS3_TEXT)
// The text-decoration-line property takes priority over text-decoration, unless the latter has important priority set.
if (propId == CSSPropertyTextDecoration && !important && m_currentShorthand == CSSPropertyInvalid) {
for (unsigned i = 0; i < m_parsedProperties.size(); ++i) {
- if (m_parsedProperties[i].id() == CSSPropertyWebkitTextDecorationLine)
+ if (m_parsedProperties[i].id() == CSSPropertyTextDecorationLine)
return;
}
}
-#endif // CSS3_TEXT
addProperty(propId, value, important);
}
@@ -8832,13 +8835,11 @@ bool CSSParser::parseTextDecoration(CSSPropertyID propId, bool important)
while (isValid && value) {
switch (value->id) {
case CSSValueBlink:
-#if ENABLE(CSS3_TEXT)
- // Blink value is not accepted by -webkit-text-decoration-line.
- isValid = propId != CSSPropertyWebkitTextDecorationLine;
+ // Blink value is not accepted by text-decoration-line.
+ isValid = propId != CSSPropertyTextDecorationLine;
if (isValid)
list->append(cssValuePool().createIdentifierValue(value->id));
break;
-#endif // CSS3_TEXT
case CSSValueUnderline:
case CSSValueOverline:
case CSSValueLineThrough:
@@ -8879,7 +8880,7 @@ bool CSSParser::parseTextUnderlinePosition(bool important)
}
return false;
}
-#endif // CSS3_TEXT
+#endif
bool CSSParser::parseTextEmphasisStyle(bool important)
{
« 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