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

Side by Side Diff: LayoutTests/fast/dom/shadow/resources/shadow-dom.js

Issue 14508005: Support an Event Path API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: event.path() now returns a different view for each node. Created 7 years, 7 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 | Annotate | Revision Log
OLDNEW
1 function createShadowRoot() 1 function createShadowRoot()
2 { 2 {
3 var children = Array.prototype.slice.call(arguments); 3 var children = Array.prototype.slice.call(arguments);
4 if ((children[0] instanceof Object) && !(children[0] instanceof Node)) 4 if ((children[0] instanceof Object) && !(children[0] instanceof Node))
5 return {'isShadowRoot': true, 5 return {'isShadowRoot': true,
6 'attributes': children[0], 6 'attributes': children[0],
7 'children': children.slice(1)}; 7 'children': children.slice(1)};
8 return {'isShadowRoot': true, 8 return {'isShadowRoot': true,
9 'children': children}; 9 'children': children};
10 } 10 }
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 if (ids[i] != '') 74 if (ids[i] != '')
75 node = node.getElementById(ids[i]); 75 node = node.getElementById(ids[i]);
76 } 76 }
77 return node; 77 return node;
78 } 78 }
79 79
80 function dumpNode(node) 80 function dumpNode(node)
81 { 81 {
82 if (!node) 82 if (!node)
83 return 'null'; 83 return 'null';
84 var output = '' + node;
85 if (node.id) 84 if (node.id)
86 output += ' id=' + node.id; 85 return '#' + node.id;
87 return output; 86 return '' + node;
87 }
88
89 function dumpNodeList(nodeList) {
90 var result = "";
91 var length = nodeList.length;
92 for (var i = 0; i < length; i++)
93 result += dumpNode(nodeList[i]) + ", ";
94 result += "length: " + length;
95 return result;
88 } 96 }
89 97
90 function innermostActiveElement(element) 98 function innermostActiveElement(element)
91 { 99 {
92 element = element || document.activeElement; 100 element = element || document.activeElement;
93 if (isIframeElement(element)) { 101 if (isIframeElement(element)) {
94 if (element.contentDocument.activeElement) 102 if (element.contentDocument.activeElement)
95 return innermostActiveElement(element.contentDocument.activeElement) ; 103 return innermostActiveElement(element.contentDocument.activeElement) ;
96 return element; 104 return element;
97 } 105 }
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 { 164 {
157 for (var i = 0; i + 1 < elements.length; ++i) 165 for (var i = 0; i + 1 < elements.length; ++i)
158 shouldNavigateFocus(elements[i], elements[i + 1], 'forward'); 166 shouldNavigateFocus(elements[i], elements[i + 1], 'forward');
159 } 167 }
160 168
161 function testFocusNavigationBackward(elements) 169 function testFocusNavigationBackward(elements)
162 { 170 {
163 for (var i = 0; i + 1 < elements.length; ++i) 171 for (var i = 0; i + 1 < elements.length; ++i)
164 shouldNavigateFocus(elements[i], elements[i + 1], 'backward'); 172 shouldNavigateFocus(elements[i], elements[i + 1], 'backward');
165 } 173 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698