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

Delta Between Two Patch Sets: LayoutTests/imported/w3c/web-platform-tests/intersection-observer/unclipped-root.html

Issue 359780043: WIP for IO
Left Patch Set: Now pass 15 out of 24 WPTs 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 #root {
13 overflow: visible;
14 height: 200px;
15 width: 160px;
16 border: 7px solid black;
17 }
18 #target {
19 width: 100px;
20 height: 100px;
21 background-color: green;
22 }
23 </style>
24
25 <div id="root">
26 <div id="target" style="transform: translateY(300px)"></div>
27 </div>
28
29 <script>
30 var entries = [];
31 var target;
32
33 runTestCycle(function() {
34 target = document.getElementById("target");
35 assert_true(!!target, "target exists");
36 var root = document.getElementById("root");
37 assert_true(!!root, "root exists");
38 var observer = new IntersectionObserver(function(changes) {
39 entries = entries.concat(changes)
40 }, {root: root});
41 observer.observe(target);
42 entries = entries.concat(observer.takeRecords());
43 assert_equals(entries.length, 0, "No initial notifications.");
44 runTestCycle(step0, "First rAF.");
45 }, "Test that border bounding box is used to calculate intersection with a non-s crolling root.");
46
47 function step0() {
48 target.style.transform = "translateY(195px)";
49 runTestCycle(step1, "target.style.transform = 'translateY(195px)'");
50 checkLastEntry(entries, 0, [15, 115, 315, 415, 0, 0, 0, 0, 8, 182, 8, 222, fal se]);
51 }
52
53 function step1() {
54 target.style.transform = "";
55 checkLastEntry(entries, 1, [15, 115, 210, 310, 15, 115, 210, 222, 8, 182, 8, 2 22, true]);
56 }
57 </script>
LEFTRIGHT

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