Skip to content

Commit

Permalink
[block-in-inline] Support line-clamping correctly.
Browse files Browse the repository at this point in the history
To do this we always set the correct "lines-util-clamp" on the layout
result, and just read that within the block-layout-algorithm.

For non block-in-inline layout there should be no behaviour change.

Bug: 716930
Change-Id: Ib8fc361f356943f385becd7503fa152d1f0f091d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3111327
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/main@{#914520}
  • Loading branch information
bfgeek authored and chromium-wpt-export-bot committed Aug 23, 2021
1 parent b5c4ae1 commit 78754a4
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 0 deletions.
16 changes: 16 additions & 0 deletions css/css-overflow/reference/webkit-line-clamp-038-ref.html
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<style>
.clamp {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
font: 16px / 32px serif;
background-color: yellow;
overflow: hidden;
}
</style>
<div class="clamp">
<div>
Line 1<br>Line 2<br>Line 3<br>Line 4<br>Line 5
</div>
</div>
16 changes: 16 additions & 0 deletions css/css-overflow/reference/webkit-line-clamp-039-ref.html
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<style>
.clamp {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 5;
font: 16px / 32px serif;
background-color: yellow;
overflow: hidden;
}
</style>
<div class="clamp">
<div>
Line 1<br>Line 2<br>Line 3<br>Line 4<br>Line 5<br>Line 6
</div>
</div>
21 changes: 21 additions & 0 deletions css/css-overflow/webkit-line-clamp-038.html
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<link rel="help" href="https://drafts.csswg.org/css-overflow-3/#webkit-line-clamp">
<link rel="match" href="reference/webkit-line-clamp-038-ref.html">
<meta name="assert" content="-webkit-line-clamp correctly clamps a block-in-inline.">
<style>
.clamp {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
font: 16px / 32px serif;
background-color: yellow;
overflow: hidden;
}
</style>
<div class="clamp">
<div>
Line 1
<span><div>Line 2<br>Line 3<br>Line 4</div></span>
Line 5
</div>
</div>
21 changes: 21 additions & 0 deletions css/css-overflow/webkit-line-clamp-039.html
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<link rel="help" href="https://drafts.csswg.org/css-overflow-3/#webkit-line-clamp">
<link rel="match" href="reference/webkit-line-clamp-039-ref.html">
<meta name="assert" content="-webkit-line-clamp correctly clamps a block-in-inline.">
<style>
.clamp {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 5;
font: 16px / 32px serif;
background-color: yellow;
overflow: hidden;
}
</style>
<div class="clamp">
<div>
Line 1
<span><div>Line 2<br>Line 3<br>Line 4</div></span>
Line 5<br>Line 6
</div>
</div>

0 comments on commit 78754a4

Please sign in to comment.