OLD | NEW |
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 23 matching lines...) Expand all Loading... |
34 return element; | 34 return element; |
35 } | 35 } |
36 | 36 |
37 function isShadowHost(node) | 37 function isShadowHost(node) |
38 { | 38 { |
39 return window.internals.oldestShadowRoot(node); | 39 return window.internals.oldestShadowRoot(node); |
40 } | 40 } |
41 | 41 |
42 function isShadowRoot(node) | 42 function isShadowRoot(node) |
43 { | 43 { |
44 return node instanceof window.WebKitShadowRoot; | 44 return node instanceof window.ShadowRoot; |
45 } | 45 } |
46 | 46 |
47 function isIframeElement(element) | 47 function isIframeElement(element) |
48 { | 48 { |
49 return element && element.nodeName == 'IFRAME'; | 49 return element && element.nodeName == 'IFRAME'; |
50 } | 50 } |
51 | 51 |
52 // You can spefify youngerShadowRoot by consecutive slashes. | 52 // You can spefify youngerShadowRoot by consecutive slashes. |
53 // See LayoutTests/fast/dom/shadow/get-element-by-id-in-shadow-root.html for act
ual usages. | 53 // See LayoutTests/fast/dom/shadow/get-element-by-id-in-shadow-root.html for act
ual usages. |
54 function getNodeInTreeOfTrees(path) | 54 function getNodeInTreeOfTrees(path) |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 debug('Traverse in backward.'); | 230 debug('Traverse in backward.'); |
231 showComposedShadowTreeByTraversingInBackward(node); | 231 showComposedShadowTreeByTraversingInBackward(node); |
232 | 232 |
233 debug(''); | 233 debug(''); |
234 } | 234 } |
235 | 235 |
236 function showNextNode(node) { | 236 function showNextNode(node) { |
237 var next = internals.nextNodeByWalker(node); | 237 var next = internals.nextNodeByWalker(node); |
238 debug('Next node of [' + dumpNode(node) + '] is [' + dumpNode(next) + ']'); | 238 debug('Next node of [' + dumpNode(node) + '] is [' + dumpNode(next) + ']'); |
239 } | 239 } |
OLD | NEW |