WebKit Bugzilla
Attachment 369664 Details for
Bug 197819
: eventSender.monitorWheelEvents() is very fragile
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Test with issues
repaint-shared-on-scroll.html (text/html), 3.03 KB, created by
Simon Fraser (smfr)
on 2019-05-11 15:45:11 PDT
(
hide
)
Description:
Test with issues
Filename:
MIME Type:
Creator:
Simon Fraser (smfr)
Created:
2019-05-11 15:45:11 PDT
Size:
3.03 KB
patch
obsolete
><!DOCTYPE html> <!-- webkit-test-runner [ internal:AsyncOverflowScrollingEnabled=true ] --> ><html> ><head> > <title>Tests painting of a layer with opacity into shared backing</title> > <style> > .scrollable { > overflow-y: scroll; > height: 300px; > width: 300px; > margin: 10px; > border: 1px solid black; > } > > .box.sharing { > background-color: blue; > } > > .box { > position: relative; > top: 50px; > left: 50px; > width: 180px; > height: 180px; > background-color: green; > } > > .spacer { > height: 500px; > } > </style> > <script> > if (window.testRunner) > testRunner.waitUntilDone(); > > function scrollDown() > { > console.log('scrolling down'); > eventSender.monitorWheelEvents(); // Do I need this once per gesture, or just once? > eventSender.mouseMoveTo(50, 50); > eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, "began", "none"); > eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -100, "changed", "none"); > eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -100, "none", "continue"); > eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -100, "none", "continue"); > eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, "none", "end"); > eventSender.callAfterScrollingCompletes(() => { > console.log('scrolling up'); > setTimeout(() => { > scrollUp(); > }, 0); > }); > } > > function scrollUp() > { > eventSender.monitorWheelEvents(); // If I don't call this a second time, only the first > // mouseScrollByWithWheelAndMomentumPhases is run and I have no idea why. > eventSender.mouseMoveTo(50, 50); > eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 1, "began", "none"); > eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 100, "changed", "none"); > eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 100, "none", "continue"); > eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 100, "none", "continue"); > eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, "none", "end"); > // This one never gets called. Does the second callback replace the first? > eventSender.callAfterScrollingCompletes(() => { > console.log('done'); > testRunner.notifyDone(); > }); > } > > window.addEventListener('load', () => { > if (!window.eventSender) > return; > > // Is this setTimeout necessary? Why? > setTimeout(() => { > scrollDown(); > }, 0); > }, false); > </script> ></head> ><body> > Some text here. > <div class="scrollable"> > <div class="sharing box"> > <div class="inner box"></div> > </div> > <div class="spacer"></div> > </div> ></body> ></html> >
<!DOCTYPE html> <!-- webkit-test-runner [ internal:AsyncOverflowScrollingEnabled=true ] --> <html> <head> <title>Tests painting of a layer with opacity into shared backing</title> <style> .scrollable { overflow-y: scroll; height: 300px; width: 300px; margin: 10px; border: 1px solid black; } .box.sharing { background-color: blue; } .box { position: relative; top: 50px; left: 50px; width: 180px; height: 180px; background-color: green; } .spacer { height: 500px; } </style> <script> if (window.testRunner) testRunner.waitUntilDone(); function scrollDown() { console.log('scrolling down'); eventSender.monitorWheelEvents(); // Do I need this once per gesture, or just once? eventSender.mouseMoveTo(50, 50); eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, "began", "none"); eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -100, "changed", "none"); eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -100, "none", "continue"); eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -100, "none", "continue"); eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, "none", "end"); eventSender.callAfterScrollingCompletes(() => { console.log('scrolling up'); setTimeout(() => { scrollUp(); }, 0); }); } function scrollUp() { eventSender.monitorWheelEvents(); // If I don't call this a second time, only the first // mouseScrollByWithWheelAndMomentumPhases is run and I have no idea why. eventSender.mouseMoveTo(50, 50); eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 1, "began", "none"); eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 100, "changed", "none"); eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 100, "none", "continue"); eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 100, "none", "continue"); eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, "none", "end"); // This one never gets called. Does the second callback replace the first? eventSender.callAfterScrollingCompletes(() => { console.log('done'); testRunner.notifyDone(); }); } window.addEventListener('load', () => { if (!window.eventSender) return; // Is this setTimeout necessary? Why? setTimeout(() => { scrollDown(); }, 0); }, false); </script> </head> <body> Some text here. <div class="scrollable"> <div class="sharing box"> <div class="inner box"></div> </div> <div class="spacer"></div> </div> </body> </html>
View Attachment As Raw
Actions:
View
Attachments on
bug 197819
: 369664 |
393917
|
393923
|
393933