blob: 3d125240f625cfd1a59f39270a35ac838bc5dd18 [file] [log] [blame]
<!doctype html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<style>
#noSpecifiedHotspot {
cursor: url('file:///test.ico'), auto;
}
#specifiedHotspot {
cursor: url('file:///test.ico') 10 20, auto;
}
#intOverflowHotspot {
cursor: url('file:///test.ico') 3000000000 3000000000, auto;
}
</style>
<div id="noSpecifiedHotspot"></div>
<div id="specifiedHotspot"></div>
<div id="intOverflowHotspot"></div>
<script>
test(function(){
assert_equals(getComputedStyle(noSpecifiedHotspot).cursor, 'url("file:///test.ico"), auto');
}, "Cursor computed style does not includes the hotspot if it's not specified");
test(function(){
assert_equals(getComputedStyle(specifiedHotspot).cursor, 'url("file:///test.ico") 10 20, auto');
}, "Cursor computed style includes the hotspot if it's specified");
test(function(){
let computedStyle = getComputedStyle(intOverflowHotspot).cursor;
let x = parseInt(computedStyle.split(' ')[1]);
let y = parseInt(computedStyle.split(' ')[2]);
assert_equals(x, 2147483647);
assert_equals(y, 2147483647);
}, 'Hotspot coordinates clamp instead of overflowing');
</script>