Support parsing of additional values for the touch-action property
authorgraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Jan 2019 08:30:53 +0000 (08:30 +0000)
committergraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Jan 2019 08:30:53 +0000 (08:30 +0000)
https://bugs.webkit.org/show_bug.cgi?id=193314
<rdar://problem/47176519>

Reviewed by Dean Jackson.

We add parsing support for the "none", "pan-x", "pan-y" and "pinch-zoom" values of the CSS "touch-action" property.

* WebCore.xcodeproj/project.pbxproj:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::touchActionFlagsToCSSValue):
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator OptionSet<TouchAction> const):
(WebCore::CSSPrimitiveValue::operator TouchAction const): Deleted.
* css/CSSProperties.json:
* css/CSSValueKeywords.in:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertTouchAction):
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeTouchAction):
* dom/Element.cpp:
(WebCore::Element::allowsDoubleTapGesture const):
* platform/TouchAction.h: Added.
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::touchActions const):
(WebCore::RenderStyle::setTouchActions):
(WebCore::RenderStyle::initialTouchActions):
(WebCore::RenderStyle::touchAction const): Deleted.
(WebCore::RenderStyle::setTouchAction): Deleted.
(WebCore::RenderStyle::initialTouchAction): Deleted.
* rendering/style/RenderStyleConstants.h:
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator== const):
* rendering/style/StyleRareNonInheritedData.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239978 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSPrimitiveValueMappings.h
Source/WebCore/css/CSSProperties.json
Source/WebCore/css/CSSValueKeywords.in
Source/WebCore/css/StyleBuilderConverter.h
Source/WebCore/css/parser/CSSParserFastPaths.cpp
Source/WebCore/css/parser/CSSPropertyParser.cpp
Source/WebCore/dom/Element.cpp
Source/WebCore/platform/TouchAction.h [new file with mode: 0644]
Source/WebCore/rendering/style/RenderStyle.h
Source/WebCore/rendering/style/RenderStyleConstants.h
Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
Source/WebCore/rendering/style/StyleRareNonInheritedData.h

index 89ea6c9..7df1688 100644 (file)
@@ -1,3 +1,46 @@
+2019-01-11  Antoine Quint  <graouts@apple.com>
+
+        Support parsing of additional values for the touch-action property
+        https://bugs.webkit.org/show_bug.cgi?id=193314
+        <rdar://problem/47176519>
+
+        Reviewed by Dean Jackson.
+
+        We add parsing support for the "none", "pan-x", "pan-y" and "pinch-zoom" values of the CSS "touch-action" property.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::touchActionFlagsToCSSValue):
+        (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
+        * css/CSSPrimitiveValueMappings.h:
+        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+        (WebCore::CSSPrimitiveValue::operator OptionSet<TouchAction> const):
+        (WebCore::CSSPrimitiveValue::operator TouchAction const): Deleted.
+        * css/CSSProperties.json:
+        * css/CSSValueKeywords.in:
+        * css/StyleBuilderConverter.h:
+        (WebCore::StyleBuilderConverter::convertTouchAction):
+        * css/parser/CSSParserFastPaths.cpp:
+        (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
+        (WebCore::CSSParserFastPaths::isKeywordPropertyID):
+        * css/parser/CSSPropertyParser.cpp:
+        (WebCore::consumeTouchAction):
+        * dom/Element.cpp:
+        (WebCore::Element::allowsDoubleTapGesture const):
+        * platform/TouchAction.h: Added.
+        * rendering/style/RenderStyle.h:
+        (WebCore::RenderStyle::touchActions const):
+        (WebCore::RenderStyle::setTouchActions):
+        (WebCore::RenderStyle::initialTouchActions):
+        (WebCore::RenderStyle::touchAction const): Deleted.
+        (WebCore::RenderStyle::setTouchAction): Deleted.
+        (WebCore::RenderStyle::initialTouchAction): Deleted.
+        * rendering/style/RenderStyleConstants.h:
+        * rendering/style/StyleRareNonInheritedData.cpp:
+        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
+        (WebCore::StyleRareNonInheritedData::operator== const):
+        * rendering/style/StyleRareNonInheritedData.h:
+
 2019-01-15  Devin Rousso  <drousso@apple.com>
 
         Web Inspector: Audit: create new IDL type for exposing special functionality in test context
index 7de2a16..b0ca554 100644 (file)
                71A1B6081DEE5AD70073BCFB /* modern-media-controls-localized-strings.js in Resources */ = {isa = PBXBuildFile; fileRef = 71A1B6061DEE5A820073BCFB /* modern-media-controls-localized-strings.js */; };
                71A57DF2154BE25C0009D120 /* SVGPathUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 71A57DF0154BE25C0009D120 /* SVGPathUtilities.h */; };
                71B28427203CEC4C0036AA5D /* JSCSSAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 71B28426203CEC0D0036AA5D /* JSCSSAnimation.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               71B7EE0D21B5C6870031C1EF /* TouchAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 71AEE4EB21B5A49C00DDB036 /* TouchAction.h */; settings = {ATTRIBUTES = (Private, ); }; };
                71C29E32203CE781008F36D2 /* CSSAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 71C29E30203CE76B008F36D2 /* CSSAnimation.h */; settings = {ATTRIBUTES = (Private, ); }; };
                71C916081D1483A300ACA47D /* UserInterfaceLayoutDirection.h in Headers */ = {isa = PBXBuildFile; fileRef = 71C916071D1483A300ACA47D /* UserInterfaceLayoutDirection.h */; settings = {ATTRIBUTES = (Private, ); }; };
                71DCB7021568197600862271 /* JSSVGZoomAndPan.h in Headers */ = {isa = PBXBuildFile; fileRef = 71DCB7001568197600862271 /* JSSVGZoomAndPan.h */; };
                71A1B6071DEE5A820073BCFB /* en */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = en; path = "en.lproj/modern-media-controls-localized-strings.js"; sourceTree = SOURCE_ROOT; };
                71A57DEF154BE25C0009D120 /* SVGPathUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPathUtilities.cpp; sourceTree = "<group>"; };
                71A57DF0154BE25C0009D120 /* SVGPathUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathUtilities.h; sourceTree = "<group>"; };
+               71AEE4EB21B5A49C00DDB036 /* TouchAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TouchAction.h; sourceTree = "<group>"; };
                71B0460A1DD3C2EE00EE19CF /* status-support.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "status-support.js"; sourceTree = "<group>"; };
                71B28424203CEC0B0036AA5D /* JSCSSAnimation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCSSAnimation.cpp; sourceTree = "<group>"; };
                71B28426203CEC0D0036AA5D /* JSCSSAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCSSAnimation.h; sourceTree = "<group>"; };
                                185BCF270F3279CE000EA262 /* ThreadTimers.h */,
                                93309EA1099EB78C0056E581 /* Timer.cpp */,
                                9305B24C098F1B6B00C28855 /* Timer.h */,
+                               71AEE4EB21B5A49C00DDB036 /* TouchAction.h */,
                                868160D1187669C40021E79D /* UserActivity.cpp */,
                                868160D2187669C40021E79D /* UserActivity.h */,
                                A3AF9D8220325324006CAD06 /* UserAgent.h */,
                                2D7ED0AB1BAE99170043B3E5 /* TimerEventBasedMock.h in Headers */,
                                49E912AE0EFAC906009D0CAF /* TimingFunction.h in Headers */,
                                0F54DD081881D5F5003EEDBB /* Touch.h in Headers */,
+                               71B7EE0D21B5C6870031C1EF /* TouchAction.h in Headers */,
                                0F54DD091881D5F5003EEDBB /* TouchEvent.h in Headers */,
                                0F54DD0A1881D5F5003EEDBB /* TouchList.h in Headers */,
                                070334D71459FFD5008D8D45 /* TrackBase.h in Headers */,
