mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-12 19:19:30 +00:00
LibWeb: Subtract left inset from size_available_for_margins for abspos
Fixes https://github.com/LadybirdBrowser/ladybird/issues/712
This commit is contained in:
parent
715f033007
commit
0be57df54d
Notes:
sideshowbarker
2024-07-19 21:35:25 +09:00
Author: https://github.com/kalenikaliaksandr
Commit: 0be57df54d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/714
3 changed files with 34 additions and 1 deletions
|
@ -726,7 +726,7 @@ void FormattingContext::compute_width_for_absolutely_positioned_non_replaced_ele
|
|||
// If both margin-left and margin-right are auto,
|
||||
// solve the equation under the extra constraint that the two margins get equal values
|
||||
// FIXME: unless this would make them negative, in which case when direction of the containing block is ltr (rtl), set margin-left (margin-right) to 0 and solve for margin-right (margin-left).
|
||||
auto size_available_for_margins = width_of_containing_block - border_left - padding_left - width.to_px(box) - padding_right - border_right - right;
|
||||
auto size_available_for_margins = width_of_containing_block - border_left - padding_left - width.to_px(box) - padding_right - border_right - left - right;
|
||||
if (margin_left.is_auto() && margin_right.is_auto()) {
|
||||
margin_left = CSS::Length::make_px(size_available_for_margins / 2);
|
||||
margin_right = CSS::Length::make_px(size_available_for_margins / 2);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue