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

Delta Between Two Patch Sets: LayoutTests/imported/w3c/web-platform-tests/intersection-observer/display-none.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 #target {
13 background-color: green;
14 width: 100px;
15 height: 100px;
16 }
17 </style>
18
19 <div id="target"></div>
20
21 <script>
22 var vw = document.documentElement.clientWidth;
23 var vh = document.documentElement.clientHeight;
24
25 var entries = [];
26
27 runTestCycle(function() {
28 var target = document.getElementById("target");
29 var root = document.getElementById("root");
30 var observer = new IntersectionObserver(function(changes) {
31 entries = entries.concat(changes)
32 });
33 observer.observe(target);
34 entries = entries.concat(observer.takeRecords());
35 assert_equals(entries.length, 0, "No initial notifications.");
36 runTestCycle(step0, "Intersecting notification after first rAF.");
37 }, "IntersectionObserver should send a not-intersecting notification for a targe t that gets display:none.");
38
39 function step0() {
40 runTestCycle(step1, "Not-intersecting notification after setting display:none on target.");
41 checkLastEntry(entries, 0, [8, 108, 8, 108, 8, 108, 8, 108, 0, vw, 0, vh, true ]);
42 target.style.display = "none";
43 }
44
45 function step1() {
46 runTestCycle(step2, "Intersecting notification after removing display:none on target.");
47 checkLastEntry(entries, 1, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, false]);
48 target.style.display = "";
49 }
50
51 function step2() {
52 checkLastEntry(entries, 2, [8, 108, 8, 108, 8, 108, 8, 108, 0, vw, 0, vh, true ]);
53 }
54 </script>
LEFTRIGHT

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