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: Use fit-content width if button's computed width is "auto"
Implements following line from the spec: "If the computed value of 'inline-size' is 'auto', then the used value is the fit-content inline size."
- Loading branch information
1 parent
7eee3f6
commit 6393944
Showing
5 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
Tests/LibWeb/Layout/expected/block-and-inline/button-width.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,29 @@ | ||
Viewport <#document> at (0,0) content-size 800x600 children: not-inline | ||
BlockContainer <html> at (0,0) content-size 800x58.9375 [BFC] children: not-inline | ||
BlockContainer <body> at (8,8) content-size 784x42.9375 children: not-inline | ||
BlockContainer <button.btn.fixed-width> at (13,10) content-size 190x17.46875 children: not-inline | ||
BlockContainer <(anonymous)> at (13,10) content-size 190x17.46875 flex-container(column) [FFC] children: not-inline | ||
BlockContainer <(anonymous)> at (13,10) content-size 190x17.46875 flex-item [BFC] children: inline | ||
line 0 width: 94.921875, height: 17.46875, bottom: 17.46875, baseline: 13.53125 | ||
frag 0 from TextNode start: 0, length: 11, rect: [61,10 94.921875x17.46875] | ||
"200px width" | ||
TextNode <#text> | ||
BlockContainer <button.btn> at (13,31.46875) content-size 324.671875x17.46875 children: not-inline | ||
BlockContainer <(anonymous)> at (13,31.46875) content-size 324.671875x17.46875 flex-container(column) [FFC] children: not-inline | ||
BlockContainer <(anonymous)> at (13,31.46875) content-size 324.671875x17.46875 flex-item [BFC] children: inline | ||
line 0 width: 324.671875, height: 17.46875, bottom: 17.46875, baseline: 13.53125 | ||
frag 0 from TextNode start: 0, length: 39, rect: [13,31.46875 324.671875x17.46875] | ||
"auto width should behave as fit-content" | ||
TextNode <#text> | ||
|
||
ViewportPaintable (Viewport<#document>) [0,0 800x600] | ||
PaintableWithLines (BlockContainer<HTML>) [0,0 800x58.9375] | ||
PaintableWithLines (BlockContainer<BODY>) [8,8 784x42.9375] | ||
PaintableWithLines (BlockContainer<BUTTON>.btn.fixed-width) [8,8 200x21.46875] | ||
PaintableWithLines (BlockContainer(anonymous)) [13,10 190x17.46875] | ||
PaintableWithLines (BlockContainer(anonymous)) [13,10 190x17.46875] | ||
TextPaintable (TextNode<#text>) | ||
PaintableWithLines (BlockContainer<BUTTON>.btn) [8,29.46875 334.671875x21.46875] | ||
PaintableWithLines (BlockContainer(anonymous)) [13,31.46875 324.671875x17.46875] | ||
PaintableWithLines (BlockContainer(anonymous)) [13,31.46875 324.671875x17.46875] | ||
TextPaintable (TextNode<#text>) |
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,9 @@ | ||
<!DOCTYPE html><style> | ||
.btn { | ||
display: block; | ||
} | ||
|
||
.fixed-width { | ||
width: 200px; | ||
} | ||
</style><button class="btn fixed-width">200px width</button><button class="btn">auto width should behave as fit-content</button> |
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
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
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