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

Side by Side Diff: third_party/WebKit/LayoutTests/shadow-dom/fullscreen-element-in-shadow.html

Issue 2340263003: Move Document.fullscreenElement to DocumentOrShadowRoot (Closed)
Patch Set: Update test. 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/virtual/stable/webexposed/global-interface-listing-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/testharness.js'></script>
3 <script src='../resources/testharnessreport.js'></script>
4 <script src='resources/shadow-dom.js'></script>
5
6 <div id='host'>
7 <template data-mode='open'>
8 <slot></slot>
9 </template>
10 <div id='host2'>
11 <template data-mode='open'>
12 <div id='host3'>
13 <template data-mode='open'>
14 <canvas></canvas>
foolip 2016/09/20 13:44:21 Can you turn this into the minimal tree needed for
kochi 2016/10/07 14:26:42 This tests cases where some trees are involved and
15 <div id='host4'>
16 <template data-mode='open'>
17 <div></div>
18 </template>
19 </div>
20 </template>
21 </div>
22 <div id='host5'>
23 <template data-mode='open'>
24 <div></div>
25 </template>
26 </div>
27 </template>
28 </div>
29 </div>
30
31 <script>
32 async_test((test) => {
33 document.onfullscreenerror = test.unreached_func('onfullscreenerror is not e xpected.');
34
35 document.onfullscreenchange = test.step_func_done(() => {
36 // Not interested in handling before or after exitFullscreen.
37 if (document.fullscreenElement === null)
38 return;
39
40 assert_equals(document.fullscreenElement, host2);
41 assert_equals(document.webkitFullscreenElement, host2);
42 assert_equals(document.webkitCurrentFullScreenElement, host2);
43
44 assert_equals(host.shadowRoot.fullscreenElement, null);
45 assert_equals(host.shadowRoot.webkitFullscreenElement, null);
46 assert_equals(host.shadowRoot.webkitCurrentFullScreenElement, null);
47
48 assert_equals(host2.shadowRoot.fullscreenElement, host3);
49 assert_equals(host2.shadowRoot.webkitFullscreenElement, host3);
50 assert_equals(host2.shadowRoot.webkitCurrentFullScreenElement, host3);
51
52 assert_equals(host3.shadowRoot.fullscreenElement, canvas);
53 assert_equals(host3.shadowRoot.webkitFullscreenElement, canvas);
54 assert_equals(host3.shadowRoot.webkitCurrentFullScreenElement, canvas);
55
56 assert_equals(host4.shadowRoot.fullscreenElement, null);
57 assert_equals(host4.shadowRoot.webkitFullscreenElement, null);
58 assert_equals(host4.shadowRoot.webkitCurrentFullScreenElement, null);
59
60 assert_equals(host5.shadowRoot.fullscreenElement, null);
61 assert_equals(host5.shadowRoot.webkitFullscreenElement, null);
62 assert_equals(host5.shadowRoot.webkitCurrentFullScreenElement, null);
63
64 document.exitFullscreen();
65 });
66
67 convertTemplatesToShadowRootsWithin(host);
68 var host3 = host2.shadowRoot.querySelector('#host3');
69 var host4 = host3.shadowRoot.querySelector('#host4');
70 var host5 = host2.shadowRoot.querySelector('#host5');
71
72 // All fullscreenElement should default to null.
73 assert_equals(document.fullscreenElement, null);
74 assert_equals(host.shadowRoot.fullscreenElement, null);
75 assert_equals(host2.shadowRoot.fullscreenElement, null);
76 assert_equals(host3.shadowRoot.fullscreenElement, null);
77 assert_equals(host4.shadowRoot.fullscreenElement, null);
78 assert_equals(host5.shadowRoot.fullscreenElement, null);
79
80 var canvas = host3.shadowRoot.querySelector('canvas');
81 if (window.testRunner) {
82 setTimeout(() => {
83 document.onclick = () => {
84 canvas.requestFullscreen();
foolip 2016/09/20 13:44:21 Tests for nested fullscreen cases and when the :-w
kochi 2016/10/07 14:26:42 Changed to use the function in fullscreen/trusted-
85 };
86 eventSender.mouseDown();
87 eventSender.mouseUp();
88 }, 0);
89 }
90 }, 'Test for fullscreenElement adjustment for Shadow DOM.');
91 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698