Skip to content

Commit

Permalink
[text-box-trim] Add tests for atomic inlines
Browse files Browse the repository at this point in the history
This patch adds tests to ensure that the `text-box-trim`
property trims the line containing atomic inlines, but it
doesn't propagate into the atomic inline, and therefore the
lines inside of the atomic inline isn't trimmed.

This patch has no behavior changes.

Bug: 40254880
Change-Id: I7ffd34238a30f0178b4070dc23452e5e59c47fd4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5588337
Auto-Submit: Koji Ishii <[email protected]>
Reviewed-by: Kent Tamura <[email protected]>
Commit-Queue: Kent Tamura <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1309110}
  • Loading branch information
kojiishi authored and sadym-chromium committed Jun 3, 2024
1 parent f37a819 commit 46dc92e
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
<style>
.spacer {
background: lightgray;
block-size: 100px;
}
.target {
font-family: Ahem;
font-size: 100px;
line-height: 2;
position: relative;
top: -50px;
height: 100px;
}
.atomic {
display: inline-block;
background: lime;
}
</style>
<div class="spacer"></div>
<div class="target">
<span class="atomic">X</span>
</div>
<div class="spacer"></div>
28 changes: 28 additions & 0 deletions css/css-inline/text-box-trim/text-box-trim-atomic-inline-001.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!DOCTYPE html>
<title>Test the `text-box-trim` isn't propagated into atomic inlines</title>
<link rel="help" href="https://drafts.csswg.org/css-inline-3/#propdef-text-box-edge">
<link rel="help" href="https://drafts.csswg.org/css-inline-3/#propdef-text-box-trim">
<link rel="match" href="text-box-trim-atomic-inline-001-ref.html">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
<style>
.spacer {
background: lightgray;
block-size: 100px;
}
.target {
font-family: Ahem;
font-size: 100px;
line-height: 2;
text-box-trim: both;
text-box-edge: text;
}
.atomic {
display: inline-block;
background: lime;
}
</style>
<div class="spacer"></div>
<div class="target">
<span class="atomic">X</span>
</div>
<div class="spacer"></div>

0 comments on commit 46dc92e

Please sign in to comment.