A user account is required in order to edit this wiki, but we've had to disable public user registrations due to spam.
To request an account, ask an autoconfirmed user on Chat (such as one of these permanent autoconfirmed members).
Component Model Progressive Enhancement
Jump to navigation
Jump to search
A. While adding an element to a DOM tree:
- Check for existence of the
becomes
attribute. If the attribute exists:- Check the value of the
becomes
attribute against the names of already defined elements.- If such element exists, go to step X.
- Otherwise, store a reference to this instance in a "may-become" table.
- Check the value of the
B. When a new element is registered:
- Check to see if there are any instances waiting in the "may-become" table for this element's name
- If so, collect all these instances and, for each instance, go to step X.
C. When the "becomes" attribute is set:
- If the element is in tree, go to step A 1.1.
X. Becoming another element (in Element existing instance).
- Create the element by the name, specified in the
becomes
attribute of the existing instance - If the existing instance is already in document tree:
- execute renameNode (or something better) to replace the old element with the newly created element.
- Otherwise, insert newly create element in DOM tree.
- Fire "
become
" event on the existing instance. - Set
became
property on the existing instance to point to the newly created element.