Skip to content

Commit 8d5782b

Browse files
ewilligersjgraham
authored andcommitted
Bug 1564660 [wpt PR 17442] - [css-images] Radii are clamped non-negative, a=testonly
Automatic update from web-platform-tests [css-images] Radii are clamped non-negative (#17442) Compute colors and lengths in background-image getComputedStyle w3c/csswg-drafts#4042 Test that radii like calc(-0.5em + 10px) are clamped to be non-negative. https://drafts.csswg.org/css-images/#radial-gradients -- wpt-commits: b93cbfae1eb9e2a1248fb2d835ac7a7b1dc649cd wpt-pr: 17442
1 parent 28a2045 commit 8d5782b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

testing/web-platform/tests/css/css-backgrounds/parsing/background-image-computed.sub.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,31 @@
55
<title>CSS Backgrounds and Borders: getComputedValue().backgroundImagetitle>
66
<link rel="help" href="https://drafts.csswg.org/css-backgrounds/#background-image">
77
<meta name="assert" content="background-image computed value is as specified.">
8+
<meta name="assert" content="Colors and lengths are computed, with radii clamped.">
89
<script src="/resources/testharness.js">script>
910
<script src="/resources/testharnessreport.js">script>
1011
<script src="/css/support/computed-testcommon.js">script>
12+
<style>
13+
#target {
14+
font-size: 40px;
15+
}
16+
style>
1117
head>
1218
<body>
19+
1320
<div id="target">div>
1421
<script>
1522
test_computed_value("background-image", "none");
1623

1724
test_computed_value("background-image", 'url("http://{{host}}/")');
1825
test_computed_value("background-image", 'none, url("http://{{host}}/")');
26+
27+
test_computed_value('background-image', 'linear-gradient(to left bottom, red, blue)', 'linear-gradient(to left bottom, rgb(255, 0, 0), rgb(0, 0, 255))');
28+
29+
test_computed_value('background-image', 'radial-gradient(10px at 20px 30px, rgb(255, 0, 0), rgb(0, 0, 255))');
30+
test_computed_value('background-image', 'radial-gradient(circle calc(-0.5em + 10px) at calc(-1em + 10px) calc(-2em + 10px), red, blue)', 'radial-gradient(0px at -30px -70px, rgb(255, 0, 0), rgb(0, 0, 255))');
31+
test_computed_value('background-image', 'radial-gradient(ellipse calc(-0.5em + 10px) calc(0.5em + 10px) at 20px 30px, red, blue)', 'radial-gradient(0px 30px at 20px 30px, rgb(255, 0, 0), rgb(0, 0, 255))');
32+
test_computed_value('background-image', 'radial-gradient(ellipse calc(0.5em + 10px) calc(-0.5em + 10px) at 20px 30px, red, blue)', 'radial-gradient(30px 0px at 20px 30px, rgb(255, 0, 0), rgb(0, 0, 255))');
1933
script>
2034
body>
2135
html>

0 commit comments

Comments
 (0)