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

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

Issue 1773553003: Removing dependency on js-test.js from shadow-dom.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove dependency on js-test.js from shadow-dom.js Created 4 years, 9 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/shadow/tabindex-slot.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // TODO(yuzus): These two functions below need cleaning up.
hayato 2016/03/08 04:36:46 Could you clarify that these functions are copied
yuzuchan 2016/03/08 06:48:07 Done.
2 function getOrCreateTestElement(id, tagName)
3 {
4 var element = document.getElementById(id);
5 if (element)
6 return element;
7
8 element = document.createElement(tagName);
9 element.id = id;
10 var refNode;
11 var parent = document.body || document.documentElement;
12 if (id == "description")
13 refNode = getOrCreateTestElement("console", "div");
14 else
15 refNode = parent.firstChild;
16
17 parent.insertBefore(element, refNode);
18 return element;
19 }
20
21 function debug(msg)
22 {
23 if (self._lazyTestResults) {
24 self._lazyTestResults.push(msg);
25 } else {
26 var span = document.createElement("span");
27 // insert it first so XHTML knows the namespace;
28 getOrCreateTestElement("console", "div").appendChild(span);
29 span.innerHTML = msg + '<br />';
30 };
31 }
32
33
1 function createShadowRoot() 34 function createShadowRoot()
2 { 35 {
3 var children = Array.prototype.slice.call(arguments); 36 var children = Array.prototype.slice.call(arguments);
4 if ((children[0] instanceof Object) && !(children[0] instanceof Node)) 37 if ((children[0] instanceof Object) && !(children[0] instanceof Node))
5 return attachShadow.apply(null, children); 38 return attachShadow.apply(null, children);
6 return {'isShadowRoot': true, 39 return {'isShadowRoot': true,
7 'children': children}; 40 'children': children};
8 } 41 }
9 42
10 // TODO(kochi): This is not pure attachShadow wrapper, but also handles createSh adowRoot() 43 // TODO(kochi): This is not pure attachShadow wrapper, but also handles createSh adowRoot()
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 return; 253 return;
221 } 254 }
222 if (direction == 'forward') 255 if (direction == 'forward')
223 navigateFocusForward(); 256 navigateFocusForward();
224 else 257 else
225 navigateFocusBackward(); 258 navigateFocusBackward();
226 if (isInnermostActiveElement(to)) 259 if (isInnermostActiveElement(to))
227 debug('PASS'); 260 debug('PASS');
228 else 261 else
229 debug('FAIL'); 262 debug('FAIL');
263 return isInnermostActiveElement(to);
230 } 264 }
231 265
232 function navigateFocusForward() 266 function navigateFocusForward()
233 { 267 {
234 eventSender.keyDown('\t'); 268 eventSender.keyDown('\t');
235 } 269 }
236 270
237 function navigateFocusBackward() 271 function navigateFocusBackward()
238 { 272 {
239 eventSender.keyDown('\t', ['shiftKey']); 273 eventSender.keyDown('\t', ['shiftKey']);
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 return node; 388 return node;
355 } 389 }
356 390
357 return null; 391 return null;
358 }; 392 };
359 393
360 if (!window.internals) 394 if (!window.internals)
361 return null; 395 return null;
362 return iter(root, id); 396 return iter(root, id);
363 } 397 }
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/shadow/tabindex-slot.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698