mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-11 01:22:43 +02:00
The previous implementation checked text-overflow and overflow-x on the text node's direct parent during inline item iteration. Since these are non-inherited properties, ellipsis only worked for text directly inside the block container, not when wrapped in inline elements like <span> or <a>. Move ellipsis truncation to a post-processing step after line boxes are constructed, checking the containing block instead.
22 lines
500 B
HTML
22 lines
500 B
HTML
<!doctype html>
|
|
<style>
|
|
@font-face {
|
|
font-family: "Lato";
|
|
src: url("../../Assets/Lato-Bold.ttf");
|
|
}
|
|
div {
|
|
font: 16px/1 Lato;
|
|
overflow: hidden;
|
|
white-space: nowrap;
|
|
width: 75px;
|
|
}
|
|
</style>
|
|
<div>This text gets clipped</div>
|
|
<div>This text…</div>
|
|
<div style="width: 0px">Invisible</div>
|
|
<div style="width: 5px">a</div>
|
|
<div>This text…</div>
|
|
<div><a href="#">This text…</a></div>
|
|
<div><b>Bold</b> the…</div>
|
|
<div><span style="float: left">F</span>Text af…</div>
|