Title: [240472] trunk/Source/WebCore
Revision
240472
Author
[email protected]
Date
2019-01-25 03:36:57 -0800 (Fri, 25 Jan 2019)

Log Message

Use ENABLE_POINTER_EVENTS for the touch-action property
https://bugs.webkit.org/show_bug.cgi?id=193819

Reviewed by Antti Koivisto.

Since we've added an ENABLE_POINTER_EVENTS we should be using it for anything related to the implementation of the
Pointer Events specification of which the touch-action property is a part.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSPrimitiveValueMappings.h:
* css/CSSProperties.json:
* css/CSSValueKeywords.in:
* css/StyleBuilderConverter.h:
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
* dom/Element.cpp:
(WebCore::Element::allowsDoubleTapGesture const):
* platform/TouchAction.h:
* rendering/style/RenderStyle.h:
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator== const):
* rendering/style/StyleRareNonInheritedData.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (240471 => 240472)


--- trunk/Source/WebCore/ChangeLog	2019-01-25 09:27:50 UTC (rev 240471)
+++ trunk/Source/WebCore/ChangeLog	2019-01-25 11:36:57 UTC (rev 240472)
@@ -1,3 +1,30 @@
+2019-01-25  Antoine Quint  <[email protected]>
+
+        Use ENABLE_POINTER_EVENTS for the touch-action property
+        https://bugs.webkit.org/show_bug.cgi?id=193819
+
+        Reviewed by Antti Koivisto.
+
+        Since we've added an ENABLE_POINTER_EVENTS we should be using it for anything related to the implementation of the
+        Pointer Events specification of which the touch-action property is a part.
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
+        * css/CSSPrimitiveValueMappings.h:
+        * css/CSSProperties.json:
+        * css/CSSValueKeywords.in:
+        * css/StyleBuilderConverter.h:
+        * css/parser/CSSPropertyParser.cpp:
+        (WebCore::CSSPropertyParser::parseSingleValue):
+        * dom/Element.cpp:
+        (WebCore::Element::allowsDoubleTapGesture const):
+        * platform/TouchAction.h:
+        * rendering/style/RenderStyle.h:
+        * rendering/style/StyleRareNonInheritedData.cpp:
+        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
+        (WebCore::StyleRareNonInheritedData::operator== const):
+        * rendering/style/StyleRareNonInheritedData.h:
+
 2019-01-24  Zalan Bujtas  <[email protected]>
 
         [LFC][BFC][MarginCollapsing] Refactor MarginCollapse::updateCollapsedMarginAfter

Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (240471 => 240472)


--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2019-01-25 09:27:50 UTC (rev 240471)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2019-01-25 11:36:57 UTC (rev 240472)
@@ -1747,7 +1747,7 @@
     return CSSValuePool::singleton().createFontFamilyValue(family);
 }
 
-#if ENABLE(TOUCH_EVENTS)
+#if ENABLE(POINTER_EVENTS)
 static Ref<CSSValue> touchActionFlagsToCSSValue(OptionSet<TouchAction> touchActions)
 {
     auto& cssValuePool = CSSValuePool::singleton();
@@ -3762,6 +3762,8 @@
 #if ENABLE(TOUCH_EVENTS)
         case CSSPropertyWebkitTapHighlightColor:
             return currentColorOrValidColor(&style, style.tapHighlightColor());
+#endif
+#if ENABLE(POINTER_EVENTS)
         case CSSPropertyTouchAction:
             return touchActionFlagsToCSSValue(style.touchActions());
 #endif

Modified: trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h (240471 => 240472)


--- trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h	2019-01-25 09:27:50 UTC (rev 240471)
+++ trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h	2019-01-25 11:36:57 UTC (rev 240472)
@@ -5236,7 +5236,7 @@
     m_value.valueID = CSSValueNormal;
 }
 
