Changeset 247306 in webkit
- Timestamp:
- Jul 10, 2019 10:03:04 AM (5 years ago)
- Location:
- trunk/Source
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r247299 r247306 1 2019-07-10 Antti Koivisto <antti@apple.com> 2 3 Remove TouchActionData 4 https://bugs.webkit.org/show_bug.cgi?id=199668 5 6 Reviewed by Simon Fraser. 7 8 TouchActionData structure has been superseded by touch-action regions in EventRegion and is unused. 9 Remove it and the supporting code. 10 11 No functional changes. 12 13 * dom/Document.cpp: 14 (WebCore::Document::nodeWillBeRemoved): 15 (WebCore::Document::updateTouchActionElements): Deleted. 16 * dom/Document.h: 17 (WebCore::Document::mayHaveElementsWithNonAutoTouchAction const): 18 (WebCore::Document::setMayHaveElementsWithNonAutoTouchAction): 19 20 Replace touchActionElements set with a bit that covers the only remaining clients (optimizations). 21 Note that touchActionElements was not deleted when emptied, it had the same "may have" behavior (which 22 is currently needed). 23 24 (WebCore::Document::touchActionElements const): Deleted. 25 * dom/Element.cpp: 26 (WebCore::Element::computedTouchActions const): Deleted. 27 * dom/Element.h: 28 * page/scrolling/ScrollingCoordinator.cpp: 29 (WebCore::ScrollingCoordinator::absoluteEventTrackingRegionsForFrame const): 30 * page/scrolling/ScrollingTree.cpp: 31 (WebCore::ScrollingTree::touchActionDataAtPoint const): Deleted. 32 * page/scrolling/ScrollingTree.h: 33 * platform/EventTrackingRegions.cpp: 34 (WebCore::operator==): 35 * platform/EventTrackingRegions.h: 36 (): Deleted. 37 * rendering/RenderBlock.cpp: 38 (WebCore::RenderBlock::paintObject): 39 * rendering/RenderLayer.cpp: 40 (WebCore::RenderLayer::calculateClipRects const): 41 * rendering/RenderLayerBacking.cpp: 42 (WebCore::RenderLayerBacking::updateEventRegion): 43 * style/StyleTreeResolver.cpp: 44 (WebCore::Style::TreeResolver::resolveElement): 45 1 46 2019-07-10 Zalan Bujtas <zalan@apple.com> 2 47 -
trunk/Source/WebCore/dom/Document.cpp
r247239 r247306 4459 4459 if (is<Text>(node)) 4460 4460 m_markers->removeMarkers(node); 4461 4462 #if PLATFORM(IOS_FAMILY) && ENABLE(POINTER_EVENTS)4463 if (m_touchActionElements && is<Element>(node))4464 m_touchActionElements->remove(&downcast<Element>(node));4465 #endif4466 4461 } 4467 4462 … … 8191 8186 #endif 8192 8187 8193 #if PLATFORM(IOS_FAMILY) && ENABLE(POINTER_EVENTS)8194 void Document::updateTouchActionElements(Element& element, const RenderStyle& style)8195 {8196 bool changed = false;8197 8198 if (style.touchActions() != TouchAction::Auto) {8199 if (!m_touchActionElements)8200 m_touchActionElements = std::make_unique<HashSet<RefPtr<Element>>>();8201 changed |= m_touchActionElements->add(&element).isNewEntry;8202 } else if (m_touchActionElements)8203 changed |= m_touchActionElements->remove(&element);8204 8205 if (!changed)8206 return;8207 8208 Page* page = this->page();8209 if (!page)8210 return;8211 8212 if (FrameView* frameView = view()) {8213 if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator())8214 scrollingCoordinator->frameViewEventTrackingRegionsChanged(*frameView);8215 }8216 }8217 #endif8218 8219 8188 #if PLATFORM(IOS_FAMILY) 8220 8189 ContentChangeObserver& Document::contentChangeObserver() -
trunk/Source/WebCore/dom/Document.h
r247184 r247306 1234 1234 #endif 1235 1235 #if PLATFORM(IOS_FAMILY) && ENABLE(POINTER_EVENTS) 1236 void updateTouchActionElements(Element&, const RenderStyle&);1237 const HashSet<RefPtr<Element>>* touchActionElements() const { return m_touchActionElements.get(); }1236 bool mayHaveElementsWithNonAutoTouchAction() const { return m_mayHaveElementsWithNonAutoTouchAction; } 1237 void setMayHaveElementsWithNonAutoTouchAction() { m_mayHaveElementsWithNonAutoTouchAction = true; } 1238 1238 #endif 1239 1239 … … 1820 1820 #endif 1821 1821 #if PLATFORM(IOS_FAMILY) && ENABLE(POINTER_EVENTS) 1822 std::unique_ptr<HashSet<RefPtr<Element>>> m_touchActionElements;1822 bool m_mayHaveElementsWithNonAutoTouchAction { false }; 1823 1823 #endif 1824 1824 std::unique_ptr<EventTargetSet> m_wheelEventTargets; -
trunk/Source/WebCore/dom/Element.cpp
r247255 r247306 4327 4327 4328 4328 #if ENABLE(POINTER_EVENTS) 4329 OptionSet<TouchAction> Element::computedTouchActions() const4330 {4331 if (auto* style = renderOrDisplayContentsStyle())4332 return style->effectiveTouchActions();4333 4334 return TouchAction::Auto;4335 }4336 4337 4329 #if ENABLE(OVERFLOW_SCROLLING_TOUCH) 4338 4330 ScrollingNodeID Element::nearestScrollingNodeIDUsingTouchOverflowScrolling() const -
trunk/Source/WebCore/dom/Element.h
r246490 r247306 74 74 }; 75 75 76 #if ENABLE(POINTER_EVENTS)77 enum class TouchAction : uint8_t;78 #endif79 80 76 class Element : public ContainerNode { 81 77 WTF_MAKE_ISO_ALLOCATED(Element); … … 607 603 608 604 #if ENABLE(POINTER_EVENTS) 609 OptionSet<TouchAction> computedTouchActions() const;610 605 #if ENABLE(OVERFLOW_SCROLLING_TOUCH) 611 606 ScrollingNodeID nearestScrollingNodeIDUsingTouchOverflowScrolling() const; -
trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
r246723 r247306 109 109 if (!document) 110 110 return EventTrackingRegions(); 111 auto eventTrackingRegions = document->eventTrackingRegions(); 112 113 #if ENABLE(POINTER_EVENTS) 114 if (!document->quirks().shouldDisablePointerEventsQuirk() && RuntimeEnabledFeatures::sharedFeatures().pointerEventsEnabled()) { 115 if (auto* touchActionElements = frame.document()->touchActionElements()) { 116 auto& touchActionData = eventTrackingRegions.touchActionData; 117 for (const auto& element : *touchActionElements) { 118 ASSERT(element); 119 touchActionData.append({ 120 element->computedTouchActions(), 121 element->nearestScrollingNodeIDUsingTouchOverflowScrolling(), 122 element->document().absoluteEventRegionForNode(*element).first 123 }); 124 } 125 } 126 } 127 #endif 128 129 return eventTrackingRegions; 111 return document->eventTrackingRegions(); 130 112 #else 131 113 auto* frameView = frame.view(); -
trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp
r246962 r247306 492 492 } 493 493 494 #if ENABLE(POINTER_EVENTS)495 Optional<TouchActionData> ScrollingTree::touchActionDataAtPoint(IntPoint p) const496 {497 // FIXME: This does not handle the case where there are multiple regions matching this point.498 for (auto& touchActionData : m_treeState.eventTrackingRegions.touchActionData) {499 if (touchActionData.region.contains(p))500 return touchActionData;501 }502 503 return { };504 }505 #endif506 507 494 } // namespace WebCore 508 495 -
trunk/Source/WebCore/page/scrolling/ScrollingTree.h
r246962 r247306 31 31 #include "Region.h" 32 32 #include "ScrollingCoordinator.h" 33 #include "TouchAction.h"34 33 #include "WheelEventTestTrigger.h" 35 34 #include <wtf/HashMap.h> … … 104 103 105 104 WEBCORE_EXPORT TrackingType eventTrackingTypeForPoint(const AtomString& eventName, IntPoint); 106 #if ENABLE(POINTER_EVENTS)107 WEBCORE_EXPORT Optional<TouchActionData> touchActionDataAtPoint(IntPoint) const;108 #endif109 105 110 106 #if PLATFORM(MAC) -
trunk/Source/WebCore/platform/EventTrackingRegions.cpp
r240579 r247306 74 74 { 75 75 return a.asynchronousDispatchRegion == b.asynchronousDispatchRegion 76 #if ENABLE(POINTER_EVENTS)77 && a.touchActionData == b.touchActionData78 #endif79 76 && a.eventSpecificSynchronousDispatchRegions == b.eventSpecificSynchronousDispatchRegions; 80 77 } 81 78 82 #if ENABLE(POINTER_EVENTS)83 bool operator==(const TouchActionData& a, const TouchActionData& b)84 {85 return a.touchActions == b.touchActions86 && a.scrollingNodeID == b.scrollingNodeID87 && a.region == b.region;88 }89 #endif90 91 79 } // namespace WebCore -
trunk/Source/WebCore/platform/EventTrackingRegions.h
r240579 r247306 31 31 #include <wtf/text/WTFString.h> 32 32 33 #if ENABLE(POINTER_EVENTS)34 #include "CSSPrimitiveValueMappings.h"35 #include "ScrollingCoordinatorTypes.h"36 #include "TouchAction.h"37 #endif38 39 33 namespace WebCore { 40 34 … … 45 39 }; 46 40 47 #if ENABLE(POINTER_EVENTS)48 typedef uint64_t ScrollingNodeID;49 struct TouchActionData {50 OptionSet<TouchAction> touchActions { TouchAction::Auto };51 ScrollingNodeID scrollingNodeID { 0 };52 Region region;53 };54 55 bool operator==(const TouchActionData&, const TouchActionData&);56 inline bool operator!=(const TouchActionData& a, const TouchActionData& b) { return !(a == b); }57 #endif58 59 41 struct EventTrackingRegions { 60 42 // Region for which events can be dispatched without blocking scrolling. … … 64 46 // The key is the Event Name with an active handler. 65 47 HashMap<String, Region> eventSpecificSynchronousDispatchRegions; 66 67 #if ENABLE(POINTER_EVENTS)68 Vector<TouchActionData> touchActionData;69 #endif70 48 71 49 bool isEmpty() const; -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r246490 r247306 1253 1253 bool needsTraverseDescendants = hasVisualOverflow() || !paintInfo.eventRegionContext->contains(enclosingIntRect(borderRect)); 1254 1254 #if PLATFORM(IOS_FAMILY) && ENABLE(POINTER_EVENTS) 1255 needsTraverseDescendants = needsTraverseDescendants || document(). touchActionElements();1255 needsTraverseDescendants = needsTraverseDescendants || document().mayHaveElementsWithNonAutoTouchAction(); 1256 1256 #endif 1257 1257 if (!needsTraverseDescendants) -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r247255 r247306 6824 6824 #if ENABLE(POINTER_EVENTS) 6825 6825 // UI side touch-action resolution. 6826 if (renderer().document(). touchActionElements())6826 if (renderer().document().mayHaveElementsWithNonAutoTouchAction()) 6827 6827 return true; 6828 6828 #endif -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r247187 r247306 1535 1535 bool hasTouchActionElements = false; 1536 1536 #if ENABLE(POINTER_EVENTS) 1537 hasTouchActionElements = !!renderer().document().touchActionElements();1537 hasTouchActionElements = renderer().document().mayHaveElementsWithNonAutoTouchAction(); 1538 1538 #endif 1539 1539 if (m_owningLayer.isRenderViewLayer() && !hasTouchActionElements) -
trunk/Source/WebCore/style/StyleTreeResolver.cpp
r244240 r247306 240 240 241 241 #if ENABLE(POINTER_EVENTS) && PLATFORM(IOS_FAMILY) 242 if (!m_document.quirks().shouldDisablePointerEventsQuirk() && RuntimeEnabledFeatures::sharedFeatures().pointerEventsEnabled()) 243 m_document.updateTouchActionElements(element, *update.style.get()); 242 // FIXME: Track this exactly. 243 if (update.style->touchActions() != TouchAction::Auto && !m_document.quirks().shouldDisablePointerEventsQuirk() && RuntimeEnabledFeatures::sharedFeatures().pointerEventsEnabled()) 244 m_document.setMayHaveElementsWithNonAutoTouchAction(); 244 245 #endif 245 246 -
trunk/Source/WebKit/ChangeLog
r247294 r247306 1 2019-07-10 Antti Koivisto <antti@apple.com> 2 3 Remove TouchActionData 4 https://bugs.webkit.org/show_bug.cgi?id=199668 5 6 Reviewed by Simon Fraser. 7 8 * Shared/WebCoreArgumentCoders.cpp: 9 (IPC::ArgumentCoder<EventTrackingRegions>::encode): 10 (IPC::ArgumentCoder<EventTrackingRegions>::decode): 11 (IPC::ArgumentCoder<TouchActionData>::encode): Deleted. 12 (IPC::ArgumentCoder<TouchActionData>::decode): Deleted. 13 1 14 2019-07-09 Michael Catanzaro <mcatanzaro@igalia.com> 2 15 -
trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp
r246725 r247306 331 331 } 332 332 333 #if ENABLE(POINTER_EVENTS)334 void ArgumentCoder<TouchActionData>::encode(Encoder& encoder, const TouchActionData& touchActionData)335 {336 encoder << touchActionData.touchActions << touchActionData.scrollingNodeID << touchActionData.region;337 }338 339 Optional<TouchActionData> ArgumentCoder<TouchActionData>::decode(Decoder& decoder)340 {341 Optional<OptionSet<TouchAction>> touchActions;342 decoder >> touchActions;343 if (!touchActions)344 return WTF::nullopt;345 346 Optional<ScrollingNodeID> scrollingNodeID;347 decoder >> scrollingNodeID;348 if (!scrollingNodeID)349 return WTF::nullopt;350 351 Optional<Region> region;352 decoder >> region;353 if (!region)354 return WTF::nullopt;355 356 return {{ WTFMove(*touchActions), WTFMove(*scrollingNodeID), WTFMove(*region) }};357 }358 #endif359 360 333 void ArgumentCoder<EventTrackingRegions>::encode(Encoder& encoder, const EventTrackingRegions& eventTrackingRegions) 361 334 { 362 335 encoder << eventTrackingRegions.asynchronousDispatchRegion; 363 336 encoder << eventTrackingRegions.eventSpecificSynchronousDispatchRegions; 364 #if ENABLE(POINTER_EVENTS)365 encoder << eventTrackingRegions.touchActionData;366 #endif367 337 } 368 338 … … 376 346 if (!decoder.decode(eventSpecificSynchronousDispatchRegions)) 377 347 return false; 378 #if ENABLE(POINTER_EVENTS)379 Vector<TouchActionData> touchActionData;380 if (!decoder.decode(touchActionData))381 return false;382 #endif383 348 eventTrackingRegions.asynchronousDispatchRegion = WTFMove(*asynchronousDispatchRegion); 384 349 eventTrackingRegions.eventSpecificSynchronousDispatchRegions = WTFMove(eventSpecificSynchronousDispatchRegions); 385 #if ENABLE(POINTER_EVENTS)386 eventTrackingRegions.touchActionData = WTFMove(touchActionData);387 #endif388 350 return true; 389 351 }
Note: See TracChangeset
for help on using the changeset viewer.