mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Mostly formatting improvements, but also recovering a pair of parenthesis that was accidentally removed, changing the logic. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
dc018b5f9f
commit
219a2f2038
7 changed files with 58 additions and 19 deletions
|
@ -945,7 +945,7 @@ impl FlexContainer {
|
|||
let max_box_size = self.config.flex_axis.vec2_to_flex_relative(max_box_size);
|
||||
let min_box_size = self.config.flex_axis.vec2_to_flex_relative(min_box_size);
|
||||
|
||||
(min_box_size.cross, max_box_size.cross.map(Into::into))
|
||||
(min_box_size.cross, max_box_size.cross)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1148,10 +1148,9 @@ impl NonReplacedFormattingContext {
|
|||
loop {
|
||||
// First try to place the block using the minimum size as the object size.
|
||||
placement_rect = placement.place();
|
||||
let proposed_inline_size = placement_rect.size.inline -
|
||||
pbm.padding_border_sums
|
||||
.inline
|
||||
.clamp_between_extremums(min_box_size.inline, max_box_size.inline);
|
||||
let proposed_inline_size = (placement_rect.size.inline -
|
||||
pbm.padding_border_sums.inline)
|
||||
.clamp_between_extremums(min_box_size.inline, max_box_size.inline);
|
||||
|
||||
// Now lay out the block using the inline size we calculated from the placement.
|
||||
// Later we'll check to see if the resulting block size is compatible with the
|
||||
|
|
|
@ -152,8 +152,7 @@ impl LogicalVec2<LengthPercentageOrAuto<'_>> {
|
|||
self.block
|
||||
.non_auto()
|
||||
.and_then(|value| value.maybe_to_used_value(containing_block_block_size))
|
||||
.map(|value| AuOrAuto::LengthPercentage(value))
|
||||
.unwrap_or(AuOrAuto::Auto)
|
||||
.map_or(AuOrAuto::Auto, AuOrAuto::LengthPercentage)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -182,14 +181,12 @@ impl LogicalVec2<LengthPercentageOrAuto<'_>> {
|
|||
.inline
|
||||
.non_auto()
|
||||
.and_then(|value| value.maybe_to_used_value(basis.inline))
|
||||
.map(|value| AuOrAuto::LengthPercentage(value))
|
||||
.unwrap_or(AuOrAuto::Auto),
|
||||
.map_or(AuOrAuto::Auto, AuOrAuto::LengthPercentage),
|
||||
block: self
|
||||
.block
|
||||
.non_auto()
|
||||
.and_then(|value| value.maybe_to_used_value(basis.block))
|
||||
.map(|value| AuOrAuto::LengthPercentage(value))
|
||||
.unwrap_or(AuOrAuto::Auto),
|
||||
.map_or(AuOrAuto::Auto, AuOrAuto::LengthPercentage),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -505,8 +505,8 @@ impl ComputedValuesExt for ComputedValues {
|
|||
.percentages_relative_to(Au::zero());
|
||||
PaddingBorderMargin {
|
||||
padding_border_sums: LogicalVec2 {
|
||||
inline: (padding.inline_sum() + border.inline_sum()),
|
||||
block: (padding.block_sum() + border.block_sum()),
|
||||
inline: padding.inline_sum() + border.inline_sum(),
|
||||
block: padding.block_sum() + border.block_sum(),
|
||||
},
|
||||
padding,
|
||||
border,
|
||||
|
@ -528,8 +528,8 @@ impl ComputedValuesExt for ComputedValues {
|
|||
.percentages_relative_to(containing_block_inline_size);
|
||||
PaddingBorderMargin {
|
||||
padding_border_sums: LogicalVec2 {
|
||||
inline: (padding.inline_sum() + border.inline_sum()),
|
||||
block: (padding.block_sum() + border.block_sum()),
|
||||
inline: padding.inline_sum() + border.inline_sum(),
|
||||
block: padding.block_sum() + border.block_sum(),
|
||||
},
|
||||
padding,
|
||||
border,
|
||||
|
|
|
@ -199,8 +199,8 @@ impl<'a> TableLayout<'a> {
|
|||
.unwrap_or_else(|| cell.style.border_width(writing_mode));
|
||||
|
||||
let padding_border_sums = LogicalVec2 {
|
||||
inline: (padding.inline_sum() + border.inline_sum()),
|
||||
block: (padding.block_sum() + border.block_sum()),
|
||||
inline: padding.inline_sum() + border.inline_sum(),
|
||||
block: padding.block_sum() + border.block_sum(),
|
||||
};
|
||||
|
||||
let (size, min_size, max_size) =
|
||||
|
@ -710,8 +710,8 @@ impl<'a> TableLayout<'a> {
|
|||
.auto_is(Au::zero);
|
||||
|
||||
let padding_border_sums = LogicalVec2 {
|
||||
inline: (padding.inline_sum() + border.inline_sum() + margin.inline_sum()),
|
||||
block: (padding.block_sum() + border.block_sum() + margin.block_sum()),
|
||||
inline: padding.inline_sum() + border.inline_sum() + margin.inline_sum(),
|
||||
block: padding.block_sum() + border.block_sum() + margin.block_sum(),
|
||||
};
|
||||
|
||||
let (size, min_size, max_size) =
|
||||
|
|
13
tests/wpt/meta/MANIFEST.json
vendored
13
tests/wpt/meta/MANIFEST.json
vendored
|
@ -55302,6 +55302,19 @@
|
|||
{}
|
||||
]
|
||||
],
|
||||
"new-fc-beside-float-with-min-width.html": [
|
||||
"6337a1f9ff88c2fe27c1c4e26a51d49c68901836",
|
||||
[
|
||||
null,
|
||||
[
|
||||
[
|
||||
"/css/reference/ref-filled-green-100px-square.xht",
|
||||
"=="
|
||||
]
|
||||
],
|
||||
{}
|
||||
]
|
||||
],
|
||||
"new-fc-relayout.html": [
|
||||
"97d8b9a2ff1f3be8aeab2c26817e7542511c59cb",
|
||||
[
|
||||
|
|
30
tests/wpt/tests/css/CSS2/floats/new-fc-beside-float-with-min-width.html
vendored
Normal file
30
tests/wpt/tests/css/CSS2/floats/new-fc-beside-float-with-min-width.html
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="author" title="Oriol Brufau" href="mailto:obrufau@igalia.com" />
|
||||
<link rel="help" href="https://www.w3.org/TR/CSS22/visuren.html#bfc-next-to-float" title="9.5 Floats">
|
||||
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht">
|
||||
<meta name="assert" content="#bfc should be 50px wide, not just 25px as per its min-width">
|
||||
<style>
|
||||
#wrapper {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
background: red;
|
||||
}
|
||||
#float {
|
||||
float: left;
|
||||
width: 50px;
|
||||
height: 100px;
|
||||
background: green;
|
||||
}
|
||||
#bfc {
|
||||
overflow: hidden;
|
||||
height: 100px;
|
||||
min-width: 25px;
|
||||
background: green;
|
||||
}
|
||||
</style>
|
||||
|
||||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
|
||||
<div id="wrapper">
|
||||
<div id="float"></div>
|
||||
<div id="bfc"></div>
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue