Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: third_party/WebKit/LayoutTests/intersection-observer/shadow-content.html

Issue 2298933003: [IntersectionObserver] Enable observations across shadow DOM roots. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/intersection-observer/shadow-content-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../resources/js-test.js"></script>
3 <script src="../resources/intersection-observer-helper-functions.js"></script>
4 <div id="host"></div>
5
6 <script>
7 description("Tests that observations can be made across shadow DOM boundaries.") ;
8 var entries = [];
9 var target;
10 var observer = new IntersectionObserver(changes => { entries = entries.concat(ch anges) });
11
12 onload = function() {
13 let shadowHost = document.getElementById("host");
14 let shadowRoot = shadowHost.createShadowRoot();
15 target = document.createElement('div');
16 target.style.cssText = "background-color: green; width:100px; height:100px";
17 shadowRoot.appendChild(target);
18 observer.observe(target);
19
20 entries = entries.concat(observer.takeRecords());
21 shouldBeEqualToNumber("entries.length", 0);
22 waitForNotification(step1);
23 };
24
25 function step1() {
26 shouldBeEqualToNumber("entries.length", 1);
27 if (entries.length > 0) {
28 shouldBeEqualToNumber("entries[0].boundingClientRect.left", 8);
29 shouldBeEqualToNumber("entries[0].boundingClientRect.right", 108);
30 shouldBeEqualToNumber("entries[0].boundingClientRect.top", 8);
31 shouldBeEqualToNumber("entries[0].boundingClientRect.bottom", 108);
32 shouldBeEqualToNumber("entries[0].intersectionRect.left", 8);
33 shouldBeEqualToNumber("entries[0].intersectionRect.right", 108);
34 shouldBeEqualToNumber("entries[0].intersectionRect.top", 8);
35 shouldBeEqualToNumber("entries[0].intersectionRect.bottom", 108);
36 shouldBeEqualToNumber("entries[0].rootBounds.left", 0);
37 shouldBeEqualToNumber("entries[0].rootBounds.right", 800);
38 shouldBeEqualToNumber("entries[0].rootBounds.top", 0);
39 shouldBeEqualToNumber("entries[0].rootBounds.bottom", 600);
40 shouldEvaluateToSameObject("entries[0].target", target);
41 }
42 finishJSTest();
43 }
44 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/intersection-observer/shadow-content-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698