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

Side by Side Diff: third_party/WebKit/LayoutTests/shadow-dom/v0/pointer-lock-in-shadow.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, 5 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='v0'>
8 <content></content>
9 </template>
10 <div id='hostV0'>
11 <template data-mode='v0'>
12 <canvas></canvas>
13 </template>
14 </div>
15 </div>
16
17 <script>
18 async_test((test) => {
19 document.onpointerlockerror = () => {
20 assert_true(false, 'onpointerlockerror is not expected.');
21 test.done();
22 };
23
24 document.onpointerlockchange = () => {
25 // Not interested in handling before or after exitPointerLock.
26 if (document.pointerLockElement === null)
27 return;
28
29 assert_equals(document.pointerLockElement, canvas, 'if in V0, return the target itself.');
30 assert_equals(host.shadowRoot.pointerLockElement, null);
31 assert_equals(hostV0.shadowRoot.pointerLockElement, null);
32
33 document.exitPointerLock();
34 test.done();
35 };
36
37 convertTemplatesToShadowRootsWithin(host);
38
39 assert_equals(document.pointerLockElement, null);
40 assert_equals(host.shadowRoot.pointerLockElement, null);
41 assert_equals(hostV0.shadowRoot.pointerLockElement, null);
42
43 var canvas = hostV0.shadowRoot.querySelector('canvas');
44 canvas.requestPointerLock();
45 }, 'Test for pointerLockElement adjustment for Shadow DOM V0/V1 combination.');
46 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698