[whatwg] classList should perhaps move from HTMLElement to Element

Tab Atkins Jr. jackalmage at gmail.com
Tue Nov 23 12:47:07 PST 2010


On Tue, Nov 23, 2010 at 12:25 PM, Anne van Kesteren <annevk at opera.com> wrote:
> On Tue, 23 Nov 2010 21:04:37 +0100, Jonas Sicking <jonas at sicking.cc> wrote:
>>
>> I agree that unless we get other groups in on this change, and get
>> things like SVG cross-references and CSS styling reacting to these id
>> and class-list changes, then we're just making things more confusing
>> by making the DOM pretend that the class changed, when no other
>> systems agree.
>
> Well yes, obviously .class notation, #id, etc. would all have to remain
> functioning. To me it makes sense to define ID/class-ness at the DOM level.
> CSS operates on that level too.

Right; CSS doesn't care what the underlying language is doing; it only
cares that, when mapping from the underlying language to the CSS
element-tree, there are things called "elements" arranged in a tree
structure, which have "ids", "classes", and "attributes".  It just so
happens that in HTML, the mapping is trivial.

Theoretically CSS isn't tied in any way to HTML or XML.  The WebSRT
mapping to CSS, for example, shows how a language that isn't
explicitly tree-based can still be mapped into a CSS element-tree and
then styled.

~TJ



More information about the whatwg mailing list