mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Fix resolved value of insets to use margin box instead of content box (#33906)
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
e667d2fa1b
commit
09fc988d3a
3 changed files with 4 additions and 14 deletions
|
@ -289,9 +289,6 @@ impl BoxFragment {
|
||||||
"Should not call this method on statically positioned box."
|
"Should not call this method on statically positioned box."
|
||||||
);
|
);
|
||||||
|
|
||||||
let (cb_width, cb_height) = (containing_block.width(), containing_block.height());
|
|
||||||
let content_rect = self.content_rect;
|
|
||||||
|
|
||||||
if let Some(resolved_sticky_insets) = self.resolved_sticky_insets {
|
if let Some(resolved_sticky_insets) = self.resolved_sticky_insets {
|
||||||
return resolved_sticky_insets;
|
return resolved_sticky_insets;
|
||||||
}
|
}
|
||||||
|
@ -312,6 +309,7 @@ impl BoxFragment {
|
||||||
// used value. Otherwise the resolved value is the computed value."
|
// used value. Otherwise the resolved value is the computed value."
|
||||||
// https://drafts.csswg.org/cssom/#resolved-values
|
// https://drafts.csswg.org/cssom/#resolved-values
|
||||||
let insets = self.style.get_position();
|
let insets = self.style.get_position();
|
||||||
|
let (cb_width, cb_height) = (containing_block.width(), containing_block.height());
|
||||||
if position == ComputedPosition::Relative {
|
if position == ComputedPosition::Relative {
|
||||||
let get_resolved_axis = |start: &LengthPercentageOrAuto,
|
let get_resolved_axis = |start: &LengthPercentageOrAuto,
|
||||||
end: &LengthPercentageOrAuto,
|
end: &LengthPercentageOrAuto,
|
||||||
|
@ -336,6 +334,7 @@ impl BoxFragment {
|
||||||
position == ComputedPosition::Fixed || position == ComputedPosition::Absolute
|
position == ComputedPosition::Fixed || position == ComputedPosition::Absolute
|
||||||
);
|
);
|
||||||
|
|
||||||
|
let margin_rect = self.margin_rect();
|
||||||
let resolve = |value: &LengthPercentageOrAuto, container_length: Au| -> Au {
|
let resolve = |value: &LengthPercentageOrAuto, container_length: Au| -> Au {
|
||||||
value
|
value
|
||||||
.auto_is(LengthPercentage::zero)
|
.auto_is(LengthPercentage::zero)
|
||||||
|
@ -348,7 +347,7 @@ impl BoxFragment {
|
||||||
resolve(&insets.bottom, cb_height),
|
resolve(&insets.bottom, cb_height),
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
(content_rect.origin.y, cb_height - content_rect.max_y())
|
(margin_rect.origin.y, cb_height - margin_rect.max_y())
|
||||||
};
|
};
|
||||||
let (left, right) = if self.overconstrained.width {
|
let (left, right) = if self.overconstrained.width {
|
||||||
(
|
(
|
||||||
|
@ -356,7 +355,7 @@ impl BoxFragment {
|
||||||
resolve(&insets.right, cb_width),
|
resolve(&insets.right, cb_width),
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
(content_rect.origin.x, cb_width - content_rect.max_x())
|
(margin_rect.origin.x, cb_width - margin_rect.max_x())
|
||||||
};
|
};
|
||||||
|
|
||||||
convert_to_au_or_auto(PhysicalSides::new(top, right, bottom, left))
|
convert_to_au_or_auto(PhysicalSides::new(top, right, bottom, left))
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
[computed-style-005.html]
|
|
||||||
[absolute_computed_left_and_right]
|
|
||||||
expected: FAIL
|
|
|
@ -1,6 +0,0 @@
|
||||||
[enabled-disabled.html]
|
|
||||||
[Element updates when disabled]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Element updates when enabled]
|
|
||||||
expected: FAIL
|
|
Loading…
Add table
Add a link
Reference in a new issue