mirror of
https://github.com/servo/servo.git
synced 2025-09-27 23:30:08 +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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue