-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
fix: make boolean attributes set and check both the associated property and the attribute #4562
Conversation
Fixes #4351 |
src/js/utils/dom.js
Outdated
@@ -375,7 +375,7 @@ export function getAttributes(tag) { | |||
// known boolean attributes | |||
// we can check for matching boolean properties, but older browsers | |||
// won't know about HTML5 boolean attributes that we still read from | |||
const knownBooleans = ',' + 'autoplay,controls,loop,muted,default' + ','; | |||
const knownBooleans = ',' + 'autoplay,controls,playsinline,loop,muted,default' + ','; |
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.
Should default
here be defaultMuted
?
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.
I think this is supposed to be default
because <track>
els use a default
attribute. Going to add defaultMuted
in 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.
Sounds good.
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.
LGTM
…ty and the attribute (videojs#4562) Make boolean attributes like muted set the property video.muted = {{boolean}} and the attribute video.setAttribute('muted', 'muted') when changing the value. Also, in html5's createEl, we were setting/updating attributes for various properties but we were only setting the attributes and not also the properties but also autoplay was happening first rather than last which caused autoplay to fail because muted and playsinline weren't necessary set by that time. Fix videojs#4351.
…ty and the attribute Make boolean attributes like muted set the property video.muted = {{boolean}} and the attribute video.setAttribute('muted', 'muted') when changing the value. Also, in html5's createEl, we were setting/updating attributes for various properties but we were only setting the attributes and not also the properties but also autoplay was happening first rather than last which caused autoplay to fail because muted and playsinline weren't necessary set by that time. This is the 5.x version of #4562. Fix #4351.
…ty and the attribute (#4631) Make boolean attributes like muted set the property video.muted = {{boolean}} and the attribute video.setAttribute('muted', 'muted') when changing the value. Also, in html5's createEl, we were setting/updating attributes for various properties but we were only setting the attributes and not also the properties but also autoplay was happening first rather than last which caused autoplay to fail because muted and playsinline weren't necessary set by that time. This is the 5.x version of #4562. Fix #4351.
I don't think this is quite complete yet but this is the initial implementation for making boolean attributes like
muted
set the propertyvideo.muted = {{boolean}}
and the attributevideo.setAttribute('muted', 'muted')
when changing the value.Also, in html5's createEl, we were setting/updating attributes for various properties but we were only setting the attributes and not also the properties but also autoplay was happening first rather than last which caused autoplay to fail because
muted
andplaysinline
weren't necessary set by that time.