index 9ebc3ab..ca215aa 100644 (file)
@@ -73,6 +73,7 @@
 #include "StyleResolver.h"
 #include "StyleScope.h"
 #include "StyleScrollSnapPoints.h"
+#include "TouchAction.h"
 #include "WebKitFontFamilyNames.h"
 #include "WillChangeData.h"
 #include <wtf/NeverDestroyed.h>
@@ -1746,6 +1747,32 @@ static Ref<CSSPrimitiveValue> valueForFamily(const AtomicString& family)
     return CSSValuePool::singleton().createFontFamilyValue(family);
 }
 
+#if ENABLE(TOUCH_EVENTS)
+static Ref<CSSValue> touchActionFlagsToCSSValue(OptionSet<TouchAction> touchActions)
+{
+    auto& cssValuePool = CSSValuePool::singleton();
+
+    if (touchActions & TouchAction::Auto)
+        return cssValuePool.createIdentifierValue(CSSValueAuto);
+    if (touchActions & TouchAction::None)
+        return cssValuePool.createIdentifierValue(CSSValueNone);
+    if (touchActions & TouchAction::Manipulation)
+        return cssValuePool.createIdentifierValue(CSSValueManipulation);
+
+    auto list = CSSValueList::createSpaceSeparated();
+    if (touchActions & TouchAction::PanX)
+        list->append(cssValuePool.createIdentifierValue(CSSValuePanX));
+    if (touchActions & TouchAction::PanY)
+        list->append(cssValuePool.createIdentifierValue(CSSValuePanY));
+    if (touchActions & TouchAction::PinchZoom)
+        list->append(cssValuePool.createIdentifierValue(CSSValuePinchZoom));
+
+    if (!list->length())
+        return cssValuePool.createIdentifierValue(CSSValueAuto);
+    return WTFMove(list);
+}
+#endif
+
 static Ref<CSSValue> renderTextDecorationFlagsToCSSValue(OptionSet<TextDecoration> textDecoration)
 {
     auto& cssValuePool = CSSValuePool::singleton();
@@ -3732,7 +3759,7 @@ RefPtr<CSSValue> ComputedStyleExtractor::valueForPropertyinStyle(const RenderSty
         case CSSPropertyWebkitTapHighlightColor:
             return currentColorOrValidColor(&style, style.tapHighlightColor());
         case CSSPropertyTouchAction:
-            return cssValuePool.createValue(style.touchAction());
+            return touchActionFlagsToCSSValue(style.touchActions());
 #endif
 #if PLATFORM(IOS_FAMILY)
         case CSSPropertyWebkitTouchCallout:
index c95ff65..efd8423 100644 (file)
@@ -42,6 +42,7 @@
 #include "SVGRenderStyleDefs.h"
 #include "TextFlags.h"
 #include "ThemeTypes.h"
+#include "TouchAction.h"
 #include "UnicodeBidi.h"
 #include "WritingMode.h"
 #include <wtf/MathExtras.h>
@@ -5247,10 +5248,22 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TouchAction touchAction)
     case TouchAction::Manipulation:
         m_value.valueID = CSSValueManipulation;
         break;
+    case TouchAction::None:
+        m_value.valueID = CSSValueNone;
+        break;
+    case TouchAction::PanX:
+        m_value.valueID = CSSValuePanX;
+        break;
+    case TouchAction::PanY:
+        m_value.valueID = CSSValuePanY;
+        break;
+    case TouchAction::PinchZoom:
+        m_value.valueID = CSSValuePinchZoom;
+        break;
     }
 }
 
-template<> inline CSSPrimitiveValue::operator TouchAction() const
+template<> inline CSSPrimitiveValue::operator OptionSet<TouchAction>() const
 {
     ASSERT(isValueID());
     switch (m_value.valueID) {
@@ -5258,6 +5271,14 @@ template<> inline CSSPrimitiveValue::operator TouchAction() const
         return TouchAction::Auto;
     case CSSValueManipulation:
         return TouchAction::Manipulation;
+    case CSSValueNone:
+        return TouchAction::None;
+    case CSSValuePanX:
+        return TouchAction::PanX;
+    case CSSValuePanY:
+        return TouchAction::PanY;
+    case CSSValuePinchZoom:
+        return TouchAction::PinchZoom;
     default:
         break;
     }
index fe012ba..16dd745 100644 (file)
         "touch-action": {
             "values": [
                 "auto",
-                "manipulation"
+                "none",
+                "manipulation",
+                "pan-x",
+                "pan-y",
+                "pinch-zoom"
             ],
             "codegen-properties": {
-                "enable-if": "ENABLE_TOUCH_EVENTS"
+                "name-for-methods": "TouchActions",
+                "enable-if": "ENABLE_TOUCH_EVENTS",
+                "converter": "TouchAction"
             },
             "specification": {
                 "url": "https://www.w3.org/TR/pointerevents/#the-touch-action-css-property"
index 86b5e59..0932190 100644 (file)
@@ -1354,7 +1354,12 @@ scroll-position
 
 #if defined(ENABLE_TOUCH_EVENTS) && ENABLE_TOUCH_EVENTS
 // touch-action
+// auto
+// none
 manipulation
+pan-x
+pan-y
+pinch-zoom
 #endif
 
 // hanging-punctuation
index da000d3..80d81aa 100644 (file)
@@ -52,6 +52,7 @@
 #include "Settings.h"
 #include "StyleResolver.h"
 #include "StyleScrollSnapPoints.h"
+#include "TouchAction.h"
 #include "TransformFunctions.h"
 #include <wtf/Optional.h>
 
@@ -116,6 +117,7 @@ public:
 #endif
 #if ENABLE(TOUCH_EVENTS)
     static Color convertTapHighlightColor(StyleResolver&, const CSSValue&);
+    static OptionSet<TouchAction> convertTouchAction(StyleResolver&, const CSSValue&);
 #endif
 #if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
     static bool convertOverflowScrolling(StyleResolver&, const CSSValue&);
@@ -1345,6 +1347,26 @@ inline Color StyleBuilderConverter::convertTapHighlightColor(StyleResolver& styl
 {
     return styleResolver.colorFromPrimitiveValue(downcast<CSSPrimitiveValue>(value));
 }
+
+inline OptionSet<TouchAction> StyleBuilderConverter::convertTouchAction(StyleResolver&, const CSSValue& value)
+{
+    if (is<CSSPrimitiveValue>(value))
+        return downcast<CSSPrimitiveValue>(value);
+
+    if (is<CSSValueList>(value)) {
+        OptionSet<TouchAction> touchActions;
+        for (auto& currentValue : downcast<CSSValueList>(value)) {
+            auto& primitiveValue = downcast<CSSPrimitiveValue>(currentValue.get());
+            auto primitiveValueID = primitiveValue.valueID();
+            if (primitiveValueID != CSSValuePanX && primitiveValueID != CSSValuePanY && primitiveValueID != CSSValuePinchZoom)
+                return RenderStyle::initialTouchActions();
+            touchActions.add(primitiveValue);
+        }
+        return touchActions;
+    }
+
+    return RenderStyle::initialTouchActions();
+}
 #endif
 
 #if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
index 3835f23..36609b4 100644 (file)
@@ -758,10 +758,6 @@ bool CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyID propertyId
         return valueID == CSSValueNormal || valueID == CSSValueBreakAll || valueID == CSSValueKeepAll || valueID == CSSValueBreakWord;
     case CSSPropertyWebkitBorderFit:
         return valueID == CSSValueBorder || valueID == CSSValueLines;
-#if ENABLE(TOUCH_EVENTS)
-    case CSSPropertyTouchAction: // auto | manipulation
-        return valueID == CSSValueAuto || valueID == CSSValueManipulation;
-#endif
 #if ENABLE(CSS_TRAILING_WORD)
     case CSSPropertyAppleTrailingWord: // auto | -apple-partially-balanced
         return valueID == CSSValueAuto || valueID == CSSValueWebkitPartiallyBalanced;
@@ -941,9 +937,6 @@ bool CSSParserFastPaths::isKeywordPropertyID(CSSPropertyID propertyId)
     case CSSPropertyIsolation:
     case CSSPropertyMixBlendMode:
 #endif
-#if ENABLE(TOUCH_EVENTS)
-    case CSSPropertyTouchAction:
-#endif
 #if ENABLE(CSS_BOX_DECORATION_BREAK)
     case CSSPropertyWebkitBoxDecorationBreak:
 #endif
index 98df418..ec6e003 100644 (file)
@@ -1342,14 +1342,23 @@ static RefPtr<CSSValue> consumeClip(CSSParserTokenRange& range, CSSParserMode cs
 #if ENABLE(TOUCH_EVENTS)
 static RefPtr<CSSValue> consumeTouchAction(CSSParserTokenRange& range)
 {
-    RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
     CSSValueID id = range.peek().id();
-    if (id == CSSValueAuto || id == CSSValueNone || id == CSSValueManipulation) {
-        list->append(consumeIdent(range).releaseNonNull());
-        return list;
+    if (id == CSSValueNone || id == CSSValueAuto || id == CSSValueManipulation)
+        return consumeIdent(range);
+
+    auto list = CSSValueList::createSpaceSeparated();
+    while (true) {
+        auto ident = consumeIdent<CSSValuePanX, CSSValuePanY, CSSValuePinchZoom>(range);
+        if (!ident)
+            break;
+        if (list->hasValue(ident.get()))
+            return nullptr;
+        list->append(ident.releaseNonNull());
     }
-    // FIXME-NEWPARSER: Support pan.
-    return nullptr;
+
+    if (!list->length())
+        return nullptr;
+    return list;
 }
 #endif
 
index 5ff302f..da5cd2f 100644 (file)
 #include "StyleScope.h"
 #include "StyleTreeResolver.h"
 #include "TextIterator.h"
+#include "TouchAction.h"
 #include "VoidCallback.h"
 #include "WebAnimation.h"
 #include "WheelEvent.h"
@@ -1664,7 +1665,7 @@ URL Element::absoluteLinkURL() const
 #if ENABLE(TOUCH_EVENTS)
 bool Element::allowsDoubleTapGesture() const
 {
-    if (renderStyle() && renderStyle()->touchAction() != TouchAction::Auto)
+    if (renderStyle() && renderStyle()->touchActions() != TouchAction::Auto)
         return false;
 
     Element* parent = parentElement();
diff --git a/Source/WebCore/platform/TouchAction.h b/Source/WebCore/platform/TouchAction.h
new file mode 100644 (file)
index 0000000..8682b7f
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+namespace WebCore {
+
+enum class TouchAction : uint8_t {
+    Auto         = 0,
+    None         = 1 << 0,
+    Manipulation = 1 << 1,
+    PanX         = 1 << 2,
+    PanY         = 1 << 3,
+    PinchZoom    = 1 << 4,
+};
+
+}
index 54cbfaa..3d87fbd 100644 (file)
@@ -64,6 +64,7 @@
 #include "StyleVisualData.h"
 #include "TextFlags.h"
 #include "ThemeTypes.h"
+#include "TouchAction.h"
 #include "TransformOperations.h"
 #include "UnicodeBidi.h"
 #include <memory>
@@ -704,7 +705,7 @@ public:
     int initialLetterHeight() const { return initialLetter().height(); }
 
 #if ENABLE(TOUCH_EVENTS)
-    TouchAction touchAction() const { return static_cast<TouchAction>(m_rareNonInheritedData->touchAction); }
+    OptionSet<TouchAction> touchActions() const { return OptionSet<TouchAction>::fromRaw(m_rareNonInheritedData->touchActions); }
 #endif
 
 #if ENABLE(CSS_SCROLL_SNAP)
@@ -1223,7 +1224,7 @@ public:
     void setInitialLetter(const IntSize& size) { SET_VAR(m_rareNonInheritedData, initialLetter, size); }
     
 #if ENABLE(TOUCH_EVENTS)
-    void setTouchAction(TouchAction touchAction) { SET_VAR(m_rareNonInheritedData, touchAction, static_cast<unsigned>(touchAction)); }
+    void setTouchActions(OptionSet<TouchAction> touchActions) { SET_VAR(m_rareNonInheritedData, touchActions, touchActions.toRaw()); }
 #endif
 
 #if ENABLE(CSS_SCROLL_SNAP)
@@ -1619,7 +1620,7 @@ public:
     static WillChangeData* initialWillChange() { return nullptr; }
 
 #if ENABLE(TOUCH_EVENTS)
-    static TouchAction initialTouchAction() { return TouchAction::Auto; }
+    static TouchAction initialTouchActions() { return TouchAction::Auto; }
 #endif
 
 #if ENABLE(CSS_SCROLL_SNAP)
index 66e5c7b..67c7c04 100644 (file)
@@ -1085,13 +1085,6 @@ enum class CSSBoxType : uint8_t {
     ViewBox
 };
 
-#if ENABLE(TOUCH_EVENTS)
-enum class TouchAction : uint8_t {
-    Auto,
-    Manipulation
-};
-#endif
-
 #if ENABLE(CSS_SCROLL_SNAP)
 enum class ScrollSnapStrictness : uint8_t {
     None,
index a312bda..b66c328 100644 (file)
@@ -77,7 +77,7 @@ StyleRareNonInheritedData::StyleRareNonInheritedData()
     , justifySelf(RenderStyle::initialSelfAlignment())
     , customProperties(StyleCustomPropertyData::create())
 #if ENABLE(TOUCH_EVENTS)
-    , touchAction(static_cast<unsigned>(RenderStyle::initialTouchAction()))
+    , touchActions(static_cast<unsigned>(RenderStyle::initialTouchActions()))
 #endif
     , pageSizeType(PAGE_SIZE_AUTO)
     , transformStyle3D(static_cast<unsigned>(RenderStyle::initialTransformStyle3D()))
@@ -171,7 +171,7 @@ inline StyleRareNonInheritedData::StyleRareNonInheritedData(const StyleRareNonIn
     , customProperties(o.customProperties)
     , customPaintWatchedProperties(o.customPaintWatchedProperties ? std::make_unique<HashSet<String>>(*o.customPaintWatchedProperties) : nullptr)
 #if ENABLE(TOUCH_EVENTS)
-    , touchAction(o.touchAction)
+    , touchActions(o.touchActions)
 #endif
     , pageSizeType(o.pageSizeType)
     , transformStyle3D(o.transformStyle3D)
@@ -286,7 +286,7 @@ bool StyleRareNonInheritedData::operator==(const StyleRareNonInheritedData& o) c
         && textCombine == o.textCombine
         && textDecorationStyle == o.textDecorationStyle
 #if ENABLE(TOUCH_EVENTS)
-        && touchAction == o.touchAction
+        && touchActions == o.touchActions
 #endif
 #if ENABLE(CSS_COMPOSITING)
         && effectiveBlendMode == o.effectiveBlendMode
index f9baa14..3111240 100644 (file)
@@ -175,7 +175,7 @@ public:
     std::unique_ptr<HashSet<String>> customPaintWatchedProperties;
 
 #if ENABLE(TOUCH_EVENTS)
-    unsigned touchAction : 1; // TouchAction
+    unsigned touchActions : 5; // TouchAction
 #endif
 
     unsigned pageSizeType : 2; // PageSizeType