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

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

Issue 15748002: Initial support for experimental touch-action CSS feature (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update for generated StyleBuilder just relanded in r150951 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 83246da05126621579ab9bff0dbbc369bd42c317..dbf22344fc384860934794677b4a43d619941201 100644
--- a/Source/core/css/CSSParser.cpp
+++ b/Source/core/css/CSSParser.cpp
@@ -209,6 +209,7 @@ CSSParserContext::CSSParserContext(CSSParserMode mode, const KURL& baseURL)
, isCSSStickyPositionEnabled(false)
, isCSSGridLayoutEnabled(false)
, isCSSVariablesEnabled(false)
+ , isCSSTouchActionEnabled(false)
, needsSiteSpecificQuirks(false)
{
}
@@ -222,6 +223,7 @@ CSSParserContext::CSSParserContext(Document* document, const KURL& baseURL, cons
, isCSSStickyPositionEnabled(document->cssStickyPositionEnabled())
, isCSSGridLayoutEnabled(document->cssGridLayoutEnabled())
, isCSSVariablesEnabled(document->settings() ? document->settings()->cssVariablesEnabled() : false)
+ , isCSSTouchActionEnabled(RuntimeEnabledFeatures::cssTouchActionEnabled())
, needsSiteSpecificQuirks(document->settings() ? document->settings()->needsSiteSpecificQuirks() : false)
{
}
@@ -236,6 +238,7 @@ bool operator==(const CSSParserContext& a, const CSSParserContext& b)
&& a.isCSSStickyPositionEnabled == b.isCSSStickyPositionEnabled
&& a.isCSSGridLayoutEnabled == b.isCSSGridLayoutEnabled
&& a.isCSSVariablesEnabled == b.isCSSVariablesEnabled
+ && a.isCSSTouchActionEnabled == b.isCSSTouchActionEnabled
&& a.needsSiteSpecificQuirks == b.needsSiteSpecificQuirks;
}
@@ -708,6 +711,10 @@ static inline bool isValidKeywordPropertyAndValue(CSSPropertyID propertyId, int
if ((valueID >= CSSValueCapitalize && valueID <= CSSValueLowercase) || valueID == CSSValueNone)
return true;
break;
+ case CSSPropertyTouchAction: // auto | none
+ if (parserContext.isCSSTouchActionEnabled && (valueID == CSSValueAuto || valueID == CSSValueNone))
+ return true;
+ break;
case CSSPropertyVisibility: // visible | hidden | collapse | inherit
if (valueID == CSSValueVisible || valueID == CSSValueHidden || valueID == CSSValueCollapse)
return true;
@@ -970,6 +977,7 @@ static inline bool isKeywordPropertyID(CSSPropertyID propertyId)
case CSSPropertyTextTransform:
case CSSPropertyTextUnderlineMode:
case CSSPropertyTextUnderlineStyle:
+ case CSSPropertyTouchAction:
case CSSPropertyVisibility:
case CSSPropertyWebkitAppearance:
case CSSPropertyWebkitBackfaceVisibility:
@@ -2769,6 +2777,7 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important)
case CSSPropertyTextTransform:
case CSSPropertyTextUnderlineMode:
case CSSPropertyTextUnderlineStyle:
+ case CSSPropertyTouchAction:
case CSSPropertyVariable:
case CSSPropertyVisibility:
case CSSPropertyWebkitAppearance:

Powered by Google App Engine
This is Rietveld 408576698