Skip to content

Commit 46e74bc

Browse files
lilleschromium-wpt-export-bot
authored andcommitted
Use ConsumeNumber instead of ConsumeNumberRaw for cursor hotspot
Also add tests for simplified calc() hotspots. Bug: 406935603, 405311304 Change-Id: I9dbeb55593d7ee6e55701ecae9856d606c3b7b13 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6407516 Reviewed-by: Daniil Sakhapov <[email protected]> Commit-Queue: Rune Lillesveen <[email protected]> Cr-Commit-Position: refs/heads/main@{#1439378}
1 parent 1a1ac85 commit 46e74bc

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

css/css-ui/cursor-calc-hotspot.html

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,38 @@
66
<style>
77
#t1 {
88
font-size: 20px;
9-
cursor: url(cur.ico) calc(7 * sign(1em - 18px)) 0, auto;
9+
cursor: url(data:image/x-icon,) calc(7 * sign(1em - 18px)) 0, auto;
1010
}
1111
#t2 {
12-
cursor: url(cur.ico) calc(4 * sibling-index()) 0, auto;
12+
cursor: url(data:image/x-icon,) calc(4 * sibling-index()) 0, auto;
13+
}
14+
#t3 {
15+
cursor: url(data:image/x-icon,) calc(9) 0, auto;
16+
}
17+
#t4 {
18+
cursor: url(data:image/x-icon,) calc(10 * sign(2px)) 0, auto;
1319
}
1420
</style>
1521
<div>
1622
<div id="t1"></div>
1723
<div id="t2"></div>
24+
<div id="t3"></div>
25+
<div id="t4"></div>
1826
</div>
1927
<script>
2028
test(() => {
21-
assert_equals(getComputedStyle(t1).cursor, "url(cur.ico) 7 0, auto");
29+
assert_equals(getComputedStyle(t1).cursor, 'url("data:image/x-icon,") 7 0, auto');
2230
}, "cursor hotspot with sign() depending on font relative units");
2331

2432
test(() => {
25-
assert_equals(getComputedStyle(t2).cursor, "url(cur.ico) 8 0, auto");
33+
assert_equals(getComputedStyle(t2).cursor, 'url("data:image/x-icon,") 8 0, auto');
2634
}, "cursor hotspot depending on sibling-index()");
35+
36+
test(() => {
37+
assert_equals(getComputedStyle(t3).cursor, 'url("data:image/x-icon,") 9 0, auto');
38+
}, "cursor hotspot depending on simplified numeric calc()");
39+
40+
test(() => {
41+
assert_equals(getComputedStyle(t4).cursor, 'url("data:image/x-icon,") 10 0, auto');
42+
}, "cursor hotspot depending on simplified numeric calc() with sign()");
2743
</script>

0 commit comments

Comments
 (0)