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

Side by Side Diff: third_party/WebKit/LayoutTests/shadow-dom/event-deeppath-with-slot.html

Issue 2039813008: Remove unnecessary calling offset{Top,Left} (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@clean-tests
Patch Set: 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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src='../resources/testharness.js'></script> 2 <script src='../resources/testharness.js'></script>
3 <script src='../resources/testharnessreport.js'></script> 3 <script src='../resources/testharnessreport.js'></script>
4 <script src='resources/shadow-dom.js'></script> 4 <script src='resources/shadow-dom.js'></script>
5 <div id='host1'> 5 <div id='host1'>
6 <input id='input1' slot='slot1'> 6 <input id='input1' slot='slot1'>
7 <template data-mode='open'> 7 <template data-mode='open'>
8 <slot name='slot1'></slot> 8 <slot name='slot1'></slot>
9 </template> 9 </template>
10 </div> 10 </div>
(...skipping 19 matching lines...) Expand all
30 <div id='input-parent' slot='slot3'> 30 <div id='input-parent' slot='slot3'>
31 <input id='input3'> 31 <input id='input3'>
32 </div> 32 </div>
33 </div> 33 </div>
34 <script> 34 <script>
35 35
36 test(function() { 36 test(function() {
37 var host1 = document.getElementById('host1'); 37 var host1 = document.getElementById('host1');
38 convertTemplatesToShadowRootsWithin(host1); 38 convertTemplatesToShadowRootsWithin(host1);
39 removeWhiteSpaceOnlyTextNodes(host1); 39 removeWhiteSpaceOnlyTextNodes(host1);
40 document.body.offsetLeft;
41 var input1 = document.getElementById('input1'); 40 var input1 = document.getElementById('input1');
42 var slot1 = host1.shadowRoot.querySelector('slot'); 41 var slot1 = host1.shadowRoot.querySelector('slot');
43 var shadowRoot = host1.shadowRoot; 42 var shadowRoot = host1.shadowRoot;
44 input1.onfocus = function(e) { 43 input1.onfocus = function(e) {
45 var expected_array1 = [input1, slot1, shadowRoot, host1, document.body, docu ment.documentElement, document, window]; 44 var expected_array1 = [input1, slot1, shadowRoot, host1, document.body, docu ment.documentElement, document, window];
46 assert_array_equals(e.composedPath(), expected_array1); 45 assert_array_equals(e.composedPath(), expected_array1);
47 }; 46 };
48 input1.focus(); 47 input1.focus();
49 }, 'Triggered in a slotted element, eventPath should go through shadow tree.'); 48 }, 'Triggered in a slotted element, eventPath should go through shadow tree.');
50 49
(...skipping 24 matching lines...) Expand all
75 var input3 = document.getElementById('input3') 74 var input3 = document.getElementById('input3')
76 var inputParent = document.getElementById('input-parent'); 75 var inputParent = document.getElementById('input-parent');
77 input3.onfocus = function(e) { 76 input3.onfocus = function(e) {
78 var expected_array3 = [input3, inputParent, slot3, shadowRoot2, host4, docum ent.body, document.documentElement, document, window]; 77 var expected_array3 = [input3, inputParent, slot3, shadowRoot2, host4, docum ent.body, document.documentElement, document, window];
79 assert_array_equals(e.composedPath(), expected_array3); 78 assert_array_equals(e.composedPath(), expected_array3);
80 }; 79 };
81 input3.focus(); 80 input3.focus();
82 }, 'EventPath works fine when event happens to a descendant of a slotted element .'); 81 }, 'EventPath works fine when event happens to a descendant of a slotted element .');
83 82
84 </script> 83 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698