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

Unified Diff: third_party/WebKit/LayoutTests/intersection-observer/same-document-no-root.html

Issue 1545813002: Remove unnecessary RAF from tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@intersection-observer-document-root
Patch Set: rebaseline Created 4 years, 11 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/intersection-observer/same-document-no-root.html
diff --git a/third_party/WebKit/LayoutTests/intersection-observer/same-document-no-root.html b/third_party/WebKit/LayoutTests/intersection-observer/same-document-no-root.html
index 38e043ec1abff23dc45c050bb65506b3a2732671..d70bccf3677c241fbb66d8603df08220719110de 100644
--- a/third_party/WebKit/LayoutTests/intersection-observer/same-document-no-root.html
+++ b/third_party/WebKit/LayoutTests/intersection-observer/same-document-no-root.html
@@ -9,7 +9,6 @@
description("Simple intersection observer test with no explicit root and one document.");
var target = document.getElementById("target");
var entries = [];
-
observer_callback = function(changes) {
for (var i in changes)
entries.push(changes[i]);
@@ -17,16 +16,11 @@
var observer = new IntersectionObserver(observer_callback, {});
observer.observe(target);
- // TODO(szager): It shouldn't be necessary to RAF after the call to observer()
- // and before changing the scroll position, but it is.
-
- function step0() {
- setTimeout(function() {
- shouldBeEqualToNumber("entries.length", 0);
- document.scrollingElement.scrollTop = 300;
- requestAnimationFrame(step1);
- });
- }
+ onload = function() {
+ shouldBeEqualToNumber("entries.length", 0);
+ document.scrollingElement.scrollTop = 300;
+ requestAnimationFrame(step1);
+ };
function step1() {
setTimeout(function() {
@@ -76,5 +70,4 @@
});
}
- requestAnimationFrame(step0);
</script>

Powered by Google App Engine
This is Rietveld 408576698