ladybird icon indicating copy to clipboard operation
ladybird copied to clipboard

`inline-block` element inside of `inline` element leads to wrong layout

Open simonkrauter opened this issue 1 year ago • 1 comments

Test page:

<!DOCTYPE html>
<html>
<head>
<style>
  * {
    border: 1px solid black;
  }
  .outer {
    background: red;
  }
  .inner {
    display: inline-block;
    background: lime;
    margin: 50px;
    padding: 10px;
  }
</style>
</head>
<body>
A
<span class="outer">
  <span class="inner">B</span>
</span>
C
</body>

Screenshot Ladybird:

Screenshot Firefox/Chrome:

simonkrauter avatar Jul 22 '24 22:07 simonkrauter

I found a layout order issue in the wild and simplified it to this repro, which might be the same root bug as yours

<style>
    .first {
        background-color: green;
    }

    .second {
        background-color: red;
        display: inline-block;
    }
</style>

<span>
    <div class="first">1</div>
    <div class="second">2</div>
</span>

Firefox image

Ladybird image

incognitojam avatar Sep 19 '24 20:09 incognitojam

Current state of master for the original repro:

Image

The other repro by @incognitojam seems to be fixed though:

Image

gmta avatar Aug 27 '25 21:08 gmta