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> |