Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-lists/parsing/list-style-image-computed.sub.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Lists: getComputedStyle().listStyleImage</title>
<meta name="assert" content="list-style-image computed value is as specified.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/computed-testcommon.js"></script>
<style>
#target {
font-size: 40px;
}
</style>
</head>
<body>
<div id="target"></div>
<script>
test_computed_value('list-style-image', 'none');
test_computed_value('list-style-image', 'linear-gradient(to left bottom, red , blue )', 'linear-gradient(to left bottom, rgb(255, 0, 0), rgb(0, 0, 255))');
test_computed_value('list-style-image', 'linear-gradient(calc(90deg - 45deg), rgb(0, 128, 0), rgb(0, 0, 255)', 'linear-gradient(45deg, rgb(0, 128, 0), rgb(0, 0, 255))');
test_computed_value('list-style-image', 'radial-gradient(10px at 20px 30px, rgb(255, 0, 0), rgb(0, 0, 255))');
test_computed_value('list-style-image', 'radial-gradient(circle calc(-0.5em + 10px) at calc(-1em + 10px) calc(-2em + 10px), rgb(255, 0, 0), rgb(0, 0, 255))', 'radial-gradient(0px at -30px -70px, rgb(255, 0, 0), rgb(0, 0, 255))');
test_computed_value('list-style-image', 'radial-gradient(ellipse calc(-0.5em + 10px) calc(0.5em + 10px) at 20px 30px, rgb(255, 0, 0), rgb(0, 0, 255))', 'radial-gradient(0px 30px at 20px 30px, rgb(255, 0, 0), rgb(0, 0, 255))');
test_computed_value('list-style-image', 'radial-gradient(ellipse calc(0.5em + 10px) calc(-0.5em + 10px) at 20px 30px, rgb(255, 0, 0), rgb(0, 0, 255))', 'radial-gradient(30px 0px at 20px 30px, rgb(255, 0, 0), rgb(0, 0, 255))');
test_computed_value('list-style-image', 'radial-gradient(black 0% 0.5em, 25%, green 30% 60%, calc(100% * 3 / 4), white calc(100% - 20%) 100%', 'radial-gradient(rgb(0, 0, 0) 0%, rgb(0, 0, 0) 20px, 25%, rgb(0, 128, 0) 30%, rgb(0, 128, 0) 60%, 75%, rgb(255, 255, 255) 80%, rgb(255, 255, 255) 100%)');
test_computed_value('list-style-image', 'conic-gradient(gold calc(100% / 2), #f06 calc(360deg * 4 / 5))', 'conic-gradient(rgb(255, 215, 0) 50%, rgb(255, 0, 102) 288deg)');
test_computed_value('list-style-image', 'conic-gradient(black 1turn, white', 'conic-gradient(rgb(0, 0, 0) 360deg, rgb(255, 255, 255))');
</script>
</body>
</html>