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

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: Updated css-properties-as-js-properties.html layout test expectations to match new properties. 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
Index: Source/core/css/CSSParser.cpp
diff --git a/Source/core/css/CSSParser.cpp b/Source/core/css/CSSParser.cpp
index 83af384ce1002c1f1ba2298668e516ae420ccffd..9daa85c53524d8f04909dc2a7fd5e52a8e8cb435 100644
--- a/Source/core/css/CSSParser.cpp
+++ b/Source/core/css/CSSParser.cpp
@@ -485,9 +485,7 @@ 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:
@@ -1884,12 +1882,14 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important)
case CSSPropertyTextUnderlineColor:
case CSSPropertyTextOverlineColor:
case CSSPropertyWebkitColumnRuleColor:
-#if ENABLE(CSS3_TEXT)
case CSSPropertyWebkitTextDecorationColor:
-#endif // CSS3_TEXT
case CSSPropertyWebkitTextEmphasisColor:
case CSSPropertyWebkitTextFillColor:
case CSSPropertyWebkitTextStrokeColor:
+ if (propId == CSSPropertyWebkitTextDecorationColor
+ && !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.
@@ -2182,21 +2182,25 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important)
// none | [ underline || overline || line-through || blink ] | inherit
return parseTextDecoration(propId, important);
-#if ENABLE(CSS3_TEXT)
case CSSPropertyWebkitTextDecorationLine:
+ if (!RuntimeEnabledFeatures::css3TextDecorationsEnabled())
+ return false;
// none | [ underline || overline || line-through ] | inherit
return parseTextDecoration(propId, important);
case CSSPropertyWebkitTextDecorationStyle:
+ if (!RuntimeEnabledFeatures::css3TextDecorationsEnabled())
+ return false;
// solid | double | dotted | dashed | wavy
if (id == CSSValueSolid || id == CSSValueDouble || id == CSSValueDotted || id == CSSValueDashed || id == CSSValueWavy)
validPrimitive = true;
break;
case CSSPropertyWebkitTextUnderlinePosition:
+ if (!RuntimeEnabledFeatures::css3TextDecorationsEnabled())
+ return false;
// auto | alphabetic | under
return parseTextUnderlinePosition(important);
-#endif // CSS3_TEXT
case CSSPropertyZoom: // normal | reset | document | <number> | <percentage> | inherit
if (id == CSSValueNormal || id == CSSValueReset || id == CSSValueDocument)
@@ -8815,7 +8819,6 @@ 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) {
@@ -8823,7 +8826,6 @@ void CSSParser::addTextDecorationProperty(CSSPropertyID propId, PassRefPtr<CSSVa
return;
}
}
-#endif // CSS3_TEXT
addProperty(propId, value, important);
}
@@ -8841,13 +8843,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;
if (isValid)
list->append(cssValuePool().createIdentifierValue(value->id));
break;
-#endif // CSS3_TEXT
case CSSValueUnderline:
case CSSValueOverline:
case CSSValueLineThrough:
@@ -8869,7 +8869,6 @@ bool CSSParser::parseTextDecoration(CSSPropertyID propId, bool important)
return false;
}
-#if ENABLE(CSS3_TEXT)
bool CSSParser::parseTextUnderlinePosition(bool important)
{
// The text-underline-position property has sintax "auto | alphabetic | [ under || [ left | right ] ]".
@@ -8888,7 +8887,6 @@ bool CSSParser::parseTextUnderlinePosition(bool important)
}
return false;
}
-#endif // CSS3_TEXT
bool CSSParser::parseTextEmphasisStyle(bool important)
{

Powered by Google App Engine
This is Rietveld 408576698