-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[line-clamp] Add test for -webkit-line-clamp as a block-in-inline
This also fixes a bug in the existing `webkit-line-clamp-047` test. Bug: 40336192 Change-Id: I1b0d665bccfc8d79e52091b3155e9795db0c2240 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5850277 Reviewed-by: Ian Kilpatrick <[email protected]> Commit-Queue: Andreu Botella <[email protected]> Cr-Commit-Position: refs/heads/main@{#1353690}
- Loading branch information
1 parent
1fe7db9
commit dbca9cf
Showing
4 changed files
with
53 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
css/css-overflow/line-clamp/reference/webkit-line-clamp-049-ref.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!doctype html> | ||
<meta charset="utf-8"> | ||
<title>CSS Test Reference</title> | ||
<style> | ||
.no-bottom-margin { | ||
margin-bottom: 0; | ||
} | ||
.clamp { | ||
display: flow-root; | ||
font: 16px / 32px serif; | ||
white-space: pre; | ||
background-color: yellow; | ||
} | ||
</style> | ||
|
||
<p class="no-bottom-margin"><span>The following yellow box should clamp after 4 lines.</span></p> | ||
|
||
<div class="clamp">Line 1 | ||
Line 2 | ||
Line 3 | ||
Line 4…</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>CSS Overflow: -webkit-line-clamp block in inline</title> | ||
<link rel="author" title="Andreu Botella" href="mailto:[email protected]"> | ||
<link rel="help" href="https://drafts.csswg.org/css-overflow-4/#line-clamp"> | ||
<link rel="match" href="reference/webkit-line-clamp-049-ref.html"> | ||
<meta name="assert" content="If -webkit-line-clamp is a block inside an inline, it works correctly."> | ||
|
||
<style> | ||
p span clamp { | ||
display: -webkit-box; | ||
-webkit-box-orient: vertical; | ||
-webkit-line-clamp: 4; | ||
overflow: hidden; /* can be removed once implementations update their old -webkit-line-clamp implementations */ | ||
font: 16px / 32px serif; | ||
white-space: pre; | ||
background-color: yellow; | ||
} | ||
</style> | ||
|
||
<p><span>The following yellow box should clamp after 4 lines. | ||
|
||
<!-- Using a <clamp> element rather than e.g. <div class="clamp"> so the parser doesn't close the <p>.--> | ||
<clamp>Line 1 | ||
Line 2 | ||
Line 3 | ||
Line 4 | ||
Line 5</clamp> | ||
|
||
</span></p> |