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

Side by Side Diff: third_party/WebKit/LayoutTests/shadow-dom/v0/pointer-lock-in-shadow2.html

Issue 2086293004: Document/ShadowRoot split of pointerLockElement (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update UseCounters 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 <slot></slot>
hayato 2016/06/27 06:43:13 slot is invalid in v0 shadow trees.
kochi 2016/06/28 06:34:06 Done.
9 </template>
10 <div id='hostV0'>
11 <template data-mode='v0'>
12 <div id='hostV1inV0'>
13 <template data-mode='open'>
14 <canvas></canvas>
15 </template>
16 </div>
17 </template>
18 </div>
19 </div>
20
21 <script>
22 async_test((test) => {
23 document.onpointerlockerror = () => {
24 assert_true(false, 'onpointerlockerror is not expected.');
25 test.done();
26 };
27
28 document.onpointerlockchange = () => {
29 // Not interested in handling before or after exitPointerLock.
30 if (document.pointerLockElement === null)
31 return;
32
33 assert_equals(document.pointerLockElement, hostV1inV0, 'if it is in V1, return shadow host.');
34 assert_equals(host.shadowRoot.pointerLockElement, null);
35 assert_equals(hostV0.shadowRoot.pointerLockElement, null);
36 assert_equals(hostV1inV0.shadowRoot.pointerLockElement, canvas);
37
38 document.exitPointerLock();
39 test.done();
40 };
41
42 convertTemplatesToShadowRootsWithin(host);
43 var hostV1inV0 = hostV0.shadowRoot.querySelector('#hostV1inV0');
44
45 assert_equals(document.pointerLockElement, null);
46 assert_equals(host.shadowRoot.pointerLockElement, null);
47 assert_equals(hostV0.shadowRoot.pointerLockElement, null);
48 assert_equals(hostV1inV0.shadowRoot.pointerLockElement, null);
49
50 var canvas = hostV1inV0.shadowRoot.querySelector('canvas');
51 canvas.requestPointerLock();
52 }, 'Test for pointerLockElement adjustment for Shadow DOM V0/V1 combination.');
53 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698