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

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

Issue 1485973005: Add CSS support for Containment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test expectation Created 5 years 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: 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 f7d85192a4c1635707a1a137d42d8ecccab73255..0f8afaf86166739a6089456166b894a8faea09dd 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -1779,6 +1779,30 @@ static PassRefPtrWillBeRawPtr<CSSValue> consumeTextDecorationLine(CSSParserToken
return list.release();
}
+// none | strict | [ layout || style || paint ]
+static PassRefPtrWillBeRawPtr<CSSValue> consumeContain(CSSParserTokenRange& range)
+{
+ CSSValueID id = range.peek().id();
+ if (id == CSSValueNone)
+ return consumeIdent(range);
+
+ RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
+ if (id == CSSValueStrict) {
+ list->append(consumeIdent(range));
+ return list.release();
+ }
+ RefPtrWillBeRawPtr<CSSPrimitiveValue> ident = nullptr;
+ while ((ident = consumeIdent<CSSValuePaint, CSSValueLayout, CSSValueStyle>(range))) {
+ if (list->hasValue(ident.get()))
+ return nullptr;
+ list->append(ident.release());
+ }
+
+ if (!list->length())
+ return nullptr;
+ return list.release();
+}
+
static PassRefPtrWillBeRawPtr<CSSValue> consumeMotionPath(CSSParserTokenRange& range)
{
CSSValueID id = range.peek().id();
@@ -2445,6 +2469,8 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSProperty
return consumeLengthOrPercent(m_range, SVGAttributeMode, ValueRangeAll, UnitlessQuirk::Forbid);
case CSSPropertyCursor:
return consumeCursor(m_range);
+ case CSSPropertyContain:
+ return consumeContain(m_range);
default:
return nullptr;
}

Powered by Google App Engine
This is Rietveld 408576698