mirror of
https://github.com/servo/servo.git
synced 2025-08-25 15:18:22 +01:00
layout: Stop making <video>
fall back to a preferred aspect ratio of 2 (#38705)
This is simpler, and has been successfully shipped in Blink. See https://github.com/w3c/csswg-drafts/issues/12053 for more information. Testing: Improves WPT tests. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
39629560c8
commit
f31edc5d6a
5 changed files with 4 additions and 38 deletions
|
@ -474,20 +474,10 @@ impl ReplacedContents {
|
|||
style: &ComputedValues,
|
||||
padding_border_sums: &LogicalVec2<Au>,
|
||||
) -> Option<AspectRatio> {
|
||||
style
|
||||
.preferred_aspect_ratio(
|
||||
self.inline_size_over_block_size_intrinsic_ratio(style),
|
||||
padding_border_sums,
|
||||
)
|
||||
.or_else(|| {
|
||||
matches!(self.kind, ReplacedContentKind::Video(_)).then(Self::default_aspect_ratio)
|
||||
})
|
||||
}
|
||||
|
||||
/// The aspect ratio of the default object sizes.
|
||||
/// <https://drafts.csswg.org/css-images-3/#default-object-size>
|
||||
pub(crate) fn default_aspect_ratio() -> AspectRatio {
|
||||
AspectRatio::from_content_ratio(2.0)
|
||||
style.preferred_aspect_ratio(
|
||||
self.inline_size_over_block_size_intrinsic_ratio(style),
|
||||
padding_border_sums,
|
||||
)
|
||||
}
|
||||
|
||||
/// The inline size that would result from combining the natural size
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
[intrinsic-size-fallback-video.html]
|
||||
[.wrapper 2]
|
||||
expected: FAIL
|
||||
|
||||
[.wrapper 3]
|
||||
expected: FAIL
|
||||
|
||||
[.wrapper 4]
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[video-aspect-ratio.html]
|
||||
[Aspect ratio for regular video with aspect-ratio:auto]
|
||||
expected: FAIL
|
|
@ -1,9 +1,3 @@
|
|||
[video-intrinsic-width-height.html]
|
||||
[only width attribute]
|
||||
expected: FAIL
|
||||
|
||||
[only height attribute]
|
||||
expected: FAIL
|
||||
|
||||
[both width/height attributes and style keeping aspect-ratio]
|
||||
expected: FAIL
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
[intrinsic_sizes.htm]
|
||||
[default height is still 150]
|
||||
expected: FAIL
|
||||
|
||||
[default width is still 300]
|
||||
expected: FAIL
|
Loading…
Add table
Add a link
Reference in a new issue