This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
As a first step investigate what various browsers support. Then investigate what could be simplified in the model if they dropped support for those features. Then investigate whether those features could be dropped if worthwhile.
Gecko throws when you attempt to mutate an attribute's children and acts as if an attribute has no children. E.g. attr.firstChild returns null. attr.appendChild() throws a "HierarchyRequestError". Chrome allows mutating attribute children. Inserting a text node modifies both the inserted text node and the text node already present. IE10 throws just like Gecko. However, it does pretend there is either no child or a single text node child. Hopefully Chrome can start throwing for mutation. And hopefully it can even emulate Gecko in not exposing any children. (I'm assuming Safari is the same as Chrome here.) Now if these methods simply throw, removing them should be possible so there's still hope for attributes not being nodes I think.
In Gecko, how can you attempt to mutate the children if it has no children? If we can end up with Attr as a child-free Node type like Text it would be great. Beyond that, is there simplification to be had for making it not a Node at all?
Well you can attempt to use things like appendChild() and see them fail. If they are not nodes they do not have all the concepts associated with nodes: base URL, node document, cloning, adopting, ... Other algorithms do not have to worry about them.
It looks that these old property are often used for attributes: https://www.chromestatus.com/metrics/feature/timeline/popularity/348 more then Attr.textContent and Attr.ownerElement (which was added to the interface Attr): https://www.chromestatus.com/metrics/feature/timeline/popularity/349 https://www.chromestatus.com/metrics/feature/timeline/popularity/160
Given that Attr has no children in Gecko, I guess that Attr.textContent overrides Node.textContent to instead be an alias of value?
Use counters for the access and modification of Attr's child Text nodes in Blink: https://codereview.chromium.org/723393005/ If the usage is low, hopefully Blink can align with Gecko as a first step. textContent would need special casing, though.
textContent is already changed in the specification. Am I missing something?
Ah, I didn't know you'd changed the spec. Ignore me :)
Blink bug tracking this: https://code.google.com/p/chromium/issues/detail?id=305105
A potential problem was raised on public-html: https://lists.w3.org/Archives/Public/public-html/2015May/thread.html#msg90 If Attr.cloneNode() is in common use as a workaround for setAttribute() being stricter than the HTML parser, that could complicate the effort to make Attr not inherit from Node.
https://github.com/whatwg/dom/issues/102 covers this fine.