Files
sousa-gecko/testing/web-platform/tests/css/css-ui/cursor-calc-hotspot.html
T
Rune Lillesveen 6e986d5f1a Bug 1957072 [wpt PR 51687] - Use ConsumeNumber instead of ConsumeNumberRaw for cursor hotspot, a=testonly
Automatic update from web-platform-tests
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 <sakhapov@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1439378}

--

wpt-commits: 46e74bcb694bd648987d1eb095a739d83f15fdcc
wpt-pr: 51687
2025-03-29 10:16:04 +00:00

44 lines
1.4 KiB
HTML

<!DOCTYPE html>
<title>CSS UI Test: Allow complex calc expressions in cursor hotspot</title>
<link rel="help" href="https://drafts.csswg.org/css-ui/#cursor">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
#t1 {
font-size: 20px;
cursor: url(data:image/x-icon,) calc(7 * sign(1em - 18px)) 0, auto;
}
#t2 {
cursor: url(data:image/x-icon,) calc(4 * sibling-index()) 0, auto;
}
#t3 {
cursor: url(data:image/x-icon,) calc(9) 0, auto;
}
#t4 {
cursor: url(data:image/x-icon,) calc(10 * sign(2px)) 0, auto;
}
</style>
<div>
<div id="t1"></div>
<div id="t2"></div>
<div id="t3"></div>
<div id="t4"></div>
</div>
<script>
test(() => {
assert_equals(getComputedStyle(t1).cursor, 'url("data:image/x-icon,") 7 0, auto');
}, "cursor hotspot with sign() depending on font relative units");
test(() => {
assert_equals(getComputedStyle(t2).cursor, 'url("data:image/x-icon,") 8 0, auto');
}, "cursor hotspot depending on sibling-index()");
test(() => {
assert_equals(getComputedStyle(t3).cursor, 'url("data:image/x-icon,") 9 0, auto');
}, "cursor hotspot depending on simplified numeric calc()");
test(() => {
assert_equals(getComputedStyle(t4).cursor, 'url("data:image/x-icon,") 10 0, auto');
}, "cursor hotspot depending on simplified numeric calc() with sign()");
</script>