What is the DOM4 Attr interface used for?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

What is the DOM4 Attr interface used for?

Roy Walmsley

Hello all,

 

I, as a DOM novice, have been studying the DOM4 specification available on-line at https://www.w3.org/TR/dom/.

 

I see the definition of the “Attr” interface at section 4.8.1. What I do not see is any usage of this interface. There is the statement that “Attr” objects are simply known as attributes.

 

I ask the further question, how are element attributes defined? I see the “Element” interface defined in section 4.8. It has an attribute “attributes” of type “NamedNodeMap”.

 

Further, I note in section 8.2 that the interface “Attr” no longer inherits from “Node”, and is completely changed.

 

I make the assumption that, previously, individual “Element” attributes were defined as “Attr” objects which, inheriting the “Node” interface, could be listed in a “NamedNodeMap” attribute.

 

Now, however, it seems to me, that “NamedNodeMap” is not an appropriate type for the “attributes” attribute in the “Element” interface.

 

As I said at the start, I am a novice to the DOM, albeit that I have many years programming experience. So, apologies if I have this wrong. I would be very grateful for clarification.

 

Regards,

 

Roy Walmsley

Reply | Threaded
Open this post in threaded view
|

Re: What is the DOM4 Attr interface used for?

Anne van Kesteren-4
Hi Roy,

Welcome to the DOM community. These days we mostly hang out in
https://github.com/whatwg/dom and https://wiki.whatwg.org/wiki/IRC.

On Wed, Feb 17, 2016 at 4:39 PM, Roy Walmsley <[hidden email]> wrote:
> I, as a DOM novice, have been studying the DOM4 specification available
> on-line at https://www.w3.org/TR/dom/.

It's unfortunately not very clear, but you want to study
https://dom.spec.whatwg.org/ instead.


> I make the assumption that, previously, individual “Element” attributes were
> defined as “Attr” objects which, inheriting the “Node” interface, could be
> listed in a “NamedNodeMap” attribute.

Correct.


> Now, however, it seems to me, that “NamedNodeMap” is not an appropriate type
> for the “attributes” attribute in the “Element” interface.

It's not a correct name, but since it was only ever used by
attributes, changing the type of the things it holds is actually
possible. Having said that, we might have to change Attr objects back
to being Attr node objects. It's a little up in the air.


> As I said at the start, I am a novice to the DOM, albeit that I have many
> years programming experience. So, apologies if I have this wrong. I would be
> very grateful for clarification.

You're correct that it's a little weird, but unfortunately we cannot
right all wrongs, just a handful.

Kind regards,


--
https://annevankesteren.nl/

Reply | Threaded
Open this post in threaded view
|

RE: What is the DOM4 Attr interface used for?

Roy Walmsley
Anne,

Many thanks for your response.

While I understand how the situation arose, it still doesn't solve the problem of the level 4 specification. As it stands at the moment, the "Attr" interface is not included either directly or indirectly in the "Element" interface. Consequently, elements have no attributes. So it is effectively impossible to implement.

I can see that the "NamedNodeMap" interface is defined in the level 3 core, so cannot be changed without breaking level 3 and lower. Why don't you redefine it in Level 4 with the current definition from the living standard?

Leaving the level 4 specification in its current state requires, at the very least, a red comment highlighting the problem to users.

Regards,

Roy


-----Original Message-----
From: Anne van Kesteren [mailto:[hidden email]]
Sent: 19 February 2016 13:40
To: Roy Walmsley
Cc: [hidden email]
Subject: Re: What is the DOM4 Attr interface used for?

Hi Roy,

Welcome to the DOM community. These days we mostly hang out in https://github.com/whatwg/dom and https://wiki.whatwg.org/wiki/IRC.

On Wed, Feb 17, 2016 at 4:39 PM, Roy Walmsley <[hidden email]> wrote:
> I, as a DOM novice, have been studying the DOM4 specification
> available on-line at https://www.w3.org/TR/dom/.

