-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Give OOPIF FrameViews their own scroll animation timelines and hosts
OOPIFs need independent scroll animation timelines and hosts, because they have separate compositors. Ultimately we need to associate a ScrollingCoordinator which each local frame root, but until that work is done this CL resolves some known scrolling problems in --site-per-process mode. BUG=675695 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Review-Url: https://codereview.chromium.org/2631853002 Cr-Commit-Position: refs/heads/master@{#444947} (cherry picked from commit 65c7df6) Review-Url: https://codereview.chromium.org/2654883002 . Cr-Commit-Position: refs/branch-heads/2987@{#62} Cr-Branched-From: ad51088-refs/heads/master@{#444943}
- Loading branch information
Showing
14 changed files
with
205 additions
and
34 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
...rty/WebKit/LayoutTests/http/tests/misc/resources/cross-origin-subframe-for-scrolling.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,28 @@ | ||
<!DOCTYPE html> | ||
<script src="/js-test-resources/js-test.js"></script> | ||
<div style="height: 300px"></div> | ||
|
||
<script> | ||
setPrintTestResultsLazily(); | ||
self.jsTestIsAsync = true; | ||
|
||
window.onload = (() => { | ||
if (!window.eventSender || !window.internals) { | ||
debug("This test requires window.eventSender."); | ||
return; | ||
} | ||
internals.settings.setScrollAnimatorEnabled(true); | ||
}); | ||
|
||
function handleMessage(event) { | ||
if (event.data.hasOwnProperty('scrollBy')) { | ||
eventSender.mouseMoveTo(event.data.left + 5, event.data.top + 5); | ||
eventSender.mouseScrollBy(0, event.data.scrollBy); | ||
requestAnimationFrame(() => {setTimeout(() => {event.source.postMessage("", "*")}, 500)}); | ||
} else { | ||
event.source.postMessage({scrollTop: document.documentElement.scrollTop}, "*"); | ||
} | ||
} | ||
|
||
window.addEventListener("message", handleMessage); | ||
</script> |
11 changes: 11 additions & 0 deletions
11
third_party/WebKit/LayoutTests/http/tests/misc/scroll-cross-origin-iframes-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,11 @@ | ||
Verify that two sibling cross-origin iframes both correctly scroll on MouseWheel events, as per https://crbug.com/675695. | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
PASS event.data.scrollTop is 40 | ||
PASS event.data.scrollTop is 40 | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
44 changes: 44 additions & 0 deletions
44
third_party/WebKit/LayoutTests/http/tests/misc/scroll-cross-origin-iframes.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,44 @@ | ||
<!DOCTYPE html> | ||
<script src="/js-test-resources/js-test.js"></script> | ||
<iframe id="target-iframe1" src="http://localhost:8080/misc/resources/cross-origin-subframe-for-scrolling.html" style="height: 100px; width: 100px; overflow-y: scroll; position: absolute; left: 50px; top: 50px"></iframe> | ||
<iframe id="target-iframe2" src="http://localhost:8080/misc/resources/cross-origin-subframe-for-scrolling.html" style="height: 100px; width: 100px; overflow-y: scroll; position: absolute; left: 50px; top: 200px"></iframe> | ||
|
||
<script> | ||
description("Verify that two sibling cross-origin iframes both correctly scroll on MouseWheel events, as per https://crbug.com/675695."); | ||
|
||
// States: | ||
// 0 => Scroll sent to iframe1 | ||
// 1 => Fetching scroll offset from iframe1 | ||
// 2 => Scroll sent to iframe2 | ||
// 3 => Fetching scroll offset from iframe2 | ||
var state = 0; | ||
var iframe1 = document.getElementById("target-iframe1"); | ||
var iframe2 = document.getElementById("target-iframe2"); | ||
setPrintTestResultsLazily(); | ||
self.jsTestIsAsync = true; | ||
|
||
function handleMessage(event) { | ||
if (state == 0) { | ||
iframe1.contentWindow.postMessage("", "*"); | ||
state = 1; | ||
} else if (state == 1) { | ||
shouldBeEqualToNumber("event.data.scrollTop", 40); | ||
state = 2; | ||
iframe2.contentWindow.postMessage({scrollBy: -1, left: iframe2.offsetLeft, top: iframe2.offsetTop}, "*"); | ||
iframe2.contentWindow.postMessage("", "*"); | ||
} else if (state == 2) { | ||
iframe1.contentWindow.postMessage("", "*"); | ||
state = 3; | ||
} else if (state == 3) { | ||
shouldBeEqualToNumber("event.data.scrollTop", 40); | ||
finishJSTest(); | ||
} | ||
} | ||
|
||
window.addEventListener("message", handleMessage); | ||
|
||
iframe1.onload = (() => { | ||
iframe1.contentWindow.postMessage({scrollBy: -1, left: iframe1.offsetLeft, top: iframe1.offsetTop}, "*"); | ||
}); | ||
|
||
</script> |
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
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
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
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