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

Delta Between Two Patch Sets: LayoutTests/imported/w3c/web-platform-tests/intersection-observer/shadow-content.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 </style>
13
14 <div id="host"></div>
15
16 <script>
17 var vw = document.documentElement.clientWidth;
18 var vh = document.documentElement.clientHeight;
19
20 var entries = [];
21 var target;
22
23 runTestCycle(function() {
24 var shadowHost = document.getElementById("host");
25 assert_true(!!shadowHost, "Host exists");
26 var shadowRoot = shadowHost.attachShadow({ mode: "open" });
27 assert_true(!!shadowRoot, "Shadow root exists");
28 shadowRoot.innerHTML = "<div id='target' style='width: 100px; height: 100px; b ackground-color: green;'></div>";
29 target = shadowRoot.getElementById("target");
30 assert_true(!!target, "target exists");
31
32 var observer = new IntersectionObserver(function(changes) {
33 entries = entries.concat(changes)
34 });
35 observer.observe(target);
36 entries = entries.concat(observer.takeRecords());
37 assert_equals(entries.length, 0, "No initial notifications.");
38 runTestCycle(step0, "First rAF after creating shadow DOM.");
39 }, "Observing a target inside shadow DOM.");
40
41 function step0() {
42 checkLastEntry(entries, 0, [8, 108, 8, 108, 8, 108, 8, 108, 0, vw, 0, vh, true ]);
43 }
44 </script>
LEFTRIGHT

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