Changeset 261253 in webkit


Ignore:
Timestamp:
May 6, 2020 3:43:00 PM (4 years ago)
Author:
Ryan Haddad
Message:

Unreviewed, reverting r261239.

Caused fast/events/wheel-event-outside-body.html to assert on
macOS WK1

Reverted changeset:

"Add basic support for generating accurate wheel event
listener region"
https://bugs.webkit.org/show_bug.cgi?id=211512
https://trac.webkit.org/changeset/261239

Location:
trunk
Files:
2 deleted
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r261251 r261253  
     12020-05-06  Ryan Haddad  <ryanhaddad@apple.com>
     2
     3        Unreviewed, reverting r261239.
     4
     5        Caused fast/events/wheel-event-outside-body.html to assert on
     6        macOS WK1
     7
     8        Reverted changeset:
     9
     10        "Add basic support for generating accurate wheel event
     11        listener region"
     12        https://bugs.webkit.org/show_bug.cgi?id=211512
     13        https://trac.webkit.org/changeset/261239
     14
    1152020-05-06  Tim Horton  <timothy_horton@apple.com>
    216
  • trunk/Source/WebCore/ChangeLog

    r261252 r261253  
     12020-05-06  Ryan Haddad  <ryanhaddad@apple.com>
     2
     3        Unreviewed, reverting r261239.
     4
     5        Caused fast/events/wheel-event-outside-body.html to assert on
     6        macOS WK1
     7
     8        Reverted changeset:
     9
     10        "Add basic support for generating accurate wheel event
     11        listener region"
     12        https://bugs.webkit.org/show_bug.cgi?id=211512
     13        https://trac.webkit.org/changeset/261239
     14
    1152020-05-06  Chris Dumez  <cdumez@apple.com>
    216
  • trunk/Source/WebCore/dom/Node.h

    r261239 r261253  
    483483#endif
    484484
    485     using EventTarget::eventTargetData;
    486485    EventTargetData* eventTargetData() final;
    487486    EventTargetData* eventTargetDataConcurrently() final;
  • trunk/Source/WebCore/rendering/EventRegion.cpp

    r261239 r261253  
    113113
    114114    uniteTouchActions(region, style.effectiveTouchActions());
    115     uniteEventListeners(region, style.eventListenerRegionTypes());
    116115
    117116#if ENABLE(EDITABLE_REGION)
     
    222221}
    223222
    224 void EventRegion::uniteEventListeners(const Region& region, OptionSet<EventListenerRegionType> eventListenerRegionTypes)
    225 {
    226     if (eventListenerRegionTypes.contains(EventListenerRegionType::Wheel))
    227         m_wheelEventListenerRegion.unite(region);
    228     if (eventListenerRegionTypes.contains(EventListenerRegionType::NonPassiveWheel))
    229         m_nonPassiveWheelEventListenerRegion.unite(region);
    230 }
    231 
    232223#if ENABLE(EDITABLE_REGION)
    233224
     
    252243            ts << indent << "(" << toTouchAction(i);
    253244            ts << indent << m_touchActionRegions[i];
    254             ts << indent << ")\n";
    255         }
    256         ts << indent << ")\n";
    257     }
    258 
    259     if (!m_wheelEventListenerRegion.isEmpty()) {
    260         ts << indent << "(wheel event listener region" << m_wheelEventListenerRegion;
    261         if (!m_nonPassiveWheelEventListenerRegion.isEmpty()) {
    262             TextStream::IndentScope indentScope(ts);
    263             ts << indent << "(non-passive" << m_nonPassiveWheelEventListenerRegion;
    264245            ts << indent << ")\n";
    265246        }
  • trunk/Source/WebCore/rendering/EventRegion.h

    r261239 r261253  
    2828#include "AffineTransform.h"
    2929#include "Region.h"
    30 #include "RenderStyleConstants.h"
    3130#include "TouchAction.h"
    3231#include <wtf/OptionSet.h>
     
    7877    bool hasTouchActions() const { return !m_touchActionRegions.isEmpty(); }
    7978    WEBCORE_EXPORT OptionSet<TouchAction> touchActionsForPoint(const IntPoint&) const;
     79
    8080    const Region* regionForTouchAction(TouchAction) const;
    8181
     
    9494private:
    9595    void uniteTouchActions(const Region&, OptionSet<TouchAction>);
    96     void uniteEventListeners(const Region&, OptionSet<EventListenerRegionType>);
    9796
    9897    Region m_region;
    9998    Vector<Region> m_touchActionRegions;
    100     Region m_wheelEventListenerRegion;
    101     Region m_nonPassiveWheelEventListenerRegion;
    10299#if ENABLE(EDITABLE_REGION)
    103100    Region m_editableRegion;
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r261239 r261253  
    16691669            return true;
    16701670#endif
    1671 #if !PLATFORM(IOS_FAMILY)
    1672         if (renderer().document().wheelEventTargets())
    1673             return true;
    1674 #endif
    16751671        if (m_owningLayer.isRenderViewLayer())
    16761672            return false;
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r261239 r261253  
    692692    int initialLetterHeight() const { return initialLetter().height(); }
    693693
    694     OptionSet<TouchAction> touchActions() const { return m_rareNonInheritedData->touchActions; }
     694    OptionSet<TouchAction> touchActions() const { return OptionSet<TouchAction>::fromRaw(m_rareNonInheritedData->touchActions); }
    695695    // 'touch-action' behavior depends on values in ancestors. We use an additional inherited property to implement that.
    696     OptionSet<TouchAction> effectiveTouchActions() const { return m_rareInheritedData->effectiveTouchActions; }
    697     OptionSet<EventListenerRegionType> eventListenerRegionTypes() const { return m_rareInheritedData->eventListenerRegionTypes; }
     696    OptionSet<TouchAction> effectiveTouchActions() const { return OptionSet<TouchAction>::fromRaw(m_rareInheritedData->effectiveTouchActions); }
    698697
    699698#if ENABLE(CSS_SCROLL_SNAP)
     
    12281227    void setInitialLetter(const IntSize& size) { SET_VAR(m_rareNonInheritedData, initialLetter, size); }
    12291228   
    1230     void setTouchActions(OptionSet<TouchAction> touchActions) { SET_VAR(m_rareNonInheritedData, touchActions, touchActions); }
    1231     void setEffectiveTouchActions(OptionSet<TouchAction> touchActions) { SET_VAR(m_rareInheritedData, effectiveTouchActions, touchActions); }
    1232     void setEventListenerRegionTypes(OptionSet<EventListenerRegionType> eventListenerTypes) { SET_VAR(m_rareInheritedData, eventListenerRegionTypes, eventListenerTypes); }
     1229    void setTouchActions(OptionSet<TouchAction> touchActions) { SET_VAR(m_rareNonInheritedData, touchActions, touchActions.toRaw()); }
     1230    void setEffectiveTouchActions(OptionSet<TouchAction> touchActions) { SET_VAR(m_rareInheritedData, effectiveTouchActions, touchActions.toRaw()); }
    12331231
    12341232#if ENABLE(CSS_SCROLL_SNAP)
  • trunk/Source/WebCore/rendering/style/RenderStyleConstants.h

    r261239 r261253  
    11791179    Fallback,
    11801180    Optional
    1181 };
    1182 
    1183 enum class EventListenerRegionType : uint8_t {
    1184     Wheel           = 1 << 0,
    1185     NonPassiveWheel = 1 << 1,
    11861181};
    11871182
  • trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp

    r261239 r261253  
    134134    , hasSetStrokeWidth(false)
    135135    , hasSetStrokeColor(false)
    136     , effectiveTouchActions(RenderStyle::initialTouchActions())
     136    , effectiveTouchActions(static_cast<unsigned>(RenderStyle::initialTouchActions()))
    137137    , strokeWidth(RenderStyle::initialStrokeWidth())
    138138    , strokeColor(RenderStyle::initialStrokeColor())
     
    229229    , hasSetStrokeColor(o.hasSetStrokeColor)
    230230    , effectiveTouchActions(o.effectiveTouchActions)
    231     , eventListenerRegionTypes(o.eventListenerRegionTypes)
    232231    , strokeWidth(o.strokeWidth)
    233232    , strokeColor(o.strokeColor)
     
    351350        && hasSetStrokeColor == o.hasSetStrokeColor
    352351        && effectiveTouchActions == o.effectiveTouchActions
    353         && eventListenerRegionTypes == o.eventListenerRegionTypes
    354352        && strokeWidth == o.strokeWidth
    355353        && strokeColor == o.strokeColor
  • trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h

    r261239 r261253  
    3131#include "TextDecorationThickness.h"
    3232#include "TextUnderlineOffset.h"
    33 #include "TouchAction.h"
    3433#include <wtf/DataRef.h>
    3534#include <wtf/RefCounted.h>
     
    156155    unsigned hasSetStrokeColor : 1;
    157156
    158     OptionSet<TouchAction> effectiveTouchActions;
    159     OptionSet<EventListenerRegionType> eventListenerRegionTypes;
     157    unsigned effectiveTouchActions : 6; // OptionSet<TouchAction>
    160158
    161159    Length strokeWidth;
  • trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp

    r261239 r261253  
    8282    , justifySelf(RenderStyle::initialSelfAlignment())
    8383    , customProperties(StyleCustomPropertyData::create())
    84     , touchActions(RenderStyle::initialTouchActions())
     84    , touchActions(static_cast<unsigned>(RenderStyle::initialTouchActions()))
    8585    , pageSizeType(PAGE_SIZE_AUTO)
    8686    , transformStyle3D(static_cast<unsigned>(RenderStyle::initialTransformStyle3D()))
  • trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h

    r261239 r261253  
    174174    std::unique_ptr<HashSet<String>> customPaintWatchedProperties;
    175175
    176     OptionSet<TouchAction> touchActions;
     176    unsigned touchActions : 6; // TouchAction
    177177
    178178    unsigned pageSizeType : 2; // PageSizeType
  • trunk/Source/WebCore/style/StyleAdjuster.cpp

    r261239 r261253  
    3434#include "CSSFontSelector.h"
    3535#include "Element.h"
    36 #include "EventNames.h"
    3736#include "FrameView.h"
    3837#include "HTMLDivElement.h"
     
    194193}
    195194
    196 static OptionSet<EventListenerRegionType> computeEventListenerRegionTypes(const Element& element, OptionSet<EventListenerRegionType> parentTypes)
    197 {
    198 #if !PLATFORM(IOS_FAMILY)
    199     if (!element.hasEventListeners())
    200         return parentTypes;
    201 
    202     auto types = parentTypes;
    203 
    204     auto findListeners = [&](auto& eventName, auto type, auto nonPassiveType) {
    205         auto* eventListenerVector = element.eventTargetData()->eventListenerMap.find(eventName);
    206         if (!eventListenerVector)
    207             return;
    208 
    209         types.add(type);
    210 
    211         auto isPassiveOnly = [&] {
    212             for (auto& listener : *eventListenerVector) {
    213                 if (!listener->isPassive())
    214                     return false;
    215             }
    216             return true;
    217         }();
    218 
    219         if (!isPassiveOnly)
    220             types.add(nonPassiveType);
    221     };
    222 
    223     findListeners(eventNames().wheelEvent, EventListenerRegionType::Wheel, EventListenerRegionType::NonPassiveWheel);
    224     findListeners(eventNames().mousewheelEvent, EventListenerRegionType::Wheel, EventListenerRegionType::NonPassiveWheel);
    225 
    226     return types;
    227 #else
    228     UNUSED_PARAM(element);
    229     UNUSED_PARAM(parentTypes);
    230     return { };
    231 #endif
    232 }
    233 
    234195void Adjuster::adjust(RenderStyle& style, const RenderStyle* userAgentAppearanceStyle) const
    235196{
     
    476437
    477438    style.setEffectiveTouchActions(computeEffectiveTouchActions(style, m_parentStyle.effectiveTouchActions()));
    478 
    479     if (m_element)
    480         style.setEventListenerRegionTypes(computeEventListenerRegionTypes(*m_element, m_parentStyle.eventListenerRegionTypes()));
    481439
    482440#if ENABLE(TEXT_AUTOSIZING)
Note: See TracChangeset for help on using the changeset viewer.