Changeset 214589 in webkit
- Timestamp:
- Mar 29, 2017, 6:31:53 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/events/touch/ios/touch-event-regions-expected.txt (added)
-
LayoutTests/fast/events/touch/ios/touch-event-regions.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/page/Page.cpp (modified) (1 diff)
-
Source/WebCore/page/Page.h (modified) (1 diff)
-
Source/WebCore/testing/Internals.cpp (modified) (1 diff)
-
Source/WebCore/testing/Internals.h (modified) (1 diff)
-
Source/WebCore/testing/Internals.idl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r214588 r214589 1 2017-03-28 Simon Fraser <simon.fraser@apple.com> 2 3 Make it possible to dump touch event regions for testing 4 https://bugs.webkit.org/show_bug.cgi?id=170209 5 <rdar://problem/31309258> 6 7 Reviewed by Tim Horton. 8 9 Simple test that dumps the regions. 10 11 * fast/events/touch/ios/touch-event-regions-expected.txt: Added. 12 * fast/events/touch/ios/touch-event-regions.html: Added. 13 1 14 2017-03-29 Zalan Bujtas <zalan@apple.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r214588 r214589 1 2017-03-28 Simon Fraser <simon.fraser@apple.com> 2 3 Make it possible to dump touch event regions for testing 4 https://bugs.webkit.org/show_bug.cgi?id=170209 5 <rdar://problem/31309258> 6 7 Reviewed by Tim Horton. 8 9 Expose internals.touchEventRectsForEvent() and internals.passiveTouchEventListenerRects(), which 10 fetch data via Page. 11 12 Because the regions are normally updated on a timer, we have to force an eager update via Document::updateTouchEventRegions(). 13 14 Test: fast/events/touch/ios/touch-event-regions.html 15 16 * page/Page.cpp: 17 (WebCore::Page::nonFastScrollableRects): 18 (WebCore::Page::touchEventRectsForEvent): 19 (WebCore::Page::passiveTouchEventListenerRects): 20 * page/Page.h: 21 * testing/Internals.cpp: 22 (WebCore::Internals::touchEventRectsForEvent): 23 (WebCore::Internals::passiveTouchEventListenerRects): 24 * testing/Internals.h: 25 * testing/Internals.idl: 26 1 27 2017-03-29 Zalan Bujtas <zalan@apple.com> 2 28 -
trunk/Source/WebCore/page/Page.cpp
r214129 r214589 424 424 } 425 425 426 Ref<ClientRectList> Page::touchEventRectsForEvent(const String& eventName) 427 { 428 if (Document* document = m_mainFrame->document()) { 429 document->updateLayout(); 430 #if ENABLE(IOS_TOUCH_EVENTS) 431 document->updateTouchEventRegions(); 432 #endif 433 } 434 435 Vector<IntRect> rects; 436 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) { 437 const EventTrackingRegions& eventTrackingRegions = scrollingCoordinator->absoluteEventTrackingRegions(); 438 const auto& region = eventTrackingRegions.eventSpecificSynchronousDispatchRegions.get(eventName); 439 rects.appendVector(region.rects()); 440 } 441 442 Vector<FloatQuad> quads(rects.size()); 443 for (size_t i = 0; i < rects.size(); ++i) 444 quads[i] = FloatRect(rects[i]); 445 446 return ClientRectList::create(quads); 447 } 448 449 Ref<ClientRectList> Page::passiveTouchEventListenerRects() 450 { 451 if (Document* document = m_mainFrame->document()) { 452 document->updateLayout(); 453 #if ENABLE(IOS_TOUCH_EVENTS) 454 document->updateTouchEventRegions(); 455 #endif 456 } 457 458 Vector<IntRect> rects; 459 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) 460 rects.appendVector(scrollingCoordinator->absoluteEventTrackingRegions().asynchronousDispatchRegion.rects()); 461 462 Vector<FloatQuad> quads(rects.size()); 463 for (size_t i = 0; i < rects.size(); ++i) 464 quads[i] = FloatRect(rects[i]); 465 466 return ClientRectList::create(quads); 467 } 468 426 469 #if ENABLE(VIEW_MODE_CSS_MEDIA) 427 470 struct ViewModeInfo { -
trunk/Source/WebCore/page/Page.h
r214494 r214589 238 238 WEBCORE_EXPORT Ref<ClientRectList> nonFastScrollableRects(); 239 239 240 WEBCORE_EXPORT Ref<ClientRectList> touchEventRectsForEvent(const String& eventName); 241 WEBCORE_EXPORT Ref<ClientRectList> passiveTouchEventListenerRects(); 242 240 243 Settings& settings() const { return *m_settings; } 241 244 ProgressTracker& progress() const { return *m_progress; } -
trunk/Source/WebCore/testing/Internals.cpp
r214503 r214589 1720 1720 } 1721 1721 1722 ExceptionOr<Ref<ClientRectList>> Internals::touchEventRectsForEvent(const String& eventName) 1723 { 1724 Document* document = contextDocument(); 1725 if (!document || !document->page()) 1726 return Exception { INVALID_ACCESS_ERR }; 1727 1728 return document->page()->touchEventRectsForEvent(eventName); 1729 } 1730 1731 ExceptionOr<Ref<ClientRectList>> Internals::passiveTouchEventListenerRects() 1732 { 1733 Document* document = contextDocument(); 1734 if (!document || !document->page()) 1735 return Exception { INVALID_ACCESS_ERR }; 1736 1737 return document->page()->passiveTouchEventListenerRects(); 1738 } 1739 1722 1740 // FIXME: Remove the document argument. It is almost always the same as 1723 1741 // contextDocument(), with the exception of a few tests that pass a -
trunk/Source/WebCore/testing/Internals.h
r214503 r214589 235 235 ExceptionOr<unsigned> touchEventHandlerCount(); 236 236 237 ExceptionOr<Ref<ClientRectList>> touchEventRectsForEvent(const String&); 238 ExceptionOr<Ref<ClientRectList>> passiveTouchEventListenerRects(); 239 237 240 ExceptionOr<RefPtr<NodeList>> nodesFromRect(Document&, int x, int y, unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping, bool allowShadowContent, bool allowChildFrameContent) const; 238 241 -
trunk/Source/WebCore/testing/Internals.idl
r214503 r214589 214 214 [MayThrowException] unsigned long touchEventHandlerCount(); 215 215 216 [MayThrowException] ClientRectList touchEventRectsForEvent(DOMString eventName); 217 [MayThrowException] ClientRectList passiveTouchEventListenerRects(); 218 216 219 [MayThrowException] NodeList? nodesFromRect(Document document, long x, long y, 217 220 unsigned long topPadding, unsigned long rightPadding, unsigned long bottomPadding, unsigned long leftPadding,
Note:
See TracChangeset
for help on using the changeset viewer.