Closed stevejalim closed 3 years ago
This changeset improves the accessibility of embedded videos and fixes an overlooked HTML validation error.
(Related issue #1741)
title
frameborder
Example:
BEFORE <iframe width="480" height="270" src="https://www.youtube.com/embed/xTH0hb1nYoE?feature=oembed" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<iframe width="480" height="270" src="https://www.youtube.com/embed/xTH0hb1nYoE?feature=oembed" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
AFTER: <iframe allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="" height="270" src="https://www.youtube.com/embed/xTH0hb1nYoE?feature=oembed" title="Interview with Stan Leong" width="480">
<iframe allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="" height="270" src="https://www.youtube.com/embed/xTH0hb1nYoE?feature=oembed" title="Interview with Stan Leong" width="480">
This changeset improves the accessibility of embedded videos and fixes an overlooked HTML validation error.
(Related issue #1741)
Key changes:
title
attribute to the iframe, based on the page title, but only if there is not already a title presentframeborder
attribute, instead using CSS to ensure the iframe has no borderExample:
BEFORE
<iframe width="480" height="270" src="https://www.youtube.com/embed/xTH0hb1nYoE?feature=oembed" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
AFTER:
<iframe allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="" height="270" src="https://www.youtube.com/embed/xTH0hb1nYoE?feature=oembed" title="Interview with Stan Leong" width="480">
How to test