-#if ENABLE(TOUCH_EVENTS)
+#if ENABLE(POINTER_EVENTS)
 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TouchAction touchAction)
     : CSSValue(PrimitiveClass)
 {

Modified: trunk/Source/WebCore/css/CSSProperties.json (240471 => 240472)


--- trunk/Source/WebCore/css/CSSProperties.json	2019-01-25 09:27:50 UTC (rev 240471)
+++ trunk/Source/WebCore/css/CSSProperties.json	2019-01-25 11:36:57 UTC (rev 240472)
@@ -6934,7 +6934,7 @@
             ],
             "codegen-properties": {
                 "name-for-methods": "TouchActions",
-                "enable-if": "ENABLE_TOUCH_EVENTS",
+                "enable-if": "ENABLE_POINTER_EVENTS",
                 "converter": "TouchAction"
             },
             "specification": {

Modified: trunk/Source/WebCore/css/CSSValueKeywords.in (240471 => 240472)


--- trunk/Source/WebCore/css/CSSValueKeywords.in	2019-01-25 09:27:50 UTC (rev 240471)
+++ trunk/Source/WebCore/css/CSSValueKeywords.in	2019-01-25 11:36:57 UTC (rev 240472)
@@ -1352,7 +1352,7 @@
 scroll-position
 //contents
 
-#if defined(ENABLE_TOUCH_EVENTS) && ENABLE_TOUCH_EVENTS
+#if defined(ENABLE_POINTER_EVENTS) && ENABLE_POINTER_EVENTS
 // touch-action
 // auto
 // none

Modified: trunk/Source/WebCore/css/StyleBuilderConverter.h (240471 => 240472)


--- trunk/Source/WebCore/css/StyleBuilderConverter.h	2019-01-25 09:27:50 UTC (rev 240471)
+++ trunk/Source/WebCore/css/StyleBuilderConverter.h	2019-01-25 11:36:57 UTC (rev 240472)
@@ -117,6 +117,8 @@
 #endif
 #if ENABLE(TOUCH_EVENTS)
     static Color convertTapHighlightColor(StyleResolver&, const CSSValue&);
+#endif
+#if ENABLE(POINTER_EVENTS)
     static OptionSet<TouchAction> convertTouchAction(StyleResolver&, const CSSValue&);
 #endif
 #if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
@@ -1347,7 +1349,9 @@
 {
     return styleResolver.colorFromPrimitiveValue(downcast<CSSPrimitiveValue>(value));
 }
+#endif
 
+#if ENABLE(POINTER_EVENTS)
 inline OptionSet<TouchAction> StyleBuilderConverter::convertTouchAction(StyleResolver&, const CSSValue& value)
 {
     if (is<CSSPrimitiveValue>(value))

Modified: trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp (240471 => 240472)


--- trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp	2019-01-25 09:27:50 UTC (rev 240471)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp	2019-01-25 11:36:57 UTC (rev 240472)
@@ -1347,7 +1347,7 @@
     return CSSValuePool::singleton().createValue(WTFMove(rect));
 }
 
-#if ENABLE(TOUCH_EVENTS)
+#if ENABLE(POINTER_EVENTS)
 static RefPtr<CSSValue> consumeTouchAction(CSSParserTokenRange& range)
 {
     CSSValueID id = range.peek().id();
@@ -4038,7 +4038,7 @@
 #endif
     case CSSPropertyClip:
         return consumeClip(m_range, m_context.mode);
-#if ENABLE(TOUCH_EVENTS)
+#if ENABLE(POINTER_EVENTS)
     case CSSPropertyTouchAction:
         return consumeTouchAction(m_range);
 #endif

Modified: trunk/Source/WebCore/dom/Element.cpp (240471 => 240472)


--- trunk/Source/WebCore/dom/Element.cpp	2019-01-25 09:27:50 UTC (rev 240471)
+++ trunk/Source/WebCore/dom/Element.cpp	2019-01-25 11:36:57 UTC (rev 240472)
@@ -1665,8 +1665,10 @@
 #if ENABLE(TOUCH_EVENTS)
 bool Element::allowsDoubleTapGesture() const
 {
+#if ENABLE(POINTER_EVENTS)
     if (renderStyle() && renderStyle()->touchActions() != TouchAction::Auto)
         return false;
+#endif
 
     Element* parent = parentElement();
     return !parent || parent->allowsDoubleTapGesture();

Modified: trunk/Source/WebCore/platform/TouchAction.h (240471 => 240472)


--- trunk/Source/WebCore/platform/TouchAction.h	2019-01-25 09:27:50 UTC (rev 240471)
+++ trunk/Source/WebCore/platform/TouchAction.h	2019-01-25 11:36:57 UTC (rev 240472)
@@ -25,6 +25,8 @@
 
 #pragma once
 
+#if ENABLE(POINTER_EVENTS)
+
 namespace WebCore {
 
 enum class TouchAction : uint8_t {
@@ -37,3 +39,5 @@
 };
 
 }
+
+#endif // ENABLE(POINTER_EVENTS)

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (240471 => 240472)


--- trunk/Source/WebCore/rendering/style/RenderStyle.h	2019-01-25 09:27:50 UTC (rev 240471)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h	2019-01-25 11:36:57 UTC (rev 240472)
@@ -704,7 +704,7 @@
     int initialLetterDrop() const { return initialLetter().width(); }
     int initialLetterHeight() const { return initialLetter().height(); }
 
-#if ENABLE(TOUCH_EVENTS)
+#if ENABLE(POINTER_EVENTS)
     OptionSet<TouchAction> touchActions() const { return OptionSet<TouchAction>::fromRaw(m_rareNonInheritedData->touchActions); }
 #endif
 
@@ -1223,7 +1223,7 @@
     
     void setInitialLetter(const IntSize& size) { SET_VAR(m_rareNonInheritedData, initialLetter, size); }
     
-#if ENABLE(TOUCH_EVENTS)
+#if ENABLE(POINTER_EVENTS)
     void setTouchActions(OptionSet<TouchAction> touchActions) { SET_VAR(m_rareNonInheritedData, touchActions, touchActions.toRaw()); }
 #endif
 
@@ -1619,7 +1619,7 @@
 
     static WillChangeData* initialWillChange() { return nullptr; }
 
-#if ENABLE(TOUCH_EVENTS)
+#if ENABLE(POINTER_EVENTS)
     static TouchAction initialTouchActions() { return TouchAction::Auto; }
 #endif
 

Modified: trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp (240471 => 240472)


--- trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp	2019-01-25 09:27:50 UTC (rev 240471)
+++ trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp	2019-01-25 11:36:57 UTC (rev 240472)
@@ -76,7 +76,7 @@
     , justifyItems(RenderStyle::initialJustifyItems())
     , justifySelf(RenderStyle::initialSelfAlignment())
     , customProperties(StyleCustomPropertyData::create())
-#if ENABLE(TOUCH_EVENTS)
+#if ENABLE(POINTER_EVENTS)
     , touchActions(static_cast<unsigned>(RenderStyle::initialTouchActions()))
 #endif
     , pageSizeType(PAGE_SIZE_AUTO)
@@ -170,7 +170,7 @@
     , justifySelf(o.justifySelf)
     , customProperties(o.customProperties)
     , customPaintWatchedProperties(o.customPaintWatchedProperties ? std::make_unique<HashSet<String>>(*o.customPaintWatchedProperties) : nullptr)
-#if ENABLE(TOUCH_EVENTS)
+#if ENABLE(POINTER_EVENTS)
     , touchActions(o.touchActions)
 #endif
     , pageSizeType(o.pageSizeType)
@@ -285,7 +285,7 @@
         && borderFit == o.borderFit
         && textCombine == o.textCombine
         && textDecorationStyle == o.textDecorationStyle
-#if ENABLE(TOUCH_EVENTS)
+#if ENABLE(POINTER_EVENTS)
         && touchActions == o.touchActions
 #endif
 #if ENABLE(CSS_COMPOSITING)

Modified: trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h (240471 => 240472)


--- trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h	2019-01-25 09:27:50 UTC (rev 240471)
+++ trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h	2019-01-25 11:36:57 UTC (rev 240472)
@@ -174,7 +174,7 @@
     DataRef<StyleCustomPropertyData> customProperties;
     std::unique_ptr<HashSet<String>> customPaintWatchedProperties;
 
-#if ENABLE(TOUCH_EVENTS)
+#if ENABLE(POINTER_EVENTS)
     unsigned touchActions : 5; // TouchAction
 #endif
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to