Use intrinsic as default layout for video instead of responsive layout #6761
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
When we first implemented the video sanitizer, we chose the responsive layout because intrinsic was not initially available. Support for the intrinsic layout was added to
amp-video
in ampproject/amphtml#28349, but we didn't make the same change to the video sanitizer since it didn't seem necessary, even though we do use intrinsic as the default layout in the image sanitizer. However, I found a reason why it is needed. Namely, when a video is set to align left or right, it fails to render as responsive:Here's the markup I'm testing with:
Checklist