Changeset 268476 in webkit
- Timestamp:
- Oct 14, 2020 11:06:37 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 37 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r268458 r268476 1 2020-10-13 Simon Fraser <simon.fraser@apple.com> 2 3 Allow passive mouse wheel event listeners to not force synchronous scrolling 4 https://bugs.webkit.org/show_bug.cgi?id=158439 5 <rdar://problem/28265360> 6 7 Reviewed by Tim Horton. 8 9 Change tests that relied on dumping the non-fast scrollable rects for wheel handlers 10 to dump layer trees with event regions instead. They also need to wait for a 11 rendering update, since wheel event regions are updated once per frame. 12 13 slow-scrolling-overflow.html tests that an overflow:scroll that's forced into slow 14 scrolling because of background-attachment:fixed still scrolls. 15 16 * fast/scrolling/mac/slow-scrolling-overflow-expected.txt: Added. 17 * fast/scrolling/mac/slow-scrolling-overflow.html: Added. 18 * fast/scrolling/mac/wheel-event-listener-region-inside-overflow-scroll-clipped-out-expected.txt: 19 * fast/scrolling/mac/wheel-event-listener-region-inside-overflow-scroll-expected.txt: 20 * platform/mac-wk2/TestExpectations: 21 * tiled-drawing/scrolling/non-fast-region/fixed-div-in-scrollable-page.html: 22 * tiled-drawing/scrolling/non-fast-region/handlers-in-iframes-expected.txt: 23 * tiled-drawing/scrolling/non-fast-region/handlers-in-iframes.html: 24 * tiled-drawing/scrolling/non-fast-region/non-fast-scrollable-region-hide-show-iframe-expected.txt: 25 * tiled-drawing/scrolling/non-fast-region/non-fast-scrollable-region-hide-show-iframe.html: 26 * tiled-drawing/scrolling/non-fast-region/resources/wheel-handler-region-helper.js: 27 (nonFastScrollableRects): 28 (dumpNonFastScrollableRects): 29 (async dumpRegionAndNotifyDone): 30 (rectsAsString): Deleted. 31 (dumpRegion): Deleted. 32 * tiled-drawing/scrolling/non-fast-region/top-content-inset-expected.txt: 33 * tiled-drawing/scrolling/non-fast-region/top-content-inset-header-expected.txt: 34 * tiled-drawing/scrolling/non-fast-region/top-content-inset-header.html: 35 * tiled-drawing/scrolling/non-fast-region/top-content-inset.html: 36 * tiled-drawing/scrolling/non-fast-region/wheel-event-plugin.html: 37 * tiled-drawing/scrolling/non-fast-region/wheel-handler-fixed-child-expected.txt: 38 * tiled-drawing/scrolling/non-fast-region/wheel-handler-fixed-child.html: 39 * tiled-drawing/scrolling/non-fast-region/wheel-handler-in-columns-expected.txt: 40 * tiled-drawing/scrolling/non-fast-region/wheel-handler-in-columns.html: 41 * tiled-drawing/scrolling/non-fast-region/wheel-handler-in-overflow-scroll-expected.txt: 42 * tiled-drawing/scrolling/non-fast-region/wheel-handler-in-overflow-scroll.html: 43 * tiled-drawing/scrolling/non-fast-region/wheel-handler-inside-fixed-expected.txt: 44 * tiled-drawing/scrolling/non-fast-region/wheel-handler-inside-fixed.html: 45 * tiled-drawing/scrolling/non-fast-region/wheel-handler-on-document-expected.txt: 46 * tiled-drawing/scrolling/non-fast-region/wheel-handler-on-document.html: 47 * tiled-drawing/scrolling/non-fast-region/wheel-handler-on-fixed-expected.txt: 48 * tiled-drawing/scrolling/non-fast-region/wheel-handler-on-fixed.html: 49 * tiled-drawing/scrolling/non-fast-region/wheel-handler-region-basic-expected.txt: 50 * tiled-drawing/scrolling/non-fast-region/wheel-handler-region-basic.html: 51 1 52 2020-10-14 Kate Cheney <katherine_cheney@apple.com> 2 53 -
trunk/LayoutTests/fast/scrolling/mac/wheel-event-listener-region-inside-overflow-scroll-clipped-out-expected.txt
r262337 r268476 19 19 (event region 20 20 (rect (0,0) width=500 height=500) 21 (rect (0,500) width=485 height=2500)22 21 ) 23 22 (children 2 … … 33 32 (drawsContent 1) 34 33 (event region 35 (rect (0,0) width=500 height=500) 36 (rect (0,500) width=485 height=2500) 34 (rect (0,0) width=485 height=3000) 37 35 (wheel event listener region 38 36 (rect (20,528) width=100 height=100) … … 52 50 (bounds 15.00 500.00) 53 51 (drawsContent 1) 52 (event region 53 (rect (0,0) width=15 height=500) 54 ) 54 55 ) 55 56 ) -
trunk/LayoutTests/fast/scrolling/mac/wheel-event-listener-region-inside-overflow-scroll-expected.txt
r262476 r268476 16 16 (event region 17 17 (rect (0,0) width=204 height=204) 18 (rect (2,204) width=185 height=188)19 (rect (22,392) width=100 height=30)20 (wheel event listener region21 (rect (22,22) width=100 height=400)22 (non-passive23 (rect (22,22) width=100 height=400)24 )25 )26 18 ) 27 19 (children 2 … … 40 32 (drawsContent 1) 41 33 (event region 42 (rect (-2,-2) width=204 height=204) 43 (rect (0,202) width=185 height=218) 34 (rect (0,0) width=185 height=420) 44 35 (wheel event listener region 45 36 (rect (20,20) width=100 height=400) … … 60 51 (bounds 185.00 15.00) 61 52 (drawsContent 1) 53 (event region 54 (rect (0,0) width=185 height=15) 55 ) 62 56 ) 63 57 (GraphicsLayer … … 65 59 (bounds 15.00 185.00) 66 60 (drawsContent 1) 61 (event region 62 (rect (0,0) width=15 height=185) 63 ) 67 64 ) 68 65 (GraphicsLayer … … 70 67 (bounds 15.00 15.00) 71 68 (drawsContent 1) 69 (event region 70 (rect (0,0) width=15 height=15) 71 ) 72 72 ) 73 73 ) -
trunk/LayoutTests/platform/mac-wk2/TestExpectations
r268438 r268476 1067 1067 webkit.org/b/213804 fast/scrolling/mac/scroll-snapping-in-progress.html [ Pass Failure ] 1068 1068 1069 webkit.org/b/215586 fast/scrolling/mac/wheel-event-listener-region-basic.html [ Skip ]1070 webkit.org/b/215586 fast/scrolling/mac/wheel-event-listener-region-document.html [ Skip ]1071 webkit.org/b/215586 fast/scrolling/mac/wheel-event-listener-region-element-invalidation.html [ Skip ]1072 webkit.org/b/215586 fast/scrolling/mac/wheel-event-listener-region-inside-overflow-scroll-clipped-out.html [ Skip ]1073 webkit.org/b/215586 fast/scrolling/mac/wheel-event-listener-region-inside-overflow-scroll.html [ Skip ]1074 webkit.org/b/215586 fast/scrolling/mac/wheel-event-listener-region-layer-offset.html [ Skip ]1075 webkit.org/b/215586 fast/scrolling/mac/wheel-event-listener-region-root-invalidation.html [ Skip ]1076 webkit.org/b/215586 fast/scrolling/mac/wheel-event-listener-region-window.html [ Skip ]1077 1078 1069 webkit.org/b/214478 [ Debug ] http/wpt/webrtc/generateCertificate.html [ Skip ] 1079 1070 webkit.org/b/214478 [ Debug ] imported/w3c/web-platform-tests/webrtc/RTCCertificate-postMessage.html [ Skip ] -
trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/fixed-div-in-scrollable-page.html
r192193 r268476 1 1 <html> 2 2 <head> 3 <script src="resources/wheel-handler-region-helper.js"></script>4 3 <style> 5 4 body { … … 23 22 } 24 23 </style> 24 <script src="../../../resources/ui-helper.js"></script> 25 <script src="resources/wheel-handler-region-helper.js"></script> 25 26 <script> 26 function dumpRegion() 27 { 28 if (window.internals) { 29 var rects = window.internals.nonFastScrollableRects(); 30 document.getElementById('output').textContent = rectsAsString(rects); 31 } 32 } 27 window.addEventListener('load', dumpNonFastScrollableRects, false); 33 28 </script> 34 29 </head> 35 <body onload="dumpRegion()">30 <body> 36 31 <div class="fixed"> 37 32 <div class="tall"></div> -
trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/handlers-in-iframes-expected.txt
r187905 r268476 1 1 2 32, 24 - 132, 124 2 3 (GraphicsLayer 4 (anchor 0.00 0.00) 5 (bounds 800.00 600.00) 6 (children 1 7 (GraphicsLayer 8 (bounds 800.00 600.00) 9 (contentsOpaque 1) 10 (drawsContent 1) 11 (backgroundColor #FFFFFF) 12 (event region 13 (rect (0,0) width=800 height=600) 14 (wheel event listener region 15 (rect (28,20) width=108 height=108) 16 (non-passive 17 (rect (28,20) width=108 height=108) 18 ) 19 ) 20 ) 21 ) 22 ) 23 ) 24 -
trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/handlers-in-iframes.html
r187905 r268476 9 9 } 10 10 </style> 11 <script src="../../../resources/ui-helper.js"></script> 11 12 <script src="resources/wheel-handler-region-helper.js"></script> 12 13 <script> 13 if (window.testRunner)14 testRunner.waitUntilDone();15 16 14 var notificationsPending = 3; 17 15 … … 29 27 function receivedNotification() 30 28 { 31 if (!--notificationsPending) { 32 dumpRegion(); 33 if (window.testRunner) 34 testRunner.notifyDone(); 35 } 29 if (!--notificationsPending) 30 dumpRegionAndNotifyDone(); 36 31 } 37 32 -
trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/non-fast-scrollable-region-hide-show-iframe-expected.txt
r267644 r268476 3 3 after hide: 4 4 after show: 10, 10 - 310, 160 5 -
trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/non-fast-scrollable-region-hide-show-iframe.html
r227011 r268476 2 2 <html> 3 3 <head> 4 <script src="../../../resources/ui-helper.js"></script> 4 5 <script src="resources/wheel-handler-region-helper.js"></script> 5 6 <script> … … 7 8 testRunner.waitUntilDone(); 8 9 9 function dumpRegion(prefix) 10 { 11 if (window.internals) { 12 var rects = window.internals.nonFastScrollableRects(); 13 document.getElementById('output').textContent += prefix + rectsAsString(rects) + '\n'; 14 } 15 } 16 17 function doTest() 10 async function doTest() 18 11 { 19 12 var frame = document.getElementById('frame'); 20 dumpRegion('before: '); 13 14 await UIHelper.renderingUpdate(); 15 var output = 'before: '; 16 output += nonFastScrollableRects(); 17 21 18 frame.style.display = 'none'; 22 dumpRegion('after hide: ');23 19 24 setTimeout(function() { 20 await UIHelper.renderingUpdate(); 21 output += '\nafter hide: '; 22 output += nonFastScrollableRects(); 23 24 setTimeout(async () => { 25 25 frame.style.display = 'inline'; 26 dumpRegion('after show: '); 26 27 await UIHelper.renderingUpdate(); 28 output += '\nafter show: '; 29 output += nonFastScrollableRects(); 30 31 document.getElementById('output').textContent = output; 27 32 28 33 if (window.testRunner) -
trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/resources/wheel-handler-region-helper.js
r187905 r268476 1 if (window.testRunner) 1 if (window.testRunner) { 2 2 testRunner.dumpAsText(); 3 testRunner.waitUntilDone(); 4 } 3 5 4 function rectsAsString(rects)6 function nonFastScrollableRects() 5 7 { 8 var rects = internals.nonFastScrollableRects(); 6 9 var result = ""; 7 10 for (var i = 0; i < rects.length; ++i) { … … 14 17 } 15 18 16 function dump Region()19 function dumpNonFastScrollableRects() 17 20 { 21 if (window.internals) 22 document.getElementById('output').textContent = nonFastScrollableRects(); 23 24 if (window.testRunner) 25 testRunner.notifyDone(); 26 } 27 28 async function dumpRegionAndNotifyDone() 29 { 30 await UIHelper.renderingUpdate(); 18 31 if (window.internals) { 19 var rects = window.internals.nonFastScrollableRects();20 document.getElementById('output').textContent = rectsAsString(rects);32 var output = nonFastScrollableRects() + '\n' + internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_EVENT_REGION + internals.LAYER_TREE_INCLUDES_ROOT_LAYER_PROPERTIES); 33 document.getElementById('output').textContent = output; 21 34 } 35 36 if (window.testRunner) 37 testRunner.notifyDone(); 22 38 } -
trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/top-content-inset-expected.txt
r187905 r268476 1 1 Wheel event rect: 2 2 3 28, 50 - 128, 150 3 4 (GraphicsLayer 5 (anchor 0.00 0.00) 6 (bounds 800.00 540.00) 7 (children 1 8 (GraphicsLayer 9 (bounds 800.00 540.00) 10 (contentsOpaque 1) 11 (drawsContent 1) 12 (backgroundColor #FFFFFF) 13 (event region 14 (rect (0,0) width=800 height=540) 15 (wheel event listener region 16 (rect (28,50) width=100 height=100) 17 (non-passive 18 (rect (28,50) width=100 height=100) 19 ) 20 ) 21 ) 22 ) 23 ) 24 ) 25 -
trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/top-content-inset-header-expected.txt
r187905 r268476 1 1 Wheel event rect: 2 2 3 28, 50 - 128, 150 3 4 (GraphicsLayer 5 (position 0.00 46.00) 6 (anchor 0.00 0.00) 7 (bounds 800.00 540.00) 8 (children 1 9 (GraphicsLayer 10 (bounds 800.00 540.00) 11 (contentsOpaque 1) 12 (drawsContent 1) 13 (backgroundColor #FFFFFF) 14 (event region 15 (rect (0,0) width=800 height=540) 16 (wheel event listener region 17 (rect (28,50) width=100 height=100) 18 (non-passive 19 (rect (28,50) width=100 height=100) 20 ) 21 ) 22 ) 23 ) 24 ) 25 ) 26 -
trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/top-content-inset-header.html
r235893 r268476 13 13 14 14 </style> 15 <script src="../../../resources/ui-helper.js"></script> 15 16 <script src="resources/wheel-handler-region-helper.js"></script> 16 17 <script> 17 if (window.testRunner)18 testRunner.waitUntilDone();19 20 18 if (window.internals) { 21 19 internals.setTopContentInset(60); … … 25 23 function doTest() 26 24 { 27 window.setTimeout( function(){25 window.setTimeout(async () => { 28 26 // Scroll to test the mapping from document to view coords. 29 27 document.scrollingElement.scrollTop = 195; 30 dumpRegion(); 31 if (window.testRunner) 32 testRunner.notifyDone(); 28 dumpRegionAndNotifyDone(); 33 29 }, 0) 34 30 } -
trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/top-content-inset.html
r235893 r268476 13 13 14 14 </style> 15 <script src="../../../resources/ui-helper.js"></script> 15 16 <script src="resources/wheel-handler-region-helper.js"></script> 16 17 <script> 17 if (window.testRunner)18 testRunner.waitUntilDone();19 20 18 if (window.internals) 21 19 internals.setTopContentInset(60); … … 23 21 function doTest() 24 22 { 25 window.setTimeout( function(){23 window.setTimeout(async () => { 26 24 // Scroll to test the mapping from document to view coords. 27 25 document.scrollingElement.scrollTop = 195; 28 dumpRegion(); 29 if (window.testRunner) 30 testRunner.notifyDone(); 26 dumpRegionAndNotifyDone(); 31 27 }, 0) 32 28 } -
trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/wheel-event-plugin.html
r235893 r268476 17 17 18 18 </style> 19 <script src="../../../resources/ui-helper.js"></script> 19 20 <script src="resources/wheel-handler-region-helper.js"></script> 20 21 <script> 21 if (window.testRunner)22 testRunner.waitUntilDone();23 24 22 if (window.internals) { 25 23 internals.setTopContentInset(60); … … 27 25 } 28 26 29 function doTest()27 async function doTest() 30 28 { 31 29 if (window.internals) … … 34 32 // Scroll to test the mapping from document to view coords. 35 33 document.scrollingElement.scrollTop = 197; 36 dumpRegion(); 37 if (window.testRunner) 38 testRunner.notifyDone(); 34 dumpNonFastScrollableRects(); 39 35 } 40 36 … … 45 41 46 42 <p>Wheel event rect for plug-in:</p> 47 <embed id="plugin" type="application/x-webkit-test-netscape" drawingmodel="coreanimation"> </embed>43 <embed id="plugin" type="application/x-webkit-test-netscape" drawingmodel="coreanimation"> 48 44 <pre id="output"></pre> 49 45 -
trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/wheel-handler-fixed-child-expected.txt
r192193 r268476 1 50, 50 - 150, 178 1 2 (GraphicsLayer 3 (anchor 0.00 0.00) 4 (bounds 785.00 628.00) 5 (children 1 6 (GraphicsLayer 7 (bounds 785.00 628.00) 8 (contentsOpaque 1) 9 (drawsContent 1) 10 (backgroundColor #FFFFFF) 11 (event region 12 (rect (0,0) width=785 height=628) 13 ) 14 (children 1 15 (GraphicsLayer 16 (position 50.00 50.00) 17 (bounds 100.00 100.00) 18 (contentsOpaque 1) 19 (event region 20 (rect (0,0) width=100 height=100) 21 (wheel event listener region 22 (rect (0,0) width=100 height=100) 23 (non-passive 24 (rect (0,0) width=100 height=100) 25 ) 26 ) 27 ) 28 ) 29 ) 30 ) 31 ) 32 ) 33 -
trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/wheel-handler-fixed-child.html
r187905 r268476 25 25 } 26 26 </style> 27 <script src="../../../resources/ui-helper.js"></script> 27 28 <script src="resources/wheel-handler-region-helper.js"></script> 28 29 <script> 29 function dumpRegion() 30 { 31 if (window.internals) { 32 var rects = window.internals.nonFastScrollableRects(); 33 document.getElementById('output').textContent = rectsAsString(rects); 34 } 35 } 36 37 window.addEventListener('load', dumpRegion, false); 30 window.addEventListener('load', dumpRegionAndNotifyDone, false); 38 31 </script> 39 32 </head> -
trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/wheel-handler-in-columns-expected.txt
r187905 r268476 5 5 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. 6 6 7 28, 20 - 567, 380 7 8 (GraphicsLayer 9 (anchor 0.00 0.00) 10 (bounds 800.00 600.00) 11 (children 1 12 (GraphicsLayer 13 (bounds 800.00 600.00) 14 (contentsOpaque 1) 15 (drawsContent 1) 16 (backgroundColor #FFFFFF) 17 (event region 18 (rect (443,-1060) width=124 height=360) 19 (rect (305,-700) width=123 height=360) 20 (rect (443,-700) width=124 height=360) 21 (rect (166,-340) width=124 height=340) 22 (rect (305,-340) width=123 height=340) 23 (rect (443,-340) width=124 height=340) 24 (rect (0,0) width=800 height=600) 25 (rect (28,600) width=123 height=336) 26 (rect (166,600) width=124 height=336) 27 (rect (28,936) width=123 height=360) 28 (wheel event listener region 29 (rect (305,-380) width=123 height=360) 30 (rect (166,-20) width=124 height=166) 31 (rect (305,-20) width=123 height=166) 32 (rect (166,146) width=124 height=194) 33 (rect (28,340) width=123 height=166) 34 (rect (166,340) width=124 height=166) 35 (rect (28,506) width=123 height=360) 36 (non-passive 37 (rect (305,-380) width=123 height=360) 38 (rect (166,-20) width=124 height=166) 39 (rect (305,-20) width=123 height=166) 40 (rect (166,146) width=124 height=194) 41 (rect (28,340) width=123 height=166) 42 (rect (166,340) width=124 height=166) 43 (rect (28,506) width=123 height=360) 44 ) 45 ) 46 ) 47 ) 48 ) 49 ) 50 -
trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/wheel-handler-in-columns.html
r187905 r268476 14 14 } 15 15 </style> 16 <script src="../../../resources/ui-helper.js"></script> 16 17 <script src="resources/wheel-handler-region-helper.js"></script> 17 18 <script> 18 function doTest() 19 { 20 dumpRegion(); 21 } 22 23 window.addEventListener('load', doTest); 19 window.addEventListener('load', dumpRegionAndNotifyDone); 24 20 </script> 25 21 </head> -
trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/wheel-handler-in-overflow-scroll-expected.txt
r187905 r268476 8 8 9 9 8, 8 - 310, 310 10 (GraphicsLayer 11 (anchor 0.00 0.00) 12 (bounds 800.00 600.00) 13 (children 1 14 (GraphicsLayer 15 (bounds 800.00 600.00) 16 (contentsOpaque 1) 17 (drawsContent 1) 18 (backgroundColor #FFFFFF) 19 (event region 20 (rect (0,0) width=800 height=600) 21 (wheel event listener region 22 (rect (9,9) width=250 height=9) 23 (rect (9,18) width=243 height=18) 24 (rect (9,36) width=271 height=18) 25 (rect (9,54) width=246 height=18) 26 (rect (9,72) width=262 height=1) 27 (rect (9,73) width=285 height=198) 28 (non-passive 29 (rect (9,9) width=250 height=9) 30 (rect (9,18) width=243 height=18) 31 (rect (9,36) width=271 height=18) 32 (rect (9,54) width=246 height=18) 33 (rect (9,72) width=262 height=1) 34 (rect (9,73) width=285 height=198) 35 ) 36 ) 37 ) 38 ) 39 ) 40 ) 41 -
trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/wheel-handler-in-overflow-scroll.html
r187905 r268476 14 14 } 15 15 </style> 16 <script src="../../../resources/ui-helper.js"></script> 16 17 <script src="resources/wheel-handler-region-helper.js"></script> 17 18 <script> 18 if (window.testRunner)19 testRunner.waitUntilDone();20 21 19 function doTest() 22 20 { 23 window.setTimeout( function(){21 window.setTimeout(async () => { 24 22 var scroller = document.getElementById('container'); 25 23 scroller.scrollTop = 200; 26 dumpRegion(); 27 if (window.testRunner) 28 testRunner.notifyDone(); 24 dumpRegionAndNotifyDone(); 29 25 }, 0) 30 26 } -
trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/wheel-handler-inside-fixed-expected.txt
r192193 r268476 1 60, 60 - 160, 160 1 2 (GraphicsLayer 3 (anchor 0.00 0.00) 4 (bounds 800.00 600.00) 5 (children 1 6 (GraphicsLayer 7 (bounds 800.00 600.00) 8 (contentsOpaque 1) 9 (drawsContent 1) 10 (backgroundColor #FFFFFF) 11 (event region 12 (rect (0,0) width=800 height=600) 13 ) 14 (children 1 15 (GraphicsLayer 16 (position 10.00 10.00) 17 (bounds 150.00 150.00) 18 (drawsContent 1) 19 (event region 20 (rect (0,0) width=100 height=50) 21 (rect (0,50) width=150 height=50) 22 (rect (50,100) width=100 height=50) 23 (wheel event listener region 24 (rect (50,50) width=100 height=100) 25 (non-passive 26 (rect (50,50) width=100 height=100) 27 ) 28 ) 29 ) 30 ) 31 ) 32 ) 33 ) 34 ) 35 -
trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/wheel-handler-inside-fixed.html
r187905 r268476 25 25 } 26 26 </style> 27 <script src="../../../resources/ui-helper.js"></script> 27 28 <script src="resources/wheel-handler-region-helper.js"></script> 28 29 <script> 29 window.addEventListener('load', dumpRegion , false);30 window.addEventListener('load', dumpRegionAndNotifyDone, false); 30 31 </script> 31 32 </head> -
trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/wheel-handler-on-document-expected.txt
r187905 r268476 1 0, 0 - 800, 600 1 2 (GraphicsLayer 3 (anchor 0.00 0.00) 4 (bounds 800.00 600.00) 5 (children 1 6 (GraphicsLayer 7 (bounds 800.00 600.00) 8 (contentsOpaque 1) 9 (drawsContent 1) 10 (backgroundColor #FFFFFF) 11 (event region 12 (rect (0,0) width=800 height=600) 13 (wheel event listener region 14 (rect (0,0) width=800 height=600) 15 (non-passive 16 (rect (0,0) width=800 height=600) 17 ) 18 ) 19 ) 20 ) 21 ) 22 ) 23 -
trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/wheel-handler-on-document.html
r187905 r268476 3 3 <html> 4 4 <head> 5 <script src="../../../resources/ui-helper.js"></script> 5 6 <script src="resources/wheel-handler-region-helper.js"></script> 6 7 <script> 7 function doTest()8 async function doTest() 8 9 { 9 10 document.addEventListener('mousewheel', function() { }); 10 dumpRegion ();11 dumpRegionAndNotifyDone(); 11 12 } 12 13 -
trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/wheel-handler-on-fixed-expected.txt
r192193 r268476 1 10, 10 - 110, 110 1 2 (GraphicsLayer 3 (anchor 0.00 0.00) 4 (bounds 800.00 600.00) 5 (children 1 6 (GraphicsLayer 7 (bounds 800.00 600.00) 8 (contentsOpaque 1) 9 (drawsContent 1) 10 (backgroundColor #FFFFFF) 11 (event region 12 (rect (0,0) width=800 height=600) 13 ) 14 (children 1 15 (GraphicsLayer 16 (position 10.00 10.00) 17 (bounds 100.00 100.00) 18 (contentsOpaque 1) 19 (event region 20 (rect (0,0) width=100 height=100) 21 (wheel event listener region 22 (rect (0,0) width=100 height=100) 23 (non-passive 24 (rect (0,0) width=100 height=100) 25 ) 26 ) 27 ) 28 ) 29 ) 30 ) 31 ) 32 ) 33 -
trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/wheel-handler-on-fixed.html
r187905 r268476 19 19 } 20 20 </style> 21 <script src="../../../resources/ui-helper.js"></script> 21 22 <script src="resources/wheel-handler-region-helper.js"></script> 22 23 <script> 23 window.addEventListener('load', dumpRegion , false);24 window.addEventListener('load', dumpRegionAndNotifyDone, false); 24 25 </script> 25 26 </head> -
trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/wheel-handler-region-basic-expected.txt
r231717 r268476 7 7 Intermediate 8 8 Child 9 8, 8 - 777, 329 10 9, 369 - 290, 425 11 9, 501 - 290, 601 9 10 (GraphicsLayer 11 (anchor 0.00 0.00) 12 (bounds 785.00 672.00) 13 (children 1 14 (GraphicsLayer 15 (bounds 785.00 672.00) 16 (contentsOpaque 1) 17 (drawsContent 1) 18 (backgroundColor #FFFFFF) 19 (event region 20 (rect (0,0) width=785 height=672) 21 (wheel event listener region 22 (rect (0,0) width=81 height=18) 23 (rect (8,18) width=65 height=8) 24 (rect (8,26) width=769 height=108) 25 (rect (8,134) width=28 height=18) 26 (rect (300,134) width=226 height=18) 27 (rect (300,152) width=226 height=13) 28 (rect (297,165) width=229 height=16) 29 (rect (288,181) width=238 height=15) 30 (rect (279,196) width=247 height=16) 31 (rect (270,212) width=256 height=50) 32 (rect (279,262) width=247 height=14) 33 (rect (279,276) width=178 height=34) 34 (rect (9,369) width=81 height=36) 35 (rect (209,407) width=81 height=18) 36 (rect (8,500) width=83 height=57) 37 (rect (8,557) width=83 height=18) 38 (rect (209,557) width=81 height=18) 39 (rect (8,575) width=83 height=27) 40 (non-passive 41 (rect (0,0) width=81 height=18) 42 (rect (8,18) width=65 height=8) 43 (rect (8,26) width=769 height=108) 44 (rect (8,134) width=28 height=18) 45 (rect (300,134) width=226 height=18) 46 (rect (300,152) width=226 height=13) 47 (rect (297,165) width=229 height=16) 48 (rect (288,181) width=238 height=15) 49 (rect (279,196) width=247 height=16) 50 (rect (270,212) width=256 height=50) 51 (rect (279,262) width=247 height=14) 52 (rect (279,276) width=178 height=34) 53 (rect (9,369) width=81 height=36) 54 (rect (209,407) width=81 height=18) 55 (rect (8,500) width=83 height=57) 56 (rect (8,557) width=83 height=18) 57 (rect (209,557) width=81 height=18) 58 (rect (8,575) width=83 height=27) 59 ) 60 ) 61 ) 62 ) 63 ) 64 ) 65 -
trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/wheel-handler-region-basic.html
r187905 r268476 39 39 } 40 40 </style> 41 <script src="../../../resources/ui-helper.js"></script> 41 42 <script src="resources/wheel-handler-region-helper.js"></script> 42 43 <script> 43 window.addEventListener('load', dumpRegion , false);44 window.addEventListener('load', dumpRegionAndNotifyDone, false); 44 45 </script> 45 46 </head> -
trunk/Source/WTF/ChangeLog
r268459 r268476 1 2020-10-13 Simon Fraser <simon.fraser@apple.com> 2 3 Allow passive mouse wheel event listeners to not force synchronous scrolling 4 https://bugs.webkit.org/show_bug.cgi?id=158439 5 <rdar://problem/28265360> 6 7 Reviewed by Tim Horton. 8 9 Define ENABLE_WHEEL_EVENT_REGIONS for macOS. 10 11 * wtf/PlatformEnableCocoa.h: 12 1 13 2020-10-14 Chris Dumez <cdumez@apple.com> 2 14 -
trunk/Source/WTF/wtf/PlatformEnableCocoa.h
r268367 r268476 511 511 #endif 512 512 513 #if !defined(ENABLE_WHEEL_EVENT_REGIONS) && PLATFORM(MAC) 514 #define ENABLE_WHEEL_EVENT_REGIONS 1 515 #endif 516 513 517 #if !defined(ENABLE_UI_SIDE_COMPOSITING) 514 518 #define ENABLE_UI_SIDE_COMPOSITING 1 -
trunk/Source/WebCore/ChangeLog
r268473 r268476 1 2020-10-13 Simon Fraser <simon.fraser@apple.com> 2 3 Allow passive mouse wheel event listeners to not force synchronous scrolling 4 https://bugs.webkit.org/show_bug.cgi?id=158439 5 <rdar://problem/28265360> 6 7 Reviewed by Tim Horton. 8 9 Turn on ENABLE_WHEEL_EVENT_REGIONS for macOS, and hit-test the passive and active regions 10 in ScrollingTree::determineWheelEventProcessin() to determine whether scrolling needs to 11 happen on the main thread, communicating via WheelEventProcessingSteps. 12 13 Now that we use EventRegion to store wheel event region information, we no longer need 14 to consult wheel event targets im ScrollingCoordinator::absoluteEventTrackingRegionsForFrame(), 15 but the non-fast region does still contain rectangles for non-fast-scrollable overflow 16 if async overflow scrolling is disabled. 17 18 Frame::invalidateContentEventRegionsIfNeeded() needs a fix to ensure that when wheel 19 event handlers in non-fast-scrollable subframes change we invalidate event regions. 20 21 Finally, when the processing steps given to EventHandler::handleWheelEvent() do not 22 include MainThreadForScrolling, then we shouldn't scroll here. The check in 23 EventHandler::handleWheelEvent() applies to frames, and the one in EventHandler::defaultWheelEventHandler() 24 applies to overflow:scroll. 25 26 Test: fast/scrolling/mac/slow-scrolling-overflow.html 27 28 * page/EventHandler.cpp: 29 (WebCore::EventHandler::handleWheelEvent): 30 (WebCore::EventHandler::defaultWheelEventHandler): 31 * page/Frame.cpp: 32 (WebCore::Frame::invalidateContentEventRegionsIfNeeded): 33 * page/scrolling/ScrollingCoordinator.cpp: 34 (WebCore::ScrollingCoordinator::absoluteEventTrackingRegionsForFrame const): 35 * page/scrolling/ScrollingTree.cpp: 36 (WebCore::ScrollingTree::determineWheelEventProcessing): 37 1 38 2020-10-14 Devin Rousso <drousso@apple.com> 2 39 -
trunk/Source/WebCore/page/EventHandler.cpp
r268417 r268476 2895 2895 2896 2896 m_isHandlingWheelEvent = true; 2897 auto allowsScrollingState = SetForScope(m_currentWheelEventAllowsScrolling, processingSteps.contains(WheelEventProcessingSteps::MainThreadForScrolling)); 2898 2897 2899 setFrameWasScrolledByUser(); 2898 2900 … … 2947 2949 bool allowScrolling = true; 2948 2950 #if ENABLE(WHEEL_EVENT_LATCHING) 2949 allowScrolling = m_ frame.page()->scrollLatchingController().latchingAllowsScrollingInFrame(m_frame, scrollableArea);2951 allowScrolling = m_currentWheelEventAllowsScrolling && m_frame.page()->scrollLatchingController().latchingAllowsScrollingInFrame(m_frame, scrollableArea); 2950 2952 #endif 2951 2953 if (allowScrolling) { … … 2978 2980 2979 2981 if (!m_frame.page()) 2982 return; 2983 2984 if (!m_currentWheelEventAllowsScrolling) 2980 2985 return; 2981 2986 -
trunk/Source/WebCore/page/Frame.cpp
r268313 r268476 305 305 if (!m_page || !m_doc || !m_doc->renderView()) 306 306 return; 307 bool hasWheelEventHandlers = false; 307 308 bool hasTouchActionElements = false; 308 309 bool hasEditableElements = false; 310 #if ENABLE(WHEEL_EVENT_REGIONS) 311 hasWheelEventHandlers = m_doc->hasWheelEventHandlers(); 312 #endif 309 313 #if ENABLE(TOUCH_ACTION_REGIONS) 310 314 hasTouchActionElements = m_doc->mayHaveElementsWithNonAutoTouchAction(); … … 313 317 hasEditableElements = m_doc->mayHaveEditableElements() && m_page->shouldBuildEditableRegion(); 314 318 #endif 315 // FIXME: This needs to look at wheel event handlers too. 316 if (!hasTouchActionElements && !hasEditableElements) 319 if (!hasTouchActionElements && !hasEditableElements && !hasWheelEventHandlers) 317 320 return; 318 321 if (!m_doc->renderView()->compositor().viewNeedsToInvalidateEventRegionOfEnclosingCompositingLayerForRepaint()) -
trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
r261052 r268476 167 167 } 168 168 169 #if !ENABLE(WHEEL_EVENT_REGIONS) 169 170 auto wheelHandlerRegion = frame.document()->absoluteRegionForEventTargets(frame.document()->wheelEventTargets()); 170 171 bool wheelHandlerInFixedContent = wheelHandlerRegion.second; … … 176 177 177 178 nonFastScrollableRegion.unite(wheelHandlerRegion.first); 179 #endif 178 180 179 181 // FIXME: If this is not the main frame, we could clip the region to the frame's bounds. -
trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp
r268417 r268476 95 95 } 96 96 97 #if ENABLE(WHEEL_EVENT_REGIONS) 98 auto eventListenerTypes = eventListenerRegionTypesForPoint(position); 99 if (eventListenerTypes.contains(EventListenerRegionType::NonPassiveWheel)) 100 return { WheelEventProcessingSteps::MainThreadForScrolling, WheelEventProcessingSteps::MainThreadForDOMEventDispatch }; 101 102 if (eventListenerTypes.contains(EventListenerRegionType::Wheel)) 103 return { WheelEventProcessingSteps::ScrollingThread, WheelEventProcessingSteps::MainThreadForDOMEventDispatch }; 104 #endif 105 97 106 return { WheelEventProcessingSteps::ScrollingThread }; 98 107 } -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r268453 r268476 1768 1768 } 1769 1769 1770 if (m_owningLayer.isRenderViewLayer() && (&graphicsLayer == m_graphicsLayer || &graphicsLayer == m_foregroundLayer)) { 1771 // Event handlers on the root cover the entire layer. 1772 eventRegionContext.unite(enclosingIntRect(FloatRect(-layerOffset, graphicsLayer.size())), renderer().style()); 1773 } 1774 1770 1775 auto dirtyRect = enclosingIntRect(FloatRect(FloatPoint(graphicsLayer.offsetFromRenderer()), graphicsLayer.size())); 1771 1776 paintIntoLayer(&graphicsLayer, nullContext, dirtyRect, { }, &eventRegionContext);
Note: See TracChangeset
for help on using the changeset viewer.