-
Notifications
You must be signed in to change notification settings - Fork 169
Polyfill Element#getAttributeNames
.
#393
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
Conversation
@justinfagnani, isn't there some attribute ordering problem with IE11? Does this polyfill need to address that? |
There's no way to address this since the ordering is lost during parsing. We're already robust to ordering changes when using |
|
||
if (!Element_prototype.hasOwnProperty('getAttributeNames')) { | ||
Element_prototype.getAttributeNames = function getAttributeNames(this: Element): Array<string> { | ||
return map.call(getAttributes.call(this), attr => attr.name) as Array<string>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of storing the .attributes
getter, why not just call this.attributes
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's just so that this won't call into anything else that might wrap the attributes
getter after this polyfill is applied.
Adds a polyfill for
Element#getAttributeNames
.