ladybird/Tests/LibWeb/Layout/input/position-empty-pseudo-elements.html
Karol Kosek 142d498f14 LibWeb: Include anonymous boxes with no lines into computing BFC height
Pseudo-elements like ::before and ::after were discarded when their
content property was an empty string (ignoring whitespace), because they
are anonymous containers with no lines.

Our previous way around it was to add an empty line box (see b062a0fb7c)
however it didn't actually work for cases described in the previous
commit.

This makes avatars and cover arts square on last.fm and "fixes" the test
css-pseudo-element-should-not-be-affected-by-presentational-hints.html.
Unfortunately, this also regresses on block-and-inline/clearfix.html,
but that hopefully will be handled in subsequent commit.
2023-08-02 17:35:54 +02:00

20 lines
377 B
HTML

<!doctype html><style>
div {
background: green;
display: block;
width: 50px;
margin: 25px;
}
div.empty_content::after {
content: "";
display: block;
padding-top: 100%;
}
div.content_with_space::after {
content: " ";
display: block;
padding-top: 100%;
}
</style><div class=empty_content></div><div class=content_with_space></div></div>