Skip to content

Commit

Permalink
Handle cloned background images correctly.
Browse files Browse the repository at this point in the history
The start offset into the background image will be the same at every
fragment if box-decoration-break is 'clone'.

Bug: 40415661
Change-Id: I1619d4727e2f24d9b9d0cb6a5c1d13209834f40a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5799867
Reviewed-by: Ian Kilpatrick <[email protected]>
Reviewed-by: Xianzhu Wang <[email protected]>
Commit-Queue: Morten Stenshorne <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1344260}
  • Loading branch information
mstensho authored and chromium-wpt-export-bot committed Aug 20, 2024
1 parent fd29023 commit d1f80f3
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 0 deletions.
8 changes: 8 additions & 0 deletions css/css-break/background-image-004.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mailto:[email protected]">
<link rel="help" href="https://www.w3.org/TR/css-break-3/#break-decoration">
<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div style="columns:2; width:100px; gap:0; column-fill:auto; height:100px; background:red;">
<div style="box-decoration-break:clone; height:120px; padding:10px; border:10px solid green; background:linear-gradient(green 80px, red 80px);"></div>
</div>
10 changes: 10 additions & 0 deletions css/css-break/background-image-005.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mailto:[email protected]">
<link rel="help" href="https://www.w3.org/TR/css-break-3/#break-decoration">
<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div style="columns:4; width:100px; gap:0; column-fill:auto; height:100px; background:red;">
<div style="height:50px; background:green;"></div>
<div style="box-decoration-break:clone; height:140px; border:10px solid green; padding:10px 0; background:linear-gradient(green 80px, red 60px);"></div>
<div style="height:50px; background:green;"></div>
</div>
12 changes: 12 additions & 0 deletions css/css-break/background-image-006.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mailto:[email protected]">
<link rel="help" href="https://www.w3.org/TR/css-break-3/#break-decoration">
<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div style="columns:4; width:100px; gap:0; column-fill:auto; height:100px; background:red;">
<div style="height:50px; background:green;"></div>
<div style="display:table; box-decoration-break:clone; border:10px solid green; background:linear-gradient(green 80px, red 140px);">
<div style="width:5px; height:220px;"></div>
</div>
<div style="height:50px; background:green;"></div>
</div>
17 changes: 17 additions & 0 deletions css/css-break/background-image-007-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mailto:[email protected]">
<style>
.cat {
background: url(../support/cat.png) no-repeat;
background-size: 100px 100px;
width: 150px;
height: 100px;
}
</style>
<p>There should be four cats below.</p>
<div style="display:flex; width:600px;">
<div class="cat"></div>
<div class="cat"></div>
<div class="cat"></div>
<div class="cat"></div>
</div>
8 changes: 8 additions & 0 deletions css/css-break/background-image-007.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mailto:[email protected]">
<link rel="help" href="https://www.w3.org/TR/css-break-3/#break-decoration">
<link rel="match" href="background-image-007-ref.html">
<p>There should be four cats below.</p>
<div style="columns:4; width:600px; gap:0; column-fill:auto; height:150px;">
<div style="box-decoration-break:clone; height:600px; background:url(../support/cat.png) no-repeat; background-size:100px 100px;"></div>
</div>

0 comments on commit d1f80f3

Please sign in to comment.