Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why prefer HTMLElement? #126

Open
saschanaz opened this issue Sep 25, 2018 · 4 comments
Open

Why prefer HTMLElement? #126

saschanaz opened this issue Sep 25, 2018 · 4 comments

Comments

@saschanaz
Copy link

I found that the code prefers HTMLElement to Element:

var Element = w.HTMLElement || w.Element;

...and causes adding scrollIntoView() to HTMLElement instead of Element. What was the reasoning there?

@iamdustan
Copy link
Owner

🤷‍♂️ do you have an argument or reasoning to change it that is currently broken?

@saschanaz
Copy link
Author

Recalling what was the problem... Ah, it caused feature detection to falsely fail, as the code expected Element.prototype.scrollIntoView to exist.

@elliottregan
Copy link

elliottregan commented Sep 16, 2019

That's a good point. MDN has .scrollIntoView() listed under Element, which is backed up by the CSSOM View Module spec.

Looks like it should prefer Element over HTMLElement. I haven't tested this with other implementations of Element, like SVGElement, but it sounds like it should work in browsers that support the extension, and so this polyfill should allow that, as well.

@acontreras89
Copy link

Possibly related to #153

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants