Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1722)

Delta Between Two Patch Sets: LayoutTests/imported/w3c/web-platform-tests/intersection-observer/observer-without-js-reference.html

Issue 359780043: WIP for IO
Left Patch Set: Make containing block test pass Created 5 years, 8 months ago
Right Patch Set: 22 tests pass Created 5 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
LEFTRIGHT
(no file at all)
1 <!DOCTYPE html>
2 <script src="/resources/testharness.js"></script>
3 <script src="/resources/testharnessreport.js"></script>
4 <script src="./resources/intersection-observer-test-utils.js"></script>
5
6 <style>
7 pre, #log {
8 position: absolute;
9 top: 0;
10 left: 200px;
11 }
12 .spacer {
13 height: calc(100vh + 100px);
14 }
15 #target {
16 width: 100px;
17 height: 100px;
18 background-color: green;
19 }
20 </style>
21 <div class="spacer"></div>
22 <div id="target"></div>
23 <div class="spacer"></div>
24
25 <script>
26 var entries = [];
27
28 runTestCycle(function() {
29 var target = document.getElementById("target");
30 assert_true(!!target, "Target exists");
31 function createObserver() {
32 new IntersectionObserver(function(changes) {
33 entries = entries.concat(changes)
34 }).observe(target);
35 }
36 createObserver();
37 runTestCycle(step0, "First rAF");
38 }, "IntersectionObserver that is unreachable in js should still generate notific ations.");
39
40 function step0() {
41 document.scrollingElement.scrollTop = 300;
42 runTestCycle(step1, "document.scrollingElement.scrollTop = 300");
43 assert_equals(entries.length, 1, "One notification.");
44 }
45
46 function step1() {
47 document.scrollingElement.scrollTop = 0;
48 assert_equals(entries.length, 2, "Two notifications.");
49 }
50 </script>
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b