Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Source/WebCore:
REGRESSION (r268476): Sometimes zooming does not work on purpleair.com/map https://bugs.webkit.org/show_bug.cgi?id=218680 <rdar://problem/70418612> Reviewed by Zalan Bujtas. Loading purpleair.com/map and quickly panning then zooming would often fail to zoom the map, and rubberband instead. This happened because the composited layer containing the WebGL canvas would switch to into tiled mode, and that would fail to set the event region on the new platform layer. The fix is to just add the 'EventRegionChanged' flag to the list of properties that need to get updated after a tiled layer switch. Test: fast/scrolling/mac/wheel-event-listener-region-tiled-layer-switch.html * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::determineWheelEventProcessing): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::changeLayerTypeTo): LayoutTests: REGRESSION (r268476): Sometimes zooming does not worki on purpleair.com/map https://bugs.webkit.org/show_bug.cgi?id=218680 Reviewed by Zalan Bujtas. * fast/scrolling/mac/wheel-event-listener-region-tiled-layer-switch-expected.txt: Added. * fast/scrolling/mac/wheel-event-listener-region-tiled-layer-switch.html: Added. Canonical link: https://commits.webkit.org/231352@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269561 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
6 changed files
with
152 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
LayoutTests/fast/scrolling/mac/wheel-event-listener-region-tiled-layer-switch-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
Test that scroll over box does not scroll page | ||
PASS windowScrollEventCount is 0 | ||
|
||
Test that scroll over box does not scroll page after switch to tiled layer | ||
PASS windowScrollEventCount is 0 | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
83 changes: 83 additions & 0 deletions
83
LayoutTests/fast/scrolling/mac/wheel-event-listener-region-tiled-layer-switch.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<style> | ||
body { | ||
height: 2000px; | ||
} | ||
|
||
.box { | ||
width: 3000px; | ||
height: 100px; | ||
margin: 50px; | ||
background-color: silver; | ||
} | ||
|
||
.composited { | ||
transform: translateZ(0); | ||
} | ||
|
||
body.changed .box { | ||
background-image: linear-gradient(silver, gray); | ||
} | ||
</style> | ||
<script src="../../../resources/js-test-pre.js"></script> | ||
<script src="../../../resources/ui-helper.js"></script> | ||
<script> | ||
var jsTestIsAsync = true; | ||
|
||
let windowScrollEventCount = 0; | ||
|
||
async function resetScrollPositions() | ||
{ | ||
window.scrollTo(0, 0); | ||
|
||
// Wait for scroll events to fire. | ||
await UIHelper.renderingUpdate(); | ||
|
||
windowScrollEventCount = 0; | ||
} | ||
|
||
async function testScroll() | ||
{ | ||
await resetScrollPositions(); | ||
await UIHelper.mouseWheelScrollAt(100, 100); | ||
shouldBe('windowScrollEventCount', '0'); | ||
} | ||
|
||
async function scrollTest() | ||
{ | ||
debug(''); | ||
debug('Test that scroll over box does not scroll page'); | ||
await testScroll(); | ||
|
||
document.body.classList.add('changed'); | ||
|
||
debug(''); | ||
debug('Test that scroll over box does not scroll page after switch to tiled layer'); | ||
await testScroll(); | ||
|
||
finishJSTest(); | ||
} | ||
|
||
window.addEventListener('load', () => { | ||
|
||
for (let active of document.querySelectorAll('.active')) { | ||
active.addEventListener('wheel', (event) => { | ||
event.preventDefault(); | ||
}, { passive: false }); | ||
} | ||
|
||
window.addEventListener('scroll', () => { | ||
++windowScrollEventCount; | ||
}, false); | ||
|
||
setTimeout(scrollTest, 0); | ||
}, false); | ||
</script> | ||
<body> | ||
<div class="active composited box"></div> | ||
<div id="console"></div> | ||
<script src="../../../resources/js-test-post.js"></script> | ||
</body> | ||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters