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

Unified Diff: third_party/WebKit/LayoutTests/shadow-dom/fullscreen-element-in-shadow-complex.html

Issue 2340263003: Move Document.fullscreenElement to DocumentOrShadowRoot (Closed)
Patch Set: Style nit Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/shadow-dom/fullscreen-element-in-shadow-simple.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/shadow-dom/fullscreen-element-in-shadow-complex.html
diff --git a/third_party/WebKit/LayoutTests/shadow-dom/fullscreen-element-in-shadow-complex.html b/third_party/WebKit/LayoutTests/shadow-dom/fullscreen-element-in-shadow-complex.html
new file mode 100644
index 0000000000000000000000000000000000000000..1613df980ad9669fd2104eeca772c59695e114f9
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/shadow-dom/fullscreen-element-in-shadow-complex.html
@@ -0,0 +1,75 @@
+<!DOCTYPE html>
+<script src='../resources/testharness.js'></script>
+<script src='../resources/testharnessreport.js'></script>
+<script src='resources/shadow-dom.js'></script>
+<script src='../fullscreen/trusted-event.js'></script>
+
+<div id='host1'>
+ <template data-mode='open'>
+ <slot></slot>
+ </template>
+ <div id='host2'>
+ <template data-mode='open'>
+ <div id='host3'>
+ <template data-mode='open'>
+ <canvas></canvas>
+ <div id='host4'>
+ <template data-mode='open'>
+ <div></div>
+ </template>
+ </div>
+ </template>
+ </div>
+ <div id='host5'>
+ <template data-mode='open'>
+ <div></div>
+ </template>
+ </div>
+ </template>
+ </div>
+</div>
+
+<script>
+async_test((test) => {
+ document.onfullscreenerror = test.unreached_func('onfullscreenerror is not expected.');
+
+ convertTemplatesToShadowRootsWithin(host1);
+
+ var host3 = host2.shadowRoot.querySelector('#host3');
+ var host4 = host3.shadowRoot.querySelector('#host4');
+ var host5 = host2.shadowRoot.querySelector('#host5');
+
+ // All fullscreenElement should default to null.
+ assert_equals(document.fullscreenElement, null);
+ assert_equals(document.webkitFullscreenElement, null);
+ assert_equals(document.webkitCurrentFullScreenElement, null);
+ assert_equals(host1.shadowRoot.fullscreenElement, null);
+ assert_equals(host2.shadowRoot.fullscreenElement, null);
+ assert_equals(host3.shadowRoot.fullscreenElement, null);
+ assert_equals(host4.shadowRoot.fullscreenElement, null);
+ assert_equals(host5.shadowRoot.fullscreenElement, null);
+
+ var canvas = host3.shadowRoot.querySelector('canvas');
+ trusted_request(canvas);
+
+ document.onfullscreenchange = test.step_func(() => {
+ // Not interested in handling before or after exitFullscreen.
+ if (document.fullscreenElement === null)
+ return;
+
+ assert_equals(document.fullscreenElement, host2);
+ assert_equals(document.webkitFullscreenElement, host2);
+ assert_equals(document.webkitCurrentFullScreenElement, host2);
+
+ assert_equals(host1.shadowRoot.fullscreenElement, null);
+ assert_equals(host2.shadowRoot.fullscreenElement, host3);
+ assert_equals(host3.shadowRoot.fullscreenElement, canvas);
+ assert_equals(host4.shadowRoot.fullscreenElement, null);
+ assert_equals(host5.shadowRoot.fullscreenElement, null);
+
+ document.exitFullscreen();
+ test.done();
+ });
+
+}, 'Test for fullscreenElement adjustment for multiple shadow trees.');
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/shadow-dom/fullscreen-element-in-shadow-simple.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698