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

The values "true" and "false" are not allowed on boolean attributes. To ... #606

Merged
merged 1 commit into from
Jul 31, 2014
Merged

Conversation

JayBizzle
Copy link
Contributor

...represent a false value, the attribute has to be omitted altogether

…To represent a false value, the attribute has to be omitted altogether
@tomByrer
Copy link
Contributor

I'm curious; does this cause issues, or is there a spec you can link to please?
Seems to work fine as-is in Win7, Fx31, Chrome, IE10.

@JayBizzle
Copy link
Contributor Author

controls="false" doesn't work in Chrome on my machine (OS X), the controls are still visible

2.4.2 Boolean attributes

A number of attributes are boolean attributes. The presence of a boolean attribute on an element represents the true value, and the absence of the attribute represents the false value.

https://www.w3.org/html/wg/drafts/html/master/infrastructure.html#boolean-attributes

controls is a boolean value https://dev.w3.org/html5/spec-author-view/video.html#attr-media-controls.

Having controls="false" actually sets the value to true because of the presence of the attribute.

@tomByrer
Copy link
Contributor

Thanks for the link & info Jay. Doesn't make sense to me, but there it is.

Looking at the spec, all of the following are the same:

<video autoplay loop muted controls="true" id="myVideo">
<video autoplay loop muted controls="yes-it-is-on" id="myVideo">
<video autoplay loop muted controls="false" id="myVideo">
<video autoplay loop muted controls id="myVideo">

alvarotrigo added a commit that referenced this pull request Jul 31, 2014
The values "true" and "false" are not allowed on boolean attributes. To ...
@alvarotrigo alvarotrigo merged commit 40e0406 into alvarotrigo:master Jul 31, 2014
@alvarotrigo
Copy link
Owner

Thanks @JayBizzle !

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

Successfully merging this pull request may close these issues.

3 participants