This also introduces a minor change to functionality, but it's a change that previously threw a TypeError, so I don't think it can be considered a "breaking change". It's also more-or-less what the docs say this function does, although they're not specific.
This function no longer searches outside the containing SVG document; if it reaches this.root() without finding a matching element, it returns null.
This is, I think, what most devs would expect. If I call parents('.foo'), I expect the last element in that array to have the class foo. I'm confident most devs would agree.
Fixes the bugs in
Element.parents()
function.This also introduces a minor change to functionality, but it's a change that previously threw a TypeError, so I don't think it can be considered a "breaking change". It's also more-or-less what the docs say this function does, although they're not specific.
This function no longer searches outside the containing SVG document; if it reaches
this.root()
without finding a matching element, it returnsnull
.This is, I think, what most devs would expect. If I call
parents('.foo')
, I expect the last element in that array to have the classfoo
. I'm confident most devs would agree.