forked from SerenityOS/serenity
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LibWeb: Stop changing width of block-level flex containers during layout
If the parent BFC can come up with a nice stretch-fit width for the flex container, it will have already done so *before* even entering flex layout. There's no need to do it again, midway through the flex layout algorithm. This wasn't just unnecessary, but we were also doing it incorrectly and not taking margins into account when calculating the amount of available space for stretch-fit. This led to oversized flex containers in the presence of negative margins. Fixes SerenityOS#18614
- Loading branch information
1 parent
771208d
commit 1ebae7a
Showing
5 changed files
with
24 additions
and
4 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...line/max-width-on-child-block-with-width-auto-contributes-to-intrinsic-size-of-parent.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
...b/Layout/expected/flex/flex-container-with-max-width-and-negative-margin-in-same-axis.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Viewport <#document> at (0,0) content-size 800x600 children: not-inline | ||
BlockContainer <html> at (0,0) content-size 800x116 [BFC] children: not-inline | ||
BlockContainer <body> at (8,8) content-size 784x100 children: not-inline | ||
BlockContainer <div#container-of-flex> at (8,8) content-size 100x100 children: not-inline | ||
Box <div#flex> at (-92,8) content-size 200x100 flex-container(row) [FFC] children: not-inline | ||
BlockContainer <(anonymous)> at (-92,8) content-size 0x0 [BFC] children: inline | ||
TextNode <#text> |
2 changes: 1 addition & 1 deletion
2
Tests/LibWeb/Layout/expected/table/in-auto-height-flex-item.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...Web/Layout/input/flex/flex-container-with-max-width-and-negative-margin-in-same-axis.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!DOCTYPE html><html><head><style> | ||
#container-of-flex { | ||
max-width: 100px; | ||
} | ||
|
||
#flex { | ||
display: flex; | ||
margin-left: -100px; | ||
background-color: orange; | ||
height: 100px; | ||
} | ||
</style></head><body><div id="container-of-flex"><div id="flex"> </div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters