mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-04 08:36:12 +00:00
LibWeb: Add missing flex-start and flex-end in to_alignment [GFC]
Fixes crashing on https://tweakers.net/
This commit is contained in:
parent
912511a152
commit
11e10d0532
Notes:
github-actions[bot]
2024-10-18 16:12:41 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 11e10d0532
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1858
Reviewed-by: https://github.com/gmta ✅
3 changed files with 104 additions and 0 deletions
74
Tests/LibWeb/Layout/expected/justify-content-flex-start.txt
Normal file
74
Tests/LibWeb/Layout/expected/justify-content-flex-start.txt
Normal file
|
@ -0,0 +1,74 @@
|
||||||
|
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
|
||||||
|
BlockContainer <html> at (0,0) content-size 800x216 [BFC] children: not-inline
|
||||||
|
BlockContainer <body> at (8,8) content-size 784x200 children: not-inline
|
||||||
|
Box <div.grid-container> at (8,8) content-size 784x200 [GFC] children: not-inline
|
||||||
|
BlockContainer <(anonymous)> (not painted) [BFC] children: inline
|
||||||
|
TextNode <#text>
|
||||||
|
Box <div.grid-item> at (8,8) content-size 100x100 flex-container(row) [FFC] children: not-inline
|
||||||
|
BlockContainer <(anonymous)> at (54.828125,49.5) content-size 6.34375x17 flex-item [BFC] children: inline
|
||||||
|
frag 0 from TextNode start: 0, length: 1, rect: [54.828125,49.5 6.34375x17] baseline: 13.296875
|
||||||
|
"1"
|
||||||
|
TextNode <#text>
|
||||||
|
BlockContainer <(anonymous)> (not painted) [BFC] children: inline
|
||||||
|
TextNode <#text>
|
||||||
|
Box <div.grid-item> at (108,8) content-size 100x100 flex-container(row) [FFC] children: not-inline
|
||||||
|
BlockContainer <(anonymous)> at (153.59375,49.5) content-size 8.8125x17 flex-item [BFC] children: inline
|
||||||
|
frag 0 from TextNode start: 0, length: 1, rect: [153.59375,49.5 8.8125x17] baseline: 13.296875
|
||||||
|
"2"
|
||||||
|
TextNode <#text>
|
||||||
|
BlockContainer <(anonymous)> (not painted) [BFC] children: inline
|
||||||
|
TextNode <#text>
|
||||||
|
Box <div.grid-item> at (208,8) content-size 100x100 flex-container(row) [FFC] children: not-inline
|
||||||
|
BlockContainer <(anonymous)> at (253.453125,49.5) content-size 9.09375x17 flex-item [BFC] children: inline
|
||||||
|
frag 0 from TextNode start: 0, length: 1, rect: [253.453125,49.5 9.09375x17] baseline: 13.296875
|
||||||
|
"3"
|
||||||
|
TextNode <#text>
|
||||||
|
BlockContainer <(anonymous)> (not painted) [BFC] children: inline
|
||||||
|
TextNode <#text>
|
||||||
|
Box <div.grid-item> at (8,108) content-size 100x100 flex-container(row) [FFC] children: not-inline
|
||||||
|
BlockContainer <(anonymous)> at (54.125,149.5) content-size 7.75x17 flex-item [BFC] children: inline
|
||||||
|
frag 0 from TextNode start: 0, length: 1, rect: [54.125,149.5 7.75x17] baseline: 13.296875
|
||||||
|
"4"
|
||||||
|
TextNode <#text>
|
||||||
|
BlockContainer <(anonymous)> (not painted) [BFC] children: inline
|
||||||
|
TextNode <#text>
|
||||||
|
Box <div.grid-item> at (108,108) content-size 100x100 flex-container(row) [FFC] children: not-inline
|
||||||
|
BlockContainer <(anonymous)> at (153.765625,149.5) content-size 8.453125x17 flex-item [BFC] children: inline
|
||||||
|
frag 0 from TextNode start: 0, length: 1, rect: [153.765625,149.5 8.453125x17] baseline: 13.296875
|
||||||
|
"5"
|
||||||
|
TextNode <#text>
|
||||||
|
BlockContainer <(anonymous)> (not painted) [BFC] children: inline
|
||||||
|
TextNode <#text>
|
||||||
|
Box <div.grid-item> at (208,108) content-size 100x100 flex-container(row) [FFC] children: not-inline
|
||||||
|
BlockContainer <(anonymous)> at (253.625,149.5) content-size 8.734375x17 flex-item [BFC] children: inline
|
||||||
|
frag 0 from TextNode start: 0, length: 1, rect: [253.625,149.5 8.734375x17] baseline: 13.296875
|
||||||
|
"6"
|
||||||
|
TextNode <#text>
|
||||||
|
BlockContainer <(anonymous)> (not painted) [BFC] children: inline
|
||||||
|
TextNode <#text>
|
||||||
|
BlockContainer <(anonymous)> at (8,208) content-size 784x0 children: inline
|
||||||
|
TextNode <#text>
|
||||||
|
|
||||||
|
ViewportPaintable (Viewport<#document>) [0,0 800x600]
|
||||||
|
PaintableWithLines (BlockContainer<HTML>) [0,0 800x216]
|
||||||
|
PaintableWithLines (BlockContainer<BODY>) [8,8 784x200]
|
||||||
|
PaintableBox (Box<DIV>.grid-container) [8,8 784x200]
|
||||||
|
PaintableBox (Box<DIV>.grid-item) [8,8 100x100]
|
||||||
|
PaintableWithLines (BlockContainer(anonymous)) [54.828125,49.5 6.34375x17]
|
||||||
|
TextPaintable (TextNode<#text>)
|
||||||
|
PaintableBox (Box<DIV>.grid-item) [108,8 100x100]
|
||||||
|
PaintableWithLines (BlockContainer(anonymous)) [153.59375,49.5 8.8125x17]
|
||||||
|
TextPaintable (TextNode<#text>)
|
||||||
|
PaintableBox (Box<DIV>.grid-item) [208,8 100x100]
|
||||||
|
PaintableWithLines (BlockContainer(anonymous)) [253.453125,49.5 9.09375x17]
|
||||||
|
TextPaintable (TextNode<#text>)
|
||||||
|
PaintableBox (Box<DIV>.grid-item) [8,108 100x100]
|
||||||
|
PaintableWithLines (BlockContainer(anonymous)) [54.125,149.5 7.75x17]
|
||||||
|
TextPaintable (TextNode<#text>)
|
||||||
|
PaintableBox (Box<DIV>.grid-item) [108,108 100x100]
|
||||||
|
PaintableWithLines (BlockContainer(anonymous)) [153.765625,149.5 8.453125x17]
|
||||||
|
TextPaintable (TextNode<#text>)
|
||||||
|
PaintableBox (Box<DIV>.grid-item) [208,108 100x100]
|
||||||
|
PaintableWithLines (BlockContainer(anonymous)) [253.625,149.5 8.734375x17]
|
||||||
|
TextPaintable (TextNode<#text>)
|
||||||
|
PaintableWithLines (BlockContainer(anonymous)) [8,208 784x0]
|
28
Tests/LibWeb/Layout/input/justify-content-flex-start.html
Normal file
28
Tests/LibWeb/Layout/input/justify-content-flex-start.html
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<style>
|
||||||
|
.grid-container {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(3, 100px);
|
||||||
|
grid-template-rows: repeat(2, 100px);
|
||||||
|
justify-content: flex-start;
|
||||||
|
background-color: lightgray;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid-item {
|
||||||
|
background-color: steelblue;
|
||||||
|
color: white;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
height: 100px;
|
||||||
|
width: 100px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div class="grid-container">
|
||||||
|
<div class="grid-item">1</div>
|
||||||
|
<div class="grid-item">2</div>
|
||||||
|
<div class="grid-item">3</div>
|
||||||
|
<div class="grid-item">4</div>
|
||||||
|
<div class="grid-item">5</div>
|
||||||
|
<div class="grid-item">6</div>
|
||||||
|
</div>
|
|
@ -19,8 +19,10 @@ static Alignment to_alignment(CSS::JustifyContent value)
|
||||||
return Alignment::Start;
|
return Alignment::Start;
|
||||||
case CSS::JustifyContent::Right:
|
case CSS::JustifyContent::Right:
|
||||||
return Alignment::End;
|
return Alignment::End;
|
||||||
|
case CSS::JustifyContent::FlexStart:
|
||||||
case CSS::JustifyContent::Start:
|
case CSS::JustifyContent::Start:
|
||||||
return Alignment::Start;
|
return Alignment::Start;
|
||||||
|
case CSS::JustifyContent::FlexEnd:
|
||||||
case CSS::JustifyContent::End:
|
case CSS::JustifyContent::End:
|
||||||
return Alignment::End;
|
return Alignment::End;
|
||||||
case CSS::JustifyContent::Center:
|
case CSS::JustifyContent::Center:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue