Thanks for your feedback!
I'm pretty sure that I'm currently indoctrinated to the way the current implementation works, so I'd really appreciate your feedback on the design. "Why does this part complicated?" questions are highly welcomed. :)
Regarding the new SVG DOM, I hope we can only support the new one. The API looks way better than the current one. It seems to basically get rid of all complex part of the current tear-off spec.
On the other hand, supporting two parallel SVG DOM implementations sounds like a nightmare to me. It should be theoretically possible, but I'm sure it would complex the implementation even more.
As for breaking the current implementation partially, the only thing I have atm is to allow discarding of tear-offs with expandos. We currently discard expandos of tear-offs at GC. "rect.x.expando = 1234;" would disappear after GC. I made this retain in the new design, but this may not be needed.
If we don't need to retain expandos, we can always make tear-off objects on-the-fly, and never keep reference to them from SVGProperty implementation. This would remove the need for [KeepAttribute] hacks in the V8 bindings side, and we can remove few edges in the Blink side.
Below are other ideas I had, but seems not worth it:
* No dynamically updating tear-offs
In the current implementation, when we reference a tear-off at some point like "var x = rect.x.animVal;" The var x is NOT a snapshot at that point. It will be dynamically updated while animation.
I considered dropping support for this because I couldn't find any website which uses this. It seemed to me at first that "always snapshotting" would allow us to remove tear-offs at all.
However, given that we still have to support "write" operations like "rect.x.baseVal.value = 5;" It seems we still need to keep tear-offs as references instead of returning a snapshot value.
Also we need to keep a flag somewhere to tell if we are referencing the value in readonly mode or not, and it seems it is most simple to have it as a flag inside tear-off.
* Have baseVal == animVal all the time, even during animation.
This will badly break the spec, but not much website will be affected. The new spec will be something similar to this; It doesn't have baseVal/animVal only old baseVal.
However, this will not simplify the design much as we still have to keep the value snapshot before animation start so that we can restore the value after animation ended.