[whatwg] Introducing new elements is expensive
ian at hixie.ch
Fri Feb 25 04:20:03 PST 2005
I was just browsing through some of the proposals for WF2 and WA1 I've yet
to respond to, and I noticed that several of them suggest introducing new
While there are cases where new elements are appropriate, I'd like to
encourage anyone making proposals to consider new elements to be very
expensive. Introducing a new element:
* Requires a new DOM interface.
* Requires a lot of code to implement in native implementations.
* Requires changes to HTML parsers, which is *very* hard.
* Is a pain to implement in IE6.
* Makes it a lot harder for authors to style the document in legacy UA,
since the element doesn't appear in all legacy UAs, and not in the
same way when it does.
* Makes it a lot harder for authors to navigate the DOM in script, as the
elements have different index positions in the various DOM arrays.
I would recommend that suggestions avoid new elements, especially when
those elements have a lot of attributes, and especially when the element
has semantics very similar to an existing element.
Note that I consider the above problems to be a _lot_ worse than less-
than-ideal fallback in legacy UAs. Speaking of fallback, I also consider
it more important that legacy UAs get working fallback in all cases, thant
that authors can provide ideal fallback if they want. My experience with
the <object> element (which defaults to no fallback but allows for ideal
fallback) is that authors rarely bother providing alternatives.
If you do introduce a new element, please include a detailed definition of
the DOM interface that goes with it, along with definitions of each method
and attribute on that interface. You should also include a detailed
description of where the element can be placed, what can be placed inside
the element, what each attribute does, what happens when the element has
the wrong content, is in the wrong place, has the wrong attributes, or has
attributes with the wrong values, and finally what the processing model is
for when the element is correctly used. For an example of the detail you
need, look at the definitions of elements like <base> in the WA1 spec.
Ian Hickson U+1047E )\._.,--....,'``. fL
http://ln.hixie.ch/ U+263A /, _.. \ _\ ;`._ ,.
Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.'
More information about the whatwg