You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Say I have a page with an inline SVG which contains a path element.
In Firefox if I do document.querySelector('path').closest('html') I'll get the HTML element.
But in IE11 with the polyfill currently in this repo, I get nothing. This is because parentElement isn't defined on SVG elements.
I notice that the polyfill in this repo doesn't match that on MDN. I guess it's been updated. The one currently on MDN has el.parentElement || el.parentNode in one spot, so I think this issue has been fixed there.
I was going to open a PR with the updated code, but noticed that this polyfill also polyfills Element.prototype.matches. With that in mind I'm not sure how the code for this repo should look. Should it import the Element.prototype.matches polyfill, and so rely on it as a dependency?
The text was updated successfully, but these errors were encountered:
Say I have a page with an inline SVG which contains a path element.
In Firefox if I do
document.querySelector('path').closest('html')
I'll get the HTML element.But in IE11 with the polyfill currently in this repo, I get nothing. This is because
parentElement
isn't defined on SVG elements.I notice that the polyfill in this repo doesn't match that on MDN. I guess it's been updated. The one currently on MDN has
el.parentElement || el.parentNode
in one spot, so I think this issue has been fixed there.https://developer.mozilla.org/en-US/docs/Web/API/Element/closest#Polyfill
I was going to open a PR with the updated code, but noticed that this polyfill also polyfills
Element.prototype.matches
. With that in mind I'm not sure how the code for this repo should look. Should it import theElement.prototype.matches
polyfill, and so rely on it as a dependency?The text was updated successfully, but these errors were encountered: