Skip to content

Commit cb1b816

Browse files
CGOfficialchromium-wpt-export-bot
authored andcommitted
Fix inf is wrongly clamped to 0
This CL changes clamping +inf/-inf to zero to use `gfx::ClampFloatGeometry` because +inf/-inf should never becomes to zero. Bug: 401393578,403071968 Change-Id: I2a9dd4474e6dc9158b254ac6e62780af89b439f0 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6401053 Reviewed-by: Fredrik Söderquist <[email protected]> Commit-Queue: Jason Leo <[email protected]> Auto-Submit: Jason Leo <[email protected]> Cr-Commit-Position: refs/heads/main@{#1439643}
1 parent 36944df commit cb1b816

File tree

4 files changed

+131
-0
lines changed

4 files changed

+131
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!DOCTYPE html>
2+
<link rel="author" title="CGQAQ" href="mailto:[email protected]">
3+
<link rel="author" title="一丝" href="mailto:[email protected]">
4+
<title>All the boxes below should have the lime background.</title>
5+
<style>
6+
.box {
7+
display: flex;
8+
flex-wrap: wrap;
9+
gap: 10px;
10+
}
11+
.box > div {
12+
width: 100px;
13+
height: 100px;
14+
border: solid 1px black;
15+
background-color: lime;
16+
}
17+
18+
</style>
19+
<div class="box">
20+
<div></div>
21+
<div></div>
22+
<div></div>
23+
<div></div>
24+
<div></div>
25+
</div>
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<!DOCTYPE html>
2+
<link rel="match" href="gradient-infinity-001-ref.html">
3+
<link rel="author" title="CGQAQ" href="mailto:[email protected]">
4+
<link rel="author" title="一丝" href="mailto:[email protected]">
5+
<link rel="help" href="https://www.w3.org/TR/css-color-4/#interpolation">
6+
<title>All the boxes below should have the lime background.</title>
7+
<style>
8+
.box {
9+
display: flex;
10+
flex-wrap: wrap;
11+
gap: 10px;
12+
}
13+
.box > div {
14+
width: 100px;
15+
height: 100px;
16+
border: solid 1px black;
17+
}
18+
.test1 {
19+
background: linear-gradient(to right in srgb, lime 100px, red calc(1px / 0));
20+
}
21+
.test2 {
22+
background: linear-gradient(to right in srgb, lime 100px, red calc(Infinity * 1px));
23+
}
24+
.test3 {
25+
background: linear-gradient(to left in srgb, lime 100px, red calc(Infinity * 1px));
26+
}
27+
.test4 {
28+
background: linear-gradient(to top in srgb, lime 100px, red calc(1px / 0));
29+
}
30+
.test5 {
31+
background: linear-gradient(to bottom in srgb, lime 100px, red calc(Infinity * 1px));
32+
}
33+
</style>
34+
<div class="box">
35+
<div class="test1"></div>
36+
<div class="test2"></div>
37+
<div class="test3"></div>
38+
<div class="test4"></div>
39+
<div class="test5"></div>
40+
</div>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!DOCTYPE html>
2+
<link rel="author" title="CGQAQ" href="mailto:[email protected]">
3+
<link rel="author" title="一丝" href="mailto:[email protected]">
4+
<title>All boxes should have a lime background.</title>
5+
<style>
6+
.box {
7+
display: flex;
8+
flex-wrap: wrap;
9+
gap: 10px;
10+
}
11+
.box > div {
12+
width: 100px;
13+
height: 100px;
14+
border: solid 1px black;
15+
padding: 1px;
16+
background-color: lime;
17+
}
18+
</style>
19+
<div class="box">
20+
<div></div>
21+
<div></div>
22+
<div></div>
23+
<div></div>
24+
<div></div>
25+
</div>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<!DOCTYPE html>
2+
<link rel="match" href="gradient-infinity-002-ref.html">
3+
<link rel="author" title="CGQAQ" href="mailto:[email protected]">
4+
<link rel="author" title="一丝" href="mailto:[email protected]">
5+
<link rel="help" href="https://www.w3.org/TR/css-color-4/#interpolation">
6+
<title>All boxes should have a lime background.</title>
7+
<style>
8+
.box {
9+
display: flex;
10+
flex-wrap: wrap;
11+
gap: 10px;
12+
}
13+
.box > div {
14+
width: 100px;
15+
height: 100px;
16+
border: solid 1px black;
17+
padding: 1px;
18+
}
19+
.test1 {
20+
background: linear-gradient(to right in srgb, lime 100px, red calc(1px / 0));
21+
}
22+
.test2 {
23+
background: linear-gradient(to right in srgb, lime 100px, red calc(Infinity * 1px));
24+
}
25+
.test3 {
26+
background: linear-gradient(to left in srgb, lime 100px, red calc(Infinity * 1px));
27+
}
28+
.test4 {
29+
background: linear-gradient(to top in srgb, lime 100px, red calc(1px / 0));
30+
}
31+
.test5 {
32+
background: linear-gradient(to bottom in srgb, lime 100px, red calc(Infinity * 1px));
33+
}
34+
</style>
35+
<div class="box">
36+
<div class="test1"></div>
37+
<div class="test2"></div>
38+
<div class="test3"></div>
39+
<div class="test4"></div>
40+
<div class="test5"></div>
41+
</div>

0 commit comments

Comments
 (0)