mozilla

Revision 105262 of DOM Interfaces

  • Revision slug: XBL/XBL_1.0_Reference/DOM_Interfaces
  • Revision title: DOM Interfaces
  • Revision id: 105262
  • Created:
  • Creator: Mook
  • Is current revision? No
  • Comment /* The DocumentXBL Interface */ - match implemention (nsIDOMDocumentXBL)

Revision Content

The DocumentXBL Interface

The DocumentXBL interface contains methods for loading and obtaining binding documents. The interface is implemented by DOM documents that support XBL.

IDL Definition

interface DocumentXBL {
  NodeList getAnonymousNodes(in Element elt);
  Element getAnonymousElementByAttribute(in Element elt,
                                         in DOMString attrName,
                                         in DOMString attrValue);

  void addBinding(in Element elt,
                  in DOMString bindingURL);
  void removeBinding(in Element elt,
                      in DOMString bindingURL);

  Element getBindingParent(in Node node);
  Document loadBindingDocument(in DOMString documentURL);
};

Methods

  • getAnonymousNodes - the getAnonymousNodes method retrieves the anonymous children of the specified element.
    • Parameters
      • elt - The element to retrieve anonymous children for.
    • Return Value
      • NodeList - The return value of getAnonymousNodes is a NodeList that represents the anonymous children of an element after insertion points and element tags have been applied.
  • getAnonymousElementByAttribute - The getAnonymousElementByAttribute methods retrieves an anonymous decendant with a specified attribute value. Typically used with an (arbitary) anonid attribute to retrieve a specific anonymous child in an XBL binding.
    • Parameters
      • elt - The element to retrieve anonymous children for.
      • attrName - The attribute name to look up.
      • attrValue - The attribute value to match.
    • Return Value
      • Element - The return value of getAnonymousElementByAttribute is an anonymous decendant of the given element with matching attribute name and value.
  • addBinding - The addBinding method attaches the specified binding (and any bindings that the binding inherits from) to an element. This call is not necessarily synchronous. The binding may not be attached yet when the call completes. See here for more information.
    • Parameters
      • elt - The element to attach a binding to.
      • bindingURL of type DOMString - A URI that specifies the location of a specific binding to attach.
    • No Return Value
  • removeBinding - The removeBinding method detaches the specified binding (and any bindings that the binding inherits from explicitly using the extends attribute) from the element. See here for more information.
    • Parameters
      • elt - The element to remove a binding from.
      • bindingURL of type DOMString - A URI that specifies the location of a specific binding to detach.
    • No Return Value
  • getBindingParent - The getBindingParent method is used to obtain the bound element with the binding attached that is responsible for the generation of the specified anonymous node. This method enables an author to determine the scope of any content node. When content at the document-level scope is passed in as an argument, the property's value is null.
    • Parameters
      • node - The node for which the bound element responsible for generation is desired.
    • Return Value
      • Element - The return value of getBindingParent is the element responsible for the given anonymous node.
  • loadBindingDocument - The loadBindingDocument method can be used to synchronously obtain the specified binding document for use within a particular document (the one on which the loadBindingDocument method was invoked). The binding document can then be modified programmatically using the DOM. Any subsequent bindings that are attached to elements within the document will be constructed from the modified binding document.
    • Parameters
      • documentURL of type DOMString - The URL of a binding document.
    • Return Value
      • Document - The return value of loadBindingDocument is the binding document used by the calling document to attach bindings that are defined in the binding document.

The ElementXBL Interface

The ElementXBL interface contains methods for accessing anonymous content and for obtaining anonymous parents in the altered model. The interface is implemented by DOM elements that support XBL.


IDL Definition

interface ElementXBL {
  readonly attribute NodeList xblChildNodes; 
  readonly attribute Element bindingOwner;
  readonly attribute Element anonymousParent;
  
  void addBinding(in DOMString bindingURL);
  void removeBinding(in DOMString bindingURL);
};

Properties

  • xblChildNodes - The xblChildNodes property is a NodeList that represents the true children of the element after insertion points and element tags have been applied. This property can be used to navigate the content model according to XBL after bindings have moved explicit and anonymous children using element and children tags.
  • bindingOwner - The bindingOwner property is used to obtain the bound element with the binding attached that is responsible for the generation of the specified anonymous node. This property enables an author to determine the scope of any content node. When content at the document-level scope is passed in as an argument, the property's value is null. See section 4.1 for more information.
  • anonymousParent - The anonymousParent property's value is the anonymous parent for an element that was placed underneath an insertion point using the children element in XBL or for a bound element that was repositioned using the element tag. When an element that was not repositioned is passed in as an argument, the property's value is null.