It's unfortunately not very clear, but you want to study https://dom.spec.whatwg.org/ instead.


> I make the assumption that, previously, individual “Element”
> attributes were defined as “Attr” objects which, inheriting the “Node”
> interface, could be listed in a “NamedNodeMap” attribute.

Correct.


> Now, however, it seems to me, that “NamedNodeMap” is not an
> appropriate type for the “attributes” attribute in the “Element” interface.

It's not a correct name, but since it was only ever used by attributes, changing the type of the things it holds is actually possible. Having said that, we might have to change Attr objects back to being Attr node objects. It's a little up in the air.


> As I said at the start, I am a novice to the DOM, albeit that I have
> many years programming experience. So, apologies if I have this wrong.
> I would be very grateful for clarification.

You're correct that it's a little weird, but unfortunately we cannot right all wrongs, just a handful.

Kind regards,


--
https://annevankesteren.nl/


Reply | Threaded
Open this post in threaded view
|

Re: What is the DOM4 Attr interface used for?

Sebastian Zartner-3
On 20 February 2016 at 20:46, Roy Walmsley <[hidden email]> wrote:
Anne,

Many thanks for your response.

While I understand how the situation arose, it still doesn't solve the problem of the level 4 specification. As it stands at the moment, the "Attr" interface is not included either directly or indirectly in the "Element" interface. Consequently, elements have no attributes. So it is effectively impossible to implement.

