XBL:XBL 1.0 Reference:DOM Interfaces
From MDC
Contents |
[edit] The DocumentXBL Interface
The DocumentXBL interface contains methods for loading and obtaining binding documents. The interface is implemented by DOM documents that support XBL.
[edit] IDL Definition
interface DocumentXBL {
NodeList getAnonymousNodes(in Element elt);
Element getAnonymousElementByAttribute(in Element elt,
in DOMString attrName,
in DOMString attrValue);
/* NOT IMPLEMENTED
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);
};
[edit] Methods
[edit] 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 ofgetAnonymousNodesis aNodeListthat represents the anonymous children of an element after insertion points and element tags have been applied.
-
[edit] 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 ofgetAnonymousElementByAttributeis an anonymous decendant of the given element with matching attribute name and value.
-
[edit] addBinding
NOT IMPLEMENTED
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. -
bindingURLof typeDOMString- A URI that specifies the location of a specific binding to attach.
-
- No Return Value
[edit] removeBinding
NOT IMPLEMENTED
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. -
bindingURLof typeDOMString- A URI that specifies the location of a specific binding to detach.
-
- No Return Value
[edit] 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 ofgetBindingParentis the element responsible for the given anonymous node.
-
[edit] 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
-
documentURLof typeDOMString- The URL of a binding document.
-
- Return Value
-
Document- The return value ofloadBindingDocumentis the binding document used by the calling document to attach bindings that are defined in the binding document.
-