Methods

  • addBinding - The addBinding method attaches the specified binding (and any bindings that the binding inherits from) to an element. This call is not necessarily synchronous. The binding may not be attached yet when the call completes. See here for more information.
    • Parameters
      • bindingURL of type DOMString - A URI that specifies the location of a specific binding to attach.
    • No Return Value
  • removeBinding - The removeBinding method detaches the specified binding (and any bindings that the binding inherits from explicitly using the extends attribute) from the element. See here for more information.
    • Parameters
      • bindingURL of type DOMString - A URI that specifies the location of a specific binding to detach.
    • No Return Value

Revision Source

<p>
</p>
<h2 name="The_DocumentXBL_Interface">The DocumentXBL Interface</h2>
<p>The <code>DocumentXBL</code> interface contains methods for loading and obtaining binding documents. The interface is implemented by DOM documents that support XBL.
</p><p><b>IDL Definition</b>
</p>
<pre>interface DocumentXBL {
  NodeList getAnonymousNodes(in Element elt);
  Element getAnonymousElementByAttribute(in Element elt,
                                         in DOMString attrName,
                                         in DOMString attrValue);

  void addBinding(in Element elt,
                  in DOMString bindingURL);
  void removeBinding(in Element elt,
                      in DOMString bindingURL);

  Element getBindingParent(in Node node);
  Document loadBindingDocument(in DOMString documentURL);
};
</pre>
<p><b>Methods</b>
</p>
<ul><li> <code><b>getAnonymousNodes</b></code> - the <code>getAnonymousNodes</code> method retrieves the anonymous children of the specified element.
<ul><li> <i>Parameters</i>
<ul><li> <code>elt</code> - The element to retrieve anonymous children for.
</li></ul>
</li><li> <i>Return Value</i>
<ul><li> <code>NodeList</code> - The return value of <code>getAnonymousNodes</code> is a <code>NodeList</code> that represents the anonymous children of an element after insertion points and element tags have been applied.
</li></ul>
</li></ul>
</li></ul>
<ul><li> <code><b>getAnonymousElementByAttribute</b></code> - The <code>getAnonymousElementByAttribute</code> methods retrieves an anonymous decendant with a specified attribute value.  Typically used with an (arbitary) <code>anonid</code> attribute to retrieve a specific anonymous child in an XBL binding.
<ul><li> <i>Parameters</i>
<ul><li> <code>elt</code> - The element to retrieve anonymous children for.
</li><li> <code>attrName</code> - The attribute name to look up.
</li><li> <code>attrValue</code> - The attribute value to match.
</li></ul>
</li><li> <i>Return Value</i>
<ul><li> <code>Element</code> - The return value of <code>getAnonymousElementByAttribute</code> is an anonymous decendant of the given element with matching attribute name and value.
</li></ul>
</li></ul>
</li></ul>
<ul><li> <code><b>addBinding</b></code> - The <code>addBinding</code> method attaches the specified binding (and any bindings that the binding inherits from) to an element.  This call is not necessarily synchronous. The binding may not be attached yet when the call completes.  See <a href="en/XBL/XBL_1.0_Reference/Binding_Attachment_and_Detachment#Attachment_using_the_DOM">here</a> for more information.
<ul><li> <i>Parameters</i>
<ul><li> <code>elt</code> - The element to attach a binding to.
</li><li> <code>bindingURL</code> of type <code>DOMString</code> - A URI that specifies the location of a specific binding to attach.
</li></ul>
</li><li> <i>No Return Value</i>
</li></ul>
</li></ul>
<ul><li> <code><b>removeBinding</b></code> - The <code>removeBinding</code> method detaches the specified binding (and any bindings that the binding inherits from explicitly using the <code>extends</code> attribute) from the element. See <a href="en/XBL/XBL_1.0_Reference/Binding_Attachment_and_Detachment#The_bindingdetached_Event">here</a> for more information.
<ul><li> <i>Parameters</i>
<ul><li> <code>elt</code> - The element to remove a binding from.
</li><li> <code>bindingURL</code> of type <code>DOMString</code> - A URI that specifies the location of a specific binding to detach.
</li></ul>
</li><li> <i>No Return Value</i>
</li></ul>
</li></ul>
<ul><li> <code><b>getBindingParent</b></code> - The <code>getBindingParent</code> method is used to obtain the bound element with the binding attached that is responsible for the generation of the specified anonymous node. This method enables an author to determine the scope of any content node. When content at the document-level scope is passed in as an argument, the property's value is <code>null</code>.
<ul><li> <i>Parameters</i>
<ul><li> <code>node</code> - The node for which the bound element responsible for generation is desired.
</li></ul>
</li><li> <i>Return Value</i>
<ul><li> <code>Element</code> - The return value of <code>getBindingParent</code> is the element responsible for the given anonymous node.
</li></ul>
</li></ul>
</li></ul>
<ul><li> <code><b>loadBindingDocument</b></code> - The <code>loadBindingDocument</code> method can be used to synchronously obtain the specified binding document for use within a particular document (the one on which the <code>loadBindingDocument </code> method was invoked). The binding document can then be modified programmatically using the DOM. Any subsequent bindings that are attached to elements within the document will be constructed from the modified binding document.
<ul><li> <i>Parameters</i>
<ul><li> <code>documentURL</code> of type <code><a class="external" href="http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/core.html#DOMString">DOMString</a></code> - The URL of a binding document.
</li></ul>
</li><li> <i>Return Value</i>
<ul><li> <code>Document</code> - The return value of <code>loadBindingDocument</code> is the binding document used by the calling document to attach bindings that are defined in the binding document.
</li></ul>
</li></ul>
</li></ul>
<h2 name="The_ElementXBL_Interface">The ElementXBL Interface</h2>
<p>The <code>ElementXBL</code> interface contains methods for accessing anonymous content and for obtaining anonymous parents in the altered model. The interface is implemented by DOM elements that support XBL.
</p><p><br>
<b>IDL Definition</b>
</p>
<pre>interface ElementXBL {
  readonly attribute NodeList xblChildNodes; 
  readonly attribute Element bindingOwner;
  readonly attribute Element anonymousParent;
  
  void addBinding(in DOMString bindingURL);
  void removeBinding(in DOMString bindingURL);
};
</pre>
<p><b>Properties</b>
</p>
<ul><li> <code><b>xblChildNodes</b></code> - The <code>xblChildNodes</code> property is a <code>NodeList</code> that represents the true children of the element after insertion points and element tags have been applied. This property can be used to navigate the content model according to XBL after bindings have moved explicit and anonymous children using element and children tags.
</li><li> <code><b>bindingOwner</b></code> -  The <code>bindingOwner</code> property is used to obtain the bound element with the binding attached that is responsible for the generation of the specified anonymous node. This property enables an author to determine the scope of any content node. When content at the document-level scope is passed in as an argument, the property's value is <code>null</code>. See <a href="en/Section_4.1">section 4.1</a> for more information.
</li><li> <code><b>anonymousParent</b></code> - The <code>anonymousParent</code> property's value is the anonymous parent for an element that was placed underneath an insertion point using the <code>children</code> element in XBL or for a bound element that was repositioned using the <code>element</code> tag. When an element that was not repositioned is passed in as an argument, the property's value is <code>null</code>.
</li></ul>
<p><b>Methods</b>
</p>
<ul><li> <code><b>addBinding</b></code> - The <code>addBinding</code> method attaches the specified binding (and any bindings that the binding inherits from) to an element. This call is not necessarily synchronous. The binding may not be attached yet when the call completes. See <a href="en/XBL/XBL_1.0_Reference/Binding_Attachment_and_Detachment#Attachment_using_the_DOM">here</a> for more information.
<ul><li> <i>Parameters</i>
<ul><li> <code>bindingURL</code> of type <code>DOMString</code> - A URI that specifies the location of a specific binding to attach.
</li></ul>
</li><li> <i>No Return Value</i>
</li></ul>
</li><li> <code><b>removeBinding</b></code> - The <code>removeBinding</code> method detaches the specified binding (and any bindings that the binding inherits from explicitly using the <code>extends</code> attribute) from the element. See <a href="en/XBL/XBL_1.0_Reference/Binding_Attachment_and_Detachment#The_bindingdetached_Event">here</a> for more information.
<ul><li> <i>Parameters</i>
<ul><li> <code>bindingURL</code> of type <code>DOMString</code> - A URI that specifies the location of a specific binding to detach.
</li></ul>
</li><li> <i>No Return Value</i>
</li></ul>
</li></ul>
Revert to this revision