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

Delta Between Two Patch Sets: LayoutTests/intersection-observer/root-element-moved.html

Issue 359780043: WIP for IO
Left Patch Set: Properly report root bounds Created 5 years, 8 months ago
Right Patch Set: Fix inline test while making sure the text test still passes too. Created 5 years, 7 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 <head>
3 <script src="../resources/testharness.js"></script>
4 <script src="../resources/testharnessreport.js"></script>
5 <body>
6
7 <div id="root" style="position:absolute">
8 <div id="target" style="width: 100px; height: 100px; background-color: green "></div>
9 </div>
10
11 <script>
12 var observer;
13 var root = document.getElementById('root');
14 var target = document.getElementById('target');
15 test(function() {
16 observer = new IntersectionObserver(function() {}, { root: document.getE lementById('root') });;
17 assert_equals(observer.root, root);
18 observer.observe(target);
19 assert_equals(internals.numberOfActiveIntersectionObservers(document), 1 );
20 document.body.appendChild(target);
21 var newDoc = document.implementation.createHTMLDocument('New document');
22 newDoc.body.appendChild(root);
23 assert_equals(internals.numberOfActiveIntersectionObservers(document), 0 );
24 assert_equals(internals.numberOfActiveIntersectionObservers(newDoc), 1);
25 document.body.appendChild(root);
26 assert_equals(internals.numberOfActiveIntersectionObservers(document), 1 );
27 assert_equals(internals.numberOfActiveIntersectionObservers(newDoc), 0);
28 },"Document's active intersection observers get updated");
29 </script>
30 </body>
31 </html>
LEFTRIGHT

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