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

Unified Diff: third_party/WebKit/LayoutTests/shadow-dom/v0/pointer-lock-in-shadow3.html

Issue 2086293004: Document/ShadowRoot split of pointerLockElement (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update comments Created 4 years, 6 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/v0/pointer-lock-in-shadow3.html
diff --git a/third_party/WebKit/LayoutTests/shadow-dom/v0/pointer-lock-in-shadow3.html b/third_party/WebKit/LayoutTests/shadow-dom/v0/pointer-lock-in-shadow3.html
new file mode 100644
index 0000000000000000000000000000000000000000..9849b3d246d87406d44c61f2f7ec37f675ee9aca
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/shadow-dom/v0/pointer-lock-in-shadow3.html
@@ -0,0 +1,60 @@
+<!DOCTYPE html>
+<script src='../../resources/testharness.js'></script>
+<script src='../../resources/testharnessreport.js'></script>
+<script src='../resources/shadow-dom.js'></script>
+
+<div id='host'>
+ <template data-mode='v0'>
+ <content></content>
+ </template>
+ <div id='hostV1'>
+ <template data-mode='open'>
+ <div id='hostV1inV1'>
+ <template data-mode='open'>
+ <div id='hostV0inV1inV1'>
+ <template data-mode='v0'>
+ <canvas></canvas>
+ </template>
+ </div>
+ </template>
+ </div>
+ </template>
+ </div>
+</div>
+
+<script>
+async_test((test) => {
+ document.onpointerlockerror = () => {
+ assert_true(false, 'onpointerlockerror is not expected.');
+ test.done();
+ };
+
+ document.onpointerlockchange = () => {
+ // Not interested in handling before or after exitPointerLock.
+ if (document.pointerLockElement === null)
+ return;
+
+ assert_equals(document.pointerLockElement, canvas, 'if it is in V0 shadow, return as it is.');
+ assert_equals(host.shadowRoot.pointerLockElement, null);
+ assert_equals(hostV1.shadowRoot.pointerLockElement, hostV1inV1)
+ assert_equals(hostV1inV1.shadowRoot.pointerLockElement, canvas);
+ assert_equals(hostV0inV1inV1.shadowRoot.pointerLockElement, null);
+
+ document.exitPointerLock();
+ test.done();
+ };
+
+ convertTemplatesToShadowRootsWithin(host);
+ var hostV1inV1 = hostV1.shadowRoot.querySelector('#hostV1inV1');
+ var hostV0inV1inV1 = hostV1inV1.shadowRoot.querySelector('#hostV0inV1inV1');
+
+ assert_equals(document.pointerLockElement, null);
+ assert_equals(host.shadowRoot.pointerLockElement, null);
+ assert_equals(hostV1.shadowRoot.pointerLockElement, null);
+ assert_equals(hostV1inV1.shadowRoot.pointerLockElement, null);
+ assert_equals(hostV0inV1inV1.shadowRoot.pointerLockElement, null);
+
+ var canvas = hostV0inV1inV1.shadowRoot.querySelector('canvas');
+ canvas.requestPointerLock();
+}, 'Test for pointerLockElement adjustment for Shadow DOM V0/V1 combination.');
+</script>

Powered by Google App Engine
This is Rietveld 408576698