mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
layout: Take the white-space
property into account when computing
intrinsic sizes of inline flows. Improves Amazon.
This commit is contained in:
parent
f9a50c9be0
commit
f8b9b31680
5 changed files with 154 additions and 7 deletions
|
@ -331,6 +331,17 @@ impl IntrinsicISizesContribution {
|
|||
self.content_intrinsic_sizes.preferred_inline_size + sizes.preferred_inline_size
|
||||
}
|
||||
|
||||
/// Updates the computation so that the minimum is the sum of the current minimum and the
|
||||
/// given minimum and the preferred is the sum of the current preferred and the given
|
||||
/// preferred. This is used when laying out fragments in the inline direction when
|
||||
/// `white-space` is `pre` or `nowrap`.
|
||||
pub fn union_nonbreaking_inline(&mut self, sizes: &IntrinsicISizes) {
|
||||
self.content_intrinsic_sizes.minimum_inline_size =
|
||||
self.content_intrinsic_sizes.minimum_inline_size + sizes.minimum_inline_size;
|
||||
self.content_intrinsic_sizes.preferred_inline_size =
|
||||
self.content_intrinsic_sizes.preferred_inline_size + sizes.preferred_inline_size
|
||||
}
|
||||
|
||||
/// Updates the computation so that the minimum is the maximum of the current minimum and the
|
||||
/// given minimum and the preferred is the maximum of the current preferred and the given
|
||||
/// preferred. This can be useful when laying out fragments in the block direction (but note
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue