Bug 1551065 - Properly discard empty lines for -webkit-line-clamp. r=heycam

That being said, this code is clearly not getting hit, are we 100% sure that
this is interoperable with what WebKit / Blink do?

Differential Revision: https://phabricator.services.mozilla.com/D30830

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Emilio Cobos Álvarez 2019-05-13 09:14:33 +00:00
parent 3dc303757f
commit b4d01303d5
2 changed files with 20 additions and 0 deletions

View File

@ -1676,6 +1676,7 @@ static nsLineBox* FindLineClampTarget(nsBlockFrame*& aFrame,
// Don't count a line that only has collapsible white space (as might exist
// after calling e.g. getBoxQuads).
if (line->IsEmpty()) {
iter.Next();
continue;
}

View File

@ -0,0 +1,19 @@
<!doctype html>
<meta charset="utf-8">
<title>CSS Overflow: -webkit-line-clamp with an empty line</title>
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
<link rel="help" href="https://drafts.csswg.org/css-overflow-3/#webkit-line-clamp">
<link rel="match" href="about:blank">
<style>
.clamp {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
font: 16px / 32px serif;
white-space: pre;
background-color: yellow;
padding: 0 4px;
overflow: hidden; /* can be removed once implementations update their old -webkit-line-clamp implementations */
}
</style>
<div class="clamp"><div><span></span></div></div>