blob: 388a12b294bd8d3bcb953313d3e9642e7f0807b0 [file] [log] [blame]
<!doctype html>
<meta charset="utf-8">
<title>parsing relative url tests</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-cssstylevalue-parse">
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../resources/testhelper.js"></script>
<body>
<script>
'use strict';
const gTestUrl = '../resources/1x1-green.png';
async_test(t => {
const result = CSSStyleValue.parse('background-image', 'url('+gTestUrl+')');
let image = loadImageResource(t, result);
image.addEventListener('load', t.step_func_done(() => {
assert_equals(result.state, 'loaded');
assert_equals(result.intrinsicWidth, 1);
assert_equals(result.intrinsicHeight, 1);
assert_equals(result.intrinsicRatio, 1);
assert_equals(result.url, gTestUrl);
}));
}, 'Loading a CSSURLImageValue which parsed using CSSStyleValue.parse from a URL sets its state to loaded');
</script>