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

Unified Diff: third_party/WebKit/LayoutTests/shadow-dom/fullscreen-element-in-shadow-simple.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
Index: third_party/WebKit/LayoutTests/shadow-dom/fullscreen-element-in-shadow-simple.html
diff --git a/third_party/WebKit/LayoutTests/shadow-dom/fullscreen-element-in-shadow-simple.html b/third_party/WebKit/LayoutTests/shadow-dom/fullscreen-element-in-shadow-simple.html
new file mode 100644
index 0000000000000000000000000000000000000000..ecec654d58a77f894ee4cca7c89199cb1f446046
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/shadow-dom/fullscreen-element-in-shadow-simple.html
@@ -0,0 +1,43 @@
+<!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='host0'>
+ <template data-mode='open'>
+ <canvas></canvas>
+ </template>
+</div>
+
+<script>
+convertTemplatesToShadowRootsWithin(host0);
+
+async_test((test) => {
+ document.onfullscreenerror = test.unreached_func('onfullscreenerror is not expected.');
+
+ // All fullscreenElement should default to null.
+ assert_equals(document.fullscreenElement, null);
+ assert_equals(document.webkitFullscreenElement, null);
+ assert_equals(document.webkitCurrentFullScreenElement, null);
+ assert_equals(host0.shadowRoot.fullscreenElement, null);
+
+ var canvas = host0.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, host0);
+ assert_equals(document.webkitFullscreenElement, host0);
+ assert_equals(document.webkitCurrentFullScreenElement, host0);
+
+ assert_equals(host0.shadowRoot.fullscreenElement, canvas);
+ document.exitFullscreen();
+ test.done();
+ });
+
+}, 'Test for fullscreenElement adjustment for single shadow tree.');
+</script>

Powered by Google App Engine
This is Rietveld 408576698