That assumption is incorrect. The 'Element' interface has the 'attributes' property, which returns the DOM Level 3 'NamedNodeMap' (as you've already recognized).
 
I can see that the "NamedNodeMap" interface is defined in the level 3 core, so cannot be changed without breaking level 3 and lower. Why don't you redefine it in Level 4 with the current definition from the living standard?

The living standard *is* the current specification, superseding Level 4.

Sebastian

Leaving the level 4 specification in its current state requires, at the very least, a red comment highlighting the problem to users.

Regards,

Roy


-----Original Message-----
From: Anne van Kesteren [mailto:[hidden email]]
Sent: 19 February 2016 13:40
To: Roy Walmsley
Cc: [hidden email]
Subject: Re: What is the DOM4 Attr interface used for?

Hi Roy,

Welcome to the DOM community. These days we mostly hang out in https://github.com/whatwg/dom and https://wiki.whatwg.org/wiki/IRC.

On Wed, Feb 17, 2016 at 4:39 PM, Roy Walmsley <[hidden email]> wrote:
> I, as a DOM novice, have been studying the DOM4 specification
> available on-line at https://www.w3.org/TR/dom/.

It's unfortunately not very clear, but you want to study https://dom.spec.whatwg.org/ instead.


> I make the assumption that, previously, individual “Element”
> attributes were defined as “Attr” objects which, inheriting the “Node”
> interface, could be listed in a “NamedNodeMap” attribute.

Correct.


> Now, however, it seems to me, that “NamedNodeMap” is not an
> appropriate type for the “attributes” attribute in the “Element” interface.

It's not a correct name, but since it was only ever used by attributes, changing the type of the things it holds is actually possible. Having said that, we might have to change Attr objects back to being Attr node objects. It's a little up in the air.


> As I said at the start, I am a novice to the DOM, albeit that I have
> many years programming experience. So, apologies if I have this wrong.
> I would be very grateful for clarification.

You're correct that it's a little weird, but unfortunately we cannot right all wrongs, just a handful.

Kind regards,


--
https://annevankesteren.nl/



Reply | Threaded
Open this post in threaded view
|

RE: What is the DOM4 Attr interface used for?

Roy Walmsley

Sebastian,

 

Thanks for the further clarification. One last question, I hope …

 

If the living standard supersedes level 4 then where does it tell me that? If I go to your general standards page (https://www.w3.org/TR/#tr_DOM) I see nothing that tells me that the DOM specifications have been superseded. There is no reference to the living standard. And, on the living standards page (https://dom.spec.whatwg.org/) there is no reference to it superseding level 4.

 

As a potential user and developer I need to be able to determine, unambiguously, and easily, what the latest, current standard is.

 

Regards,

 

Roy

 

From: Sebastian Zartner [mailto:[hidden email]]
Sent: 21 February 2016 09:26
To: Roy Walmsley
Cc: Anne van Kesteren; [hidden email]
Subject: Re: What is the DOM4 Attr interface used for?

 

On 20 February 2016 at 20:46, Roy Walmsley <[hidden email]> wrote:

Anne,

Many thanks for your response.

While I understand how the situation arose, it still doesn't solve the problem of the level 4 specification. As it stands at the moment, the "Attr" interface is not included either directly or indirectly in the "Element" interface. Consequently, elements have no attributes. So it is effectively impossible to implement.

 

That assumption is incorrect. The 'Element' interface has the 'attributes' property, which returns the DOM Level 3 'NamedNodeMap' (as you've already recognized).
 

I can see that the "NamedNodeMap" interface is defined in the level 3 core, so cannot be changed without breaking level 3 and lower. Why don't you redefine it in Level 4 with the current definition from the living standard?

 

The living standard *is* the current specification, superseding Level 4.

Sebastian

 

Leaving the level 4 specification in its current state requires, at the very least, a red comment highlighting the problem to users.

Regards,

Roy


-----Original Message-----
From: Anne van Kesteren [mailto:[hidden email]]
Sent: 19 February 2016 13:40
To: Roy Walmsley
Cc: [hidden email]
Subject: Re: What is the DOM4 Attr interface used for?

Hi Roy,

Welcome to the DOM community. These days we mostly hang out in https://github.com/whatwg/dom and https://wiki.whatwg.org/wiki/IRC.

On Wed, Feb 17, 2016 at 4:39 PM, Roy Walmsley <[hidden email]> wrote:
> I, as a DOM novice, have been studying the DOM4 specification
> available on-line at https://www.w3.org/TR/dom/.

It's unfortunately not very clear, but you want to study https://dom.spec.whatwg.org/ instead.


> I make the assumption that, previously, individual “Element”
> attributes were defined as “Attr” objects which, inheriting the “Node”
> interface, could be listed in a “NamedNodeMap” attribute.

Correct.


> Now, however, it seems to me, that “NamedNodeMap” is not an
> appropriate type for the “attributes” attribute in the “Element” interface.

It's not a correct name, but since it was only ever used by attributes, changing the type of the things it holds is actually possible. Having said that, we might have to change Attr objects back to being Attr node objects. It's a little up in the air.


> As I said at the start, I am a novice to the DOM, albeit that I have
> many years programming experience. So, apologies if I have this wrong.
> I would be very grateful for clarification.

You're correct that it's a little weird, but unfortunately we cannot right all wrongs, just a handful.

Kind regards,


--
https://annevankesteren.nl/

 

Reply | Threaded
Open this post in threaded view
|

Re: What is the DOM4 Attr interface used for?

Anne van Kesteren-4
On Sun, Feb 21, 2016 at 11:31 AM, Roy Walmsley
<[hidden email]> wrote:
> If the living standard supersedes level 4 then where does it tell me that?

Well, "DOM4" is a fork (and out-of-date). I didn't know it was a W3C
Recommendation, but that's likely the result of W3C violating their
own Process document (as they did before with HTML 5.0 and other
documents).


> If I go to your general standards page (https://www.w3.org/TR/#tr_DOM) I see
> nothing that tells me that the DOM specifications have been superseded.
> There is no reference to the living standard. And, on the living standards
> page (https://dom.spec.whatwg.org/) there is no reference to it superseding
> level 4.
>
> As a potential user and developer I need to be able to determine,
> unambiguously, and easily, what the latest, current standard is.

https://platform.html5.org/ is a pretty good overview for that.


--
https://annevankesteren.nl/