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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/shadow/offset-parent-does-not-leak-ua-shadow.html

Issue 2051703002: Implement closed shadow adjustment for Element.offsetParent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add one more test case. Created 4 years, 5 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/fast/dom/shadow/offset-parent-does-not-leak-ua-shadow-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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../../../resources/js-test.js"></script> 2 <script src="../../../resources/js-test.js"></script>
3 <body> 3 <body>
4 <div id="container" style="position: relative;"></div> 4 <div id="container" style="position: relative;"></div>
5 <script> 5 <script>
6 description('offsetParent should not leak nodes in user agent Shadow DOM.'); 6 description('offsetParent should not leak nodes in user agent Shadow DOM.');
7 7
8 if (!window.internals) 8 if (!window.internals)
9 fail('This test requires window.internals to manipulate user agent Shadow DO M.'); 9 fail('This test requires window.internals to manipulate user agent Shadow DO M.');
10 10
(...skipping 13 matching lines...) Expand all
24 var shadow = host.createShadowRoot(); 24 var shadow = host.createShadowRoot();
25 configureShadowRoot(shadow); 25 configureShadowRoot(shadow);
26 shouldBe('child.offsetParent', 'shadow.positionedElement'); 26 shouldBe('child.offsetParent', 'shadow.positionedElement');
27 27
28 // Test that offsetParent works 'through' Shadow DOM when there is no 28 // Test that offsetParent works 'through' Shadow DOM when there is no
29 // positioned ancestor in user agent Shadow DOM 29 // positioned ancestor in user agent Shadow DOM
30 shadow.positionedElement.removeAttribute('style'); 30 shadow.positionedElement.removeAttribute('style');
31 shouldBe('child.offsetParent', 'container'); 31 shouldBe('child.offsetParent', 'container');
32 32
33 // Test that when the offsetParent is in user agent Shadow DOM, it is 33 // Test that when the offsetParent is in user agent Shadow DOM, it is
34 // not exposed to script 34 // not exposed to script, but its shadow host or the host's ancestor
35 // which is appropriate as an offsetParent is returned.
35 host = document.createElement('details'); 36 host = document.createElement('details');
36 container.appendChild(host); 37 container.appendChild(host);
37 host.setAttribute('open', 'open'); 38 host.setAttribute('open', 'open');
38 host.appendChild(child); 39 host.appendChild(child);
39 var shadow = window.internals.youngestShadowRoot(host); // this is a UA shadow root 40 var shadow = window.internals.youngestShadowRoot(host); // this is a UA shadow root
40 configureShadowRoot(shadow); 41 configureShadowRoot(shadow);
41 shouldBe('child.offsetParent', 'null'); 42 shouldBe('child.offsetParent', 'container');
42 43
43 // Test that offsetParent works 'through' user agent Shadow DOM when there is no 44 // Test that offsetParent works 'through' user agent Shadow DOM when there is no
44 // positioned ancestor in user agent Shadow DOM 45 // positioned ancestor in user agent Shadow DOM
45 shadow.positionedElement.removeAttribute('style'); 46 shadow.positionedElement.removeAttribute('style');
46 shouldBe('child.offsetParent', 'container'); 47 shouldBe('child.offsetParent', 'container');
47 48
48 container.remove(); 49 container.remove();
49 50
50 successfullyParsed = true; 51 successfullyParsed = true;
51 </script> 52 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/shadow/offset-parent-does-not-leak-ua-shadow-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698