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

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: nits. 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
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>
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, 'document.fullscreenEle ment should be shadow host2.');
41 assert_equals(host.shadowRoot.fullscreenElement, null, 'host\'s shadowRo ot.fullscreenElement should be null.');
42 assert_equals(host2.shadowRoot.fullscreenElement, host3, 'host2\'s shado wRoot.fullscreenElement should be host3.');
43 assert_equals(host3.shadowRoot.fullscreenElement, canvas, 'host3\'s shad owRoot.fullscreenElement should be canvas element.');
44 assert_equals(host4.shadowRoot.fullscreenElement, null, 'host4\'s shadow Root.fullscreenElement should be null.');
45 assert_equals(host5.shadowRoot.fullscreenElement, null, 'host5\'s shadow Root.fullscreenElement should be null.');
46
47 document.exitFullscreen();
48 });
49
50 convertTemplatesToShadowRootsWithin(host);
51 var host3 = host2.shadowRoot.querySelector('#host3');
52 var host4 = host3.shadowRoot.querySelector('#host4');
53 var host5 = host2.shadowRoot.querySelector('#host5');
54
55 // All fullscreenElement should default to null.
56 assert_equals(document.fullscreenElement, null);
57 assert_equals(host.shadowRoot.fullscreenElement, null);
58 assert_equals(host2.shadowRoot.fullscreenElement, null);
59 assert_equals(host3.shadowRoot.fullscreenElement, null);
60 assert_equals(host4.shadowRoot.fullscreenElement, null);
61 assert_equals(host5.shadowRoot.fullscreenElement, null);
62
63 var canvas = host3.shadowRoot.querySelector('canvas');
64 if (window.testRunner) {
65 setTimeout(() => {
66 document.onclick = () => {
67 canvas.requestFullscreen();
68 };
69 eventSender.mouseDown();
70 eventSender.mouseUp();
71 }, 0);
72 }
73 }, 'Test for fullscreenElement adjustment for Shadow DOM.');
74 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698