This document describes Extensible Binding Language (XBL) 1.0 as implemented in the most recent Firefox browsers (Firefox 22.214.171.124 at the moment this was written).
Extensible Binding Language is a XML-based markup language to implement reusable components (bindings) that can be bound to elements in other documents. The element with a binding specified, called the bound element, acquires the new behavior specified by the binding. Bindings can be bound to elements using Cascading Style Sheets (CSS) or DOM. One element can be be bound to several bindings at once.
Bindings can contain event handlers that are registered on the bound element, an implementation of new methods and properties that become accessible from the bound element, and anonymous content that is inserted around the bound element.
There are numerous adjustments in the current implementation in comparison of earlier XBL proposals, and not all of them are reflected yet in this document. The documentation process is still in progress: please keep it in your mind while using the provided information.
- Attachment using CSS
- Attachment using element.style property
- <constructor> call
- <destructor> call
- Binding Documents
- Scoping and Access Using the DOM
- Content Generation
- Attribute Forwarding
- Insertion Points
- Event Flow and Targeting
- Anonymous Content and CSS
Updated and adjusted for the current Firefox implementation.
This example is targeted to demonstrate the XBL usage rather than to be a practically useful application. For this reason it contains many comments and some blocks could be avoided in a more compact solution yet used here for demonstration purposes.
Original Document Information
- Last Updated Date: April 24, 2006