Changeset 240472 in webkit


Ignore:
Timestamp:
Jan 25, 2019 3:36:57 AM (5 years ago)
Author:
graouts@webkit.org
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:
Location:
trunk/Source/WebCore
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r240467 r240472  
     12019-01-25  Antoine Quint  <graouts@apple.com>
     2
     3        Use ENABLE_POINTER_EVENTS for the touch-action property
     4        https://bugs.webkit.org/show_bug.cgi?id=193819
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Since we've added an ENABLE_POINTER_EVENTS we should be using it for anything related to the implementation of the
     9        Pointer Events specification of which the touch-action property is a part.
     10
     11        * css/CSSComputedStyleDeclaration.cpp:
     12        (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
     13        * css/CSSPrimitiveValueMappings.h:
     14        * css/CSSProperties.json:
     15        * css/CSSValueKeywords.in:
     16        * css/StyleBuilderConverter.h:
     17        * css/parser/CSSPropertyParser.cpp:
     18        (WebCore::CSSPropertyParser::parseSingleValue):
     19        * dom/Element.cpp:
     20        (WebCore::Element::allowsDoubleTapGesture const):
     21        * platform/TouchAction.h:
     22        * rendering/style/RenderStyle.h:
     23        * rendering/style/StyleRareNonInheritedData.cpp:
     24        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
     25        (WebCore::StyleRareNonInheritedData::operator== const):
     26        * rendering/style/StyleRareNonInheritedData.h:
     27
    1282019-01-24  Zalan Bujtas  <zalan@apple.com>
    229
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r240334 r240472  
    17481748}
    17491749
    1750 #if ENABLE(TOUCH_EVENTS)
     1750#if ENABLE(POINTER_EVENTS)
    17511751static Ref<CSSValue> touchActionFlagsToCSSValue(OptionSet<TouchAction> touchActions)
    17521752{
     
    37633763        case CSSPropertyWebkitTapHighlightColor:
    37643764            return currentColorOrValidColor(&style, style.tapHighlightColor());
     3765#endif
     3766#if ENABLE(POINTER_EVENTS)
    37653767        case CSSPropertyTouchAction:
    37663768            return touchActionFlagsToCSSValue(style.touchActions());
  • trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h

    r239978 r240472  
    52375237}
    52385238
    5239 #if ENABLE(TOUCH_EVENTS)
     5239#if ENABLE(POINTER_EVENTS)
    52405240template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TouchAction touchAction)
    52415241    : CSSValue(PrimitiveClass)
  • trunk/Source/WebCore/css/CSSProperties.json

    r240334 r240472  
    69356935            "codegen-properties": {
    69366936                "name-for-methods": "TouchActions",
    6937                 "enable-if": "ENABLE_TOUCH_EVENTS",
     6937                "enable-if": "ENABLE_POINTER_EVENTS",
    69386938                "converter": "TouchAction"
    69396939            },
  • trunk/Source/WebCore/css/CSSValueKeywords.in

    r239978 r240472  
    13531353//contents
    13541354
    1355 #if defined(ENABLE_TOUCH_EVENTS) && ENABLE_TOUCH_EVENTS
     1355#if defined(ENABLE_POINTER_EVENTS) && ENABLE_POINTER_EVENTS
    13561356// touch-action
    13571357// auto
  • trunk/Source/WebCore/css/StyleBuilderConverter.h

    r239978 r240472  
    118118#if ENABLE(TOUCH_EVENTS)
    119119    static Color convertTapHighlightColor(StyleResolver&, const CSSValue&);
     120#endif
     121#if ENABLE(POINTER_EVENTS)
    120122    static OptionSet<TouchAction> convertTouchAction(StyleResolver&, const CSSValue&);
    121123#endif
     
    13481350    return styleResolver.colorFromPrimitiveValue(downcast<CSSPrimitiveValue>(value));
    13491351}
    1350 
     1352#endif
     1353
     1354#if ENABLE(POINTER_EVENTS)
    13511355inline OptionSet<TouchAction> StyleBuilderConverter::convertTouchAction(StyleResolver&, const CSSValue& value)
    13521356{
  • trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp

    r240334 r240472  
    13481348}
    13491349
    1350 #if ENABLE(TOUCH_EVENTS)
     1350#if ENABLE(POINTER_EVENTS)
    13511351static RefPtr<CSSValue> consumeTouchAction(CSSParserTokenRange& range)
    13521352{
     
    40394039    case CSSPropertyClip:
    40404040        return consumeClip(m_range, m_context.mode);
    4041 #if ENABLE(TOUCH_EVENTS)
     4041#if ENABLE(POINTER_EVENTS)
    40424042    case CSSPropertyTouchAction:
    40434043        return consumeTouchAction(m_range);
  • trunk/Source/WebCore/dom/Element.cpp

    r240237 r240472  
    16661666bool Element::allowsDoubleTapGesture() const
    16671667{
     1668#if ENABLE(POINTER_EVENTS)
    16681669    if (renderStyle() && renderStyle()->touchActions() != TouchAction::Auto)
    16691670        return false;
     1671#endif
    16701672
    16711673    Element* parent = parentElement();
  • trunk/Source/WebCore/platform/TouchAction.h

    r239978 r240472  
    2626#pragma once
    2727
     28#if ENABLE(POINTER_EVENTS)
     29
    2830namespace WebCore {
    2931
     
    3840
    3941}
     42
     43#endif // ENABLE(POINTER_EVENTS)
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r239978 r240472  
    705705    int initialLetterHeight() const { return initialLetter().height(); }
    706706
    707 #if ENABLE(TOUCH_EVENTS)
     707#if ENABLE(POINTER_EVENTS)
    708708    OptionSet<TouchAction> touchActions() const { return OptionSet<TouchAction>::fromRaw(m_rareNonInheritedData->touchActions); }
    709709#endif
     
    12241224    void setInitialLetter(const IntSize& size) { SET_VAR(m_rareNonInheritedData, initialLetter, size); }
    12251225   
    1226 #if ENABLE(TOUCH_EVENTS)
     1226#if ENABLE(POINTER_EVENTS)
    12271227    void setTouchActions(OptionSet<TouchAction> touchActions) { SET_VAR(m_rareNonInheritedData, touchActions, touchActions.toRaw()); }
    12281228#endif
     
    16201620    static WillChangeData* initialWillChange() { return nullptr; }
    16211621
    1622 #if ENABLE(TOUCH_EVENTS)
     1622#if ENABLE(POINTER_EVENTS)
    16231623    static TouchAction initialTouchActions() { return TouchAction::Auto; }
    16241624#endif
  • trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp

    r239978 r240472  
    7777    , justifySelf(RenderStyle::initialSelfAlignment())
    7878    , customProperties(StyleCustomPropertyData::create())
    79 #if ENABLE(TOUCH_EVENTS)
     79#if ENABLE(POINTER_EVENTS)
    8080    , touchActions(static_cast<unsigned>(RenderStyle::initialTouchActions()))
    8181#endif
     
    171171    , customProperties(o.customProperties)
    172172    , customPaintWatchedProperties(o.customPaintWatchedProperties ? std::make_unique<HashSet<String>>(*o.customPaintWatchedProperties) : nullptr)
    173 #if ENABLE(TOUCH_EVENTS)
     173#if ENABLE(POINTER_EVENTS)
    174174    , touchActions(o.touchActions)
    175175#endif
     
    286286        && textCombine == o.textCombine
    287287        && textDecorationStyle == o.textDecorationStyle
    288 #if ENABLE(TOUCH_EVENTS)
     288#if ENABLE(POINTER_EVENTS)
    289289        && touchActions == o.touchActions
    290290#endif
  • trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h

    r239978 r240472  
    175175    std::unique_ptr<HashSet<String>> customPaintWatchedProperties;
    176176
    177 #if ENABLE(TOUCH_EVENTS)
     177#if ENABLE(POINTER_EVENTS)
    178178    unsigned touchActions : 5; // TouchAction
    179179#endif
Note: See TracChangeset for help on using the changeset viewer.