W3C home > Mailing lists > Public > www-svg@w3.org > December 2013

Re: Relaxing SVGList* item object equality in Blink/Chromium

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 13 Dec 2013 10:31:47 -0800
Message-ID: <CAAWBYDDYgOa=+XVrCmtdGtxkmbX8OiN+0F++snu5wB2F7p=tuQ@mail.gmail.com>
To: Kouhei Ueno <kouhei@google.com>
Cc: "Robert O'Callahan" <robert@ocallahan.org>, www-svg <www-svg@w3.org>
On Wed, Dec 11, 2013 at 7:45 PM, Kouhei Ueno <kouhei@google.com> wrote:
> For DOM attribute getters, I will explore alternative implementation
> designs so I can keep it consistent, guaranteeing svgElement.x ===
> svgElement.x, and
> svgElement.x.baseVal === svgElement.x.baseVal.

Yes, please do so.

I think it's acceptable to ask to relax the requirement that setting a
value in a list is a move, not a copy.  In general, the following
should hold:

var a = makeFoo();
bar.foo = a;
var b = bar.foo;
// it's okay for a !== b to be true here
var c = bar.foo;
// b === c *must* be true

> What do you think about list item getters? They are methods, not attributes.
> Would your opinion be different for "list.getItem(0) !== list.getItem(0)"?

They should return the same.  The fact that the SVG interfaces use a
method rather than indexes to access elements is a silly legacy
detail.  It should be treated identically to list[0], which should
return the same object each time as well.

Received on Friday, 13 December 2013 18:32:34 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:54:49 UTC