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

Relaxing SVGList* item object equality in Blink/Chromium

From: Kouhei Ueno <kouhei@chromium.org>
Date: Tue, 10 Dec 2013 16:16:40 +0900
Message-ID: <CAPVAxLVgZ6a9oGQaTR=72sRCbXRawj00o=2z9tVhXN3D2LZcpA@mail.gmail.com>
To: www-svg@w3.org
Hi,

I am refactoring SVG DOM implementation in Blink/Chromium.
I would like to notify about an upcoming change in SVGList* implementations.

In the current implementation in Blink, we follow the spec stating
that "the inserted item is the item itself and not a copy" by
returning exactly the same item object. Thus, the javascript object
returned from the list is ensured to === the original object inserted
into the list.
http://www.w3.org/TR/SVG2/single-page.html#types-__svg__SVGLengthList__initialize

For example, "===" operator currently returns true for the following code:
var a = svg.createSVGLength();
var b = list.initialize(a);
console.log(a === b) // shows "true".

However, we are considering to change our behavior here. We would like
to return different javascript objects when retrieving list items.
Considering the previous example, the new implementation would return
a different javascript object for "b", thus making "a !== b".

We are not changing anything but "===". The retrieved object "b" would
behave just like the originally inserted item "a". Any change to "a"
would be synchronized to "b", so that "any changes made to the item
are immediately reflected in the list."

This change allows us to remove a complicated memory management code
only required to implement this behavior. If you are intereseted in
more implementation details, please see:
https://groups.google.com/a/chromium.org/d/topic/blink-dev/YzlGV_m_kzA/discussion

Thanks,
Kouhei Ueno
Received on Wednesday, 11 December 2013 08:33:38 UTC

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