LibWeb: Respect margin boxes when center-aligning flex items

This commit is contained in:
Lukas Scheller 2025-03-04 17:36:07 +01:00 committed by Andreas Kling
commit ce93088a81
Notes: github-actions[bot] 2025-03-05 17:08:08 +00:00
3 changed files with 31 additions and 1 deletions

View file

@ -0,0 +1,11 @@
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <html> at (0,0) content-size 800x216 [BFC] children: not-inline
Box <body> at (8,8) content-size 784x200 flex-container(row) [FFC] children: not-inline
BlockContainer <div> at (8,58) content-size 100x100 flex-item [BFC] children: not-inline
BlockContainer <span> at (108,108) content-size 100x100 flex-item [BFC] children: not-inline
ViewportPaintable (Viewport<#document>) [0,0 800x600]
PaintableWithLines (BlockContainer<HTML>) [0,0 800x216]
PaintableBox (Box<BODY>) [8,8 784x200]
PaintableWithLines (BlockContainer<DIV>) [8,58 100x100]
PaintableWithLines (BlockContainer<SPAN>) [108,108 100x100]

View file

@ -0,0 +1,17 @@
<!doctype html><style>
body {
display: flex;
align-items: center;
}
div {
width: 100px;
height: 100px;
background-color: red;
}
span {
margin-top: 100px;
width: 100px;
height: 100px;
background-color: blue;
}
</style><body><div></div><span></span>