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

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.

~TJ

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