Skip to content

Commit

Permalink
Add print only background-image test
Browse files Browse the repository at this point in the history
Bug: 40262871
Change-Id: I620933aaf44e717e496c9c70642aa870cdadec3a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5556416
Reviewed-by: Morten Stenshorne <[email protected]>
Commit-Queue: Traian Captan <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1304658}
  • Loading branch information
tcaptan-cr authored and chromium-wpt-export-bot committed May 22, 2024
1 parent 1cf7038 commit bbc2389
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
5 changes: 5 additions & 0 deletions css/css-page/background-image-only-for-print-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!DOCTYPE html>
<p>
Should print a green rectangle but not display it on screen.
</p>
<img src="/images/green.png" alt="A green rectangle">
27 changes: 27 additions & 0 deletions css/css-page/background-image-only-for-print.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<title>Test print result of background-image not displayed on screen</title>

<link rel="help" href="https://drafts.csswg.org/css-backgrounds/#background-image">
<link rel="help" href="https://crbug.com/40262871">

<link rel="match" href="background-image-only-for-print-ref.html">

<style>
@media not print {
.print-only {
display: none;
}
}

#target {
background-image: url("/images/green.png");
height: 50px;
width: 100px;
}
</style>

<p>
Should print a green rectangle but not display it on screen.
</p>

<div id="target" class="print-only"></div>

0 comments on commit bbc2389

Please sign in to comment.