mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-11 05:39:41 +02:00
Automatic update from web-platform-tests Fix gradient background sizing This is a hard-to-fix situation. We size generated background images according to the tile size, which is a snapped rectangle sized according to the destination values, in general. But then we compute a src rect for image drawing using the unsnapped values, because that is best for bitmap images where we want to pull out the most accurate src rect possible. However, that source rect ends up larger than the tile size due to rounding without the original offset in the layer (because now we are working in image space). The gradient painting code then sees that it has a src rect that is larger than the tile size and hence the gradient image size. The code thinks that we want to have some more pixels than the gradient provides, which is true in some cases, and scales things to get those extra pixels in the painted output. Hence empty pixels on the screen when we really want the gradient to be filling the dest rect. Changing the gradient painting code will break valid use cases. Changing the tile size breaks things in a different way and doesn't really fix the problem. So change the src rect computation to use snapped sizes for generated content in an attempt to get a src that matches the tile size. R=fmalita@chromium.org Bug: 898950 Change-Id: I100575ad4f4fa3004fbc232a72c90b0032ccef4e Reviewed-on: https://chromium-review.googlesource.com/c/1376814 Commit-Queue: Stephen Chenney <schenney@chromium.org> Reviewed-by: Florin Malita <fmalita@chromium.org> Cr-Commit-Position: refs/heads/master@{#616944} -- wpt-commits: fcb8094864e059a942cadbdb839794182b309dc8 wpt-pr: 14529
44 lines
1.1 KiB
HTML
44 lines
1.1 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en-GB" xml:lang="en-GB" xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<title>CSS Background Test: Gradient backgrounds should fill the positioning area</title>
|
|
<link rel="author" title="schenney" href="mailto:schenney@chromium.org">
|
|
<link rel="help" href="http://www.w3.org/TR/css3-background">
|
|
<link rel="match" href="reference/background-gradient-subpixel-fills-area-ref.html">
|
|
<style>
|
|
ul {
|
|
width: 396.875px;
|
|
overflow: auto;
|
|
padding: 0;
|
|
list-style: none;
|
|
background-color: red;
|
|
}
|
|
|
|
li {
|
|
float: left;
|
|
}
|
|
|
|
div {
|
|
display: block;
|
|
width: 19.6875px;
|
|
height: 17px;
|
|
padding: 20px 10px;
|
|
background: linear-gradient(to bottom, green 0%, darkgreen 100%) darkgreen;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<ul>
|
|
<li><div></div></li>
|
|
<li><div></div></li>
|
|
<li><div></div></li>
|
|
<li><div></div></li>
|
|
<li><div></div></li>
|
|
<li><div></div></li>
|
|
<li><div></div></li>
|
|
<li><div></div></li>
|
|
<li><div></div></li>
|
|
<li><div></div></li>
|
|
</ul>
|
|
</body>
|
|
</html>
|