-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanonDOMI.xml
36 lines (33 loc) · 1.23 KB
/
anonDOMI.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?xml version="1.0"?>
<bindings xmlns="http://www.mozilla.org/xbl" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<binding id="demo">
<content>
<html:div anonid="foo">
<html:span anonid="fooHi">Hi</html:span>
</html:div>
<html:div anonid="bar">
</html:div>
</content>
<implementation>
<constructor>
<![CDATA[
// show this
console.log(this);
// getAnonymousNodes
const bindingChildNodes = document.getAnonymousNodes(this);
console.log(bindingChildNodes);
// getAnonymousElementByAttribute
const barElm = this.ownerDocument.getAnonymousElementByAttribute(this, "anonid", "bar");
const fooHiElm = document.getAnonymousElementByAttribute(this, "anonid", "fooHi");
console.log(barElm);
console.log(fooHiElm);
// getBindingParent
const barBindingParent = document.getBindingParent(barElm);
const fooHiBindingParent = document.getBindingParent(fooHiElm);
console.log(barBindingParent === fooHiBindingParent); // true
console.log(barBindingParent === this); // true
]]>
</constructor>
</implementation>
</binding>
</bindings>