Re: What is the DOM4 Attr interface used for?

Sebastian Zartner <[email protected]> Sun, 21 Feb 2016 10:25:56 +0100
Newsgroups gmane.comp.web.dom.general
Message-ID <CAERejNaNpTbSSUicfPCFLK2Jt1ov+JLFgthV-Uk9+t+F9VFh_g@mail.gmail.com>
--001a114790a8df449c052c444e7a
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On 20 February 2016 at 20:46, Roy Walmsley <[email protected]>
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:[email protected]]
> Sent: 19 February 2016 13:40
> To: Roy Walmsley
> Cc: [email protected]
> 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 <[email protected]>
> 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 =E2=80=9CElement=E2=
=80=9D
> > attributes were defined as =E2=80=9CAttr=E2=80=9D objects which, inheri=
ting the =E2=80=9CNode=E2=80=9D
> > interface, could be listed in a =E2=80=9CNamedNodeMap=E2=80=9D attribut=
e.
>
> Correct.
>
>
> > Now, however, it seems to me, that =E2=80=9CNamedNodeMap=E2=80=9D is no=
t an
> > appropriate type for the =E2=80=9Cattributes=E2=80=9D attribute in the =
=E2=80=9CElement=E2=80=9D
> 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 sai=
d
> that, we might have to change Attr objects back to being Attr node object=
s.
> 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 righ=
t
> all wrongs, just a handful.
>
> Kind regards,
>
>
> --
> https://annevankesteren.nl/
>
>
>

--001a114790a8df449c052c444e7a
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On 2=
0 February 2016 at 20:46, Roy Walmsley <span dir=3D"ltr">&lt;<a href=3D"mai=
lto:[email protected]" target=3D"_blank">[email protected]<=
/a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:=
0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Anne,<br>
<br>
Many thanks for your response.<br>
<br>
While I understand how the situation arose, it still doesn&#39;t solve the =
problem of the level 4 specification. As it stands at the moment, the &quot=
;Attr&quot; interface is not included either directly or indirectly in the =
&quot;Element&quot; interface. Consequently, elements have no attributes. S=
o it is effectively impossible to implement.<br></blockquote><div><br></div=
><div>That assumption is incorrect. The &#39;Element&#39; interface has the=
 &#39;attributes&#39; property, which returns the DOM Level 3 &#39;NamedNod=
eMap&#39; (as you&#39;ve already recognized).<br>=C2=A0<br></div><blockquot=
e class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc sol=
id;padding-left:1ex">

I can see that the &quot;NamedNodeMap&quot; interface is defined in the lev=
el 3 core, so cannot be changed without breaking level 3 and lower. Why don=
&#39;t you redefine it in Level 4 with the current definition from the livi=
ng standard?<br></blockquote><div><br></div><div>The living standard *is* t=
he current specification, superseding Level 4.<br><br></div><div>Sebastian<=
br></div><div><br></div><blockquote class=3D"gmail_quote" style=3D"margin:0=
 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Leaving the level 4 specification in its current state requires, at the ver=
y least, a red comment highlighting the problem to users.<br><br></blockquo=
te><div></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;=
border-left:1px #ccc solid;padding-left:1ex">

Regards,<br>
<br>
Roy<br>
<br>
<br>
-----Original Message-----<br>
From: Anne van Kesteren [mailto:<a href=3D"mailto:[email protected]">annevk@=
annevk.nl</a>]<br>
Sent: 19 February 2016 13:40<br>
To: Roy Walmsley<br>
Cc: <a href=3D"mailto:[email protected]">[email protected]</a><br>
Subject: Re: What is the DOM4 Attr interface used for?<br>
<br>
Hi Roy,<br>
<br>
Welcome to the DOM community. These days we mostly hang out in <a href=3D"h=
ttps://github.com/whatwg/dom" rel=3D"noreferrer" target=3D"_blank">https://=
github.com/whatwg/dom</a> and <a href=3D"https://wiki.whatwg.org/wiki/IRC" =
rel=3D"noreferrer" target=3D"_blank">https://wiki.whatwg.org/wiki/IRC</a>.<=
br>
<br>
On Wed, Feb 17, 2016 at 4:39 PM, Roy Walmsley &lt;<a href=3D"mailto:roy.wal=
[email protected]">[email protected]</a>&gt; wrote:<br>
&gt; I, as a DOM novice, have been studying the DOM4 specification<br>
&gt; available on-line at <a href=3D"https://www.w3.org/TR/dom/" rel=3D"nor=
eferrer" target=3D"_blank">https://www.w3.org/TR/dom/</a>.<br>
<br>
It&#39;s unfortunately not very clear, but you want to study <a href=3D"htt=
ps://dom.spec.whatwg.org/" rel=3D"noreferrer" target=3D"_blank">https://dom=
.spec.whatwg.org/</a> instead.<br>
<br>
<br>
&gt; I make the assumption that, previously, individual =E2=80=9CElement=E2=
=80=9D<br>
&gt; attributes were defined as =E2=80=9CAttr=E2=80=9D objects which, inher=
iting the =E2=80=9CNode=E2=80=9D<br>
&gt; interface, could be listed in a =E2=80=9CNamedNodeMap=E2=80=9D attribu=
te.<br>
<br>
Correct.<br>
<br>
<br>
&gt; Now, however, it seems to me, that =E2=80=9CNamedNodeMap=E2=80=9D is n=
ot an<br>
&gt; appropriate type for the =E2=80=9Cattributes=E2=80=9D attribute in the=
 =E2=80=9CElement=E2=80=9D interface.<br>
<br>
It&#39;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&#39;s a little up in the air.<br>
<br>
<br>
&gt; As I said at the start, I am a novice to the DOM, albeit that I have<b=
r>
&gt; many years programming experience. So, apologies if I have this wrong.=
<br>
&gt; I would be very grateful for clarification.<br>
<br>
You&#39;re correct that it&#39;s a little weird, but unfortunately we canno=
t right all wrongs, just a handful.<br>
<br>
Kind regards,<br>
<br>
<br>
--<br>
<a href=3D"https://annevankesteren.nl/" rel=3D"noreferrer" target=3D"_blank=
">https://annevankesteren.nl/</a><br>
<br>
<br>
</blockquote></div><br></div></div>

--001a114790a8df449c052c444e7a--