Changeset 287593 in webkit
- Timestamp:
- Jan 4, 2022, 3:48:08 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/scrolling/mac/canceled-event-with-non-zero-deltas-expected.txt (added)
-
LayoutTests/fast/scrolling/mac/canceled-event-with-non-zero-deltas.html (added)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/Shared/mac/WebEventFactory.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r287590 r287593 1 2022-01-04 Simon Fraser <simon.fraser@apple.com> 2 3 "canceled" wheel events to non-zero deltas cause scrolling jumps in PDFs and CodeMirror 4 https://bugs.webkit.org/show_bug.cgi?id=234825 5 6 Reviewed by Tim Horton. 7 8 * fast/scrolling/mac/canceled-event-with-non-zero-deltas-expected.txt: Added. 9 * fast/scrolling/mac/canceled-event-with-non-zero-deltas.html: Added. 10 1 11 2022-01-04 Devin Rousso <drousso@apple.com> 2 12 -
trunk/Source/WebKit/ChangeLog
r287592 r287593 1 2022-01-04 Simon Fraser <simon.fraser@apple.com> 2 3 "canceled" wheel events to non-zero deltas cause scrolling jumps in PDFs and CodeMirror 4 https://bugs.webkit.org/show_bug.cgi?id=234825 5 6 Reviewed by Tim Horton. 7 8 On some macOS versions, interrupting a momentum scroll via a two-finger tap on the trackpad can 9 result in the following sequence of wheel events: momentumPhase:end -> phase:mayBegin -> phase:cancelled, 10 and that last canceled event can have non-zero deltas (rdar://86653042). 11 12 Protect against this by zeroing out the deltas for cancelled wheel events when constructing WebEvents 13 from NSEvents. Code in Element::dispatchWheelEvent() ensures that we don't dispatch wheel events with 14 zero deltas to script, fixing CodeMirror. 15 16 Jumps only affected PDFs (and scrollable selects) because those are the code paths that don't go via 17 ScrollingEffectsController, which already ignores Cancelled events. 18 19 Test: fast/scrolling/mac/canceled-event-with-non-zero-deltas.html 20 21 * Shared/mac/WebEventFactory.mm: 22 (WebKit::WebEventFactory::createWebWheelEvent): 23 1 24 2022-01-04 Wenson Hsieh <wenson_hsieh@apple.com> 2 25 -
trunk/Source/WebKit/Shared/mac/WebEventFactory.mm
r286270 r287593 439 439 auto ioHIDEventWallTime = WebCore::eventTimeStampSince1970(ioHIDEventTimestamp); 440 440 441 if (phase == WebWheelEvent::PhaseCancelled) { 442 deltaX = 0; 443 deltaY = 0; 444 wheelTicksX = 0; 445 wheelTicksY = 0; 446 unacceleratedScrollingDelta = { }; 447 rawPlatformDelta = std::nullopt; 448 } 449 441 450 return WebWheelEvent(WebEvent::Wheel, WebCore::IntPoint(position), WebCore::IntPoint(globalPosition), WebCore::FloatSize(deltaX, deltaY), WebCore::FloatSize(wheelTicksX, wheelTicksY), 442 451 granularity, directionInvertedFromDevice, phase, momentumPhase, hasPreciseScrollingDeltas,
Note:
See TracChangeset
for help on using the changeset viewer.