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

Explore removing boolean attribute string value changes #4114

Open
timmywil opened this issue Jun 25, 2018 · 1 comment
Open

Explore removing boolean attribute string value changes #4114

timmywil opened this issue Jun 25, 2018 · 1 comment

Comments

@timmywil
Copy link
Member

@timmywil timmywil commented Jun 25, 2018

Description

Our boolean attribute handling tries to keep boolean attribute values valid according to the spec, by always setting the lowercased attribute name regardless of what value was set. However, we do this for all elements whether the boolean attribute is valid on that element or not. This is especially troublesome for custom elements.

Rather than checking the nodeName of the element to ensure the boolean attribute applies to that element, it may be doable to just allow any string through. It may not be technically valid, but I think it works in all browsers to set any string. We'd still want to keep the special handling for the value false (i.e. remove the attribute rather than set "false", which is actually true). Note that the string "false" would still be passed through.

Link to test case

See angular/angular.js#16602 (comment) for background.

@mgol
Copy link
Member

@mgol mgol commented Jul 14, 2019

For more context, previous disussion on the topic: #2946.

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

Successfully merging a pull request may close this issue.

None yet
2 participants