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

Unified Diff: third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp

Issue 1720063002: Spec-compliant shorthand parsing of foo-break-(after,before,inside). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
diff --git a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
index f453d18a1cd72b38a55718161f2166bb9915c030..aec521309d81ae3e2c051c27c245e86eb1b9e2d8 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -4433,10 +4433,7 @@ static inline CSSValueID mapFromPageBreakBetween(CSSValueID value)
{
if (value == CSSValueAlways)
return CSSValuePage;
- // TODO(mstensho): "avoid" should just return "avoid", not "avoid-page", according to the spec.
- if (value == CSSValueAvoid)
- return CSSValueAvoidPage;
- if (value == CSSValueAuto || value == CSSValueLeft || value == CSSValueRight)
+ if (value == CSSValueAuto || value == CSSValueAvoid || value == CSSValueLeft || value == CSSValueRight)
return value;
return CSSValueInvalid;
}
@@ -4445,32 +4442,14 @@ static inline CSSValueID mapFromColumnBreakBetween(CSSValueID value)
{
if (value == CSSValueAlways)
return CSSValueColumn;
- // TODO(mstensho): "avoid" should just return "avoid", not "avoid-column".
- if (value == CSSValueAvoid)
- return CSSValueAvoidColumn;
- // TODO(mstensho): column break properties shouldn't take 'left' and 'right' values (but
- // allowing it for now, since that's what we've always done).
- if (value == CSSValueAuto || value == CSSValueLeft || value == CSSValueRight)
+ if (value == CSSValueAuto || value == CSSValueAvoid)
return value;
return CSSValueInvalid;
}
-static inline CSSValueID mapFromPageBreakInside(CSSValueID value)
+static inline CSSValueID mapFromColumnOrPageBreakInside(CSSValueID value)
{
- // TODO(mstensho): "avoid" should just return "avoid", not "avoid-page", according to the spec.
- if (value == CSSValueAvoid)
- return CSSValueAvoidPage;
- if (value == CSSValueAuto)
- return value;
- return CSSValueInvalid;
-}
-
-static inline CSSValueID mapFromColumnBreakInside(CSSValueID value)
-{
- // TODO(mstensho): "avoid" should just return "avoid", not "avoid-column".
- if (value == CSSValueAvoid)
- return CSSValueAvoidColumn;
- if (value == CSSValueAuto)
+ if (value == CSSValueAuto || value == CSSValueAvoid)
return value;
return CSSValueInvalid;
}
@@ -4506,10 +4485,8 @@ bool CSSPropertyParser::consumeLegacyBreakProperty(CSSPropertyID property, bool
value = mapFromColumnBreakBetween(value);
break;
case CSSPropertyPageBreakInside:
- value = mapFromPageBreakInside(value);
- break;
case CSSPropertyWebkitColumnBreakInside:
- value = mapFromColumnBreakInside(value);
+ value = mapFromColumnOrPageBreakInside(value);
break;
default:
ASSERT_NOT_REACHED();
« no previous file with comments | « third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698