Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1632)

Unified Diff: third_party/WebKit/LayoutTests/http/tests/intersection-observer/iframe-cross-origin.html

Issue 1806133002: IntersectionObserver: use an idle callback to send notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: typo Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/http/tests/intersection-observer/iframe-cross-origin.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/intersection-observer/iframe-cross-origin.html b/third_party/WebKit/LayoutTests/http/tests/intersection-observer/iframe-cross-origin.html
index 3324515a453456a0c2648cce43c58f7226ac0b4f..842d2a428dec31813e421ef5844fdf15516be91c 100644
--- a/third_party/WebKit/LayoutTests/http/tests/intersection-observer/iframe-cross-origin.html
+++ b/third_party/WebKit/LayoutTests/http/tests/intersection-observer/iframe-cross-origin.html
@@ -53,7 +53,8 @@ function handleMessage(event) {
} else if (event.data.hasOwnProperty('actual')) {
checkData(event.data.actual, event.data.expected);
} else if (event.data.hasOwnProperty('DONE')) {
- finishJSTest();
+ // See LayoutTests/intersection-observer/README for explanation of this requestIdleCallback.
+ requestIdleCallback(finishJSTest, {timeout: 100});
document.scrollingElement.scrollTop = 0;
} else {
requestAnimationFrame(function () { iframe.contentWindow.postMessage("", "*") });
@@ -61,7 +62,11 @@ function handleMessage(event) {
}
window.addEventListener("message", handleMessage);
+
iframe.onload = function() {
- iframe.contentWindow.postMessage("", "*")
-};
+ // See LayoutTests/intersection-observer/README for explanation of double RAF.
+ requestAnimationFrame(() => {
+ requestAnimationFrame(() => { iframe.contentWindow.postMessage("", "*") })
+ });
+}
</script>

Powered by Google App Engine
This is Rietveld 408576698