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

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

Issue 2126323002: Add support for touch-action: pinch-zoom. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add exception for mac Created 4 years, 3 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: 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 db811aff923b963f1ce21b4345e7134d9deb362e..6ec988e3340bcecb4ff4d129cd760f1312259d5b 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -981,7 +981,7 @@ static CSSValue* consumeClip(CSSParserTokenRange& range, CSSParserMode cssParser
return CSSQuadValue::create(top, right, bottom, left, CSSQuadValue::SerializeAsRect);
}
-static bool consumePan(CSSParserTokenRange& range, CSSValue*& panX, CSSValue*& panY)
+static bool consumePan(CSSParserTokenRange& range, CSSValue*& panX, CSSValue*& panY, CSSValue*& pinchZoom)
{
CSSValueID id = range.peek().id();
if ((id == CSSValuePanX || id == CSSValuePanRight || id == CSSValuePanLeft) && !panX) {
@@ -992,6 +992,8 @@ static bool consumePan(CSSParserTokenRange& range, CSSValue*& panX, CSSValue*& p
if (id != CSSValuePanY && !RuntimeEnabledFeatures::cssTouchActionPanDirectionsEnabled())
return false;
panY = consumeIdent(range);
+ } else if (id == CSSValuePinchZoom && !pinchZoom && RuntimeEnabledFeatures::cssTouchActionPinchZoomEnabled()) {
+ pinchZoom = consumeIdent(range);
} else {
return false;
}
@@ -1009,15 +1011,20 @@ static CSSValue* consumeTouchAction(CSSParserTokenRange& range)
CSSValue* panX = nullptr;
CSSValue* panY = nullptr;
- if (!consumePan(range, panX, panY))
+ CSSValue* pinchZoom = nullptr;
+ if (!consumePan(range, panX, panY, pinchZoom))
return nullptr;
- if (!range.atEnd() && !consumePan(range, panX, panY))
+ if (!range.atEnd() && !consumePan(range, panX, panY, pinchZoom))
+ return nullptr;
+ if (!range.atEnd() && !consumePan(range, panX, panY, pinchZoom))
return nullptr;
if (panX)
list->append(*panX);
if (panY)
list->append(*panY);
+ if (pinchZoom)
+ list->append(*pinchZoom);
return list;
}

Powered by Google App Engine
This is Rietveld 408576698