blob: c32f12a5bcfae0f37f23afe39ca5d903d369b832 [file] [log] [blame]
<!DOCTYPE html>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<div id="testImage4"></div>
<script>
var supportedCSSProperties = [
"background-image",
"border-image-source",
"list-style-image",
"content",
"shape-outside"
];
function base64Url() {
return "data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA=";
}
function assertLoadedDotImageValue(
image, expectedUrl, expectedWidth, expectedHeight, expectedRatio) {
assert_equals(image.constructor.name, CSSURLImageValue.name);
assert_equals(image.url, expectedUrl);
assert_equals(image.state, "loaded");
assert_equals(image.intrinsicWidth, expectedWidth);
assert_equals(image.intrinsicHeight, expectedHeight);
assert_equals(image.intrinsicRatio, expectedRatio);
}
for (let property of supportedCSSProperties) {
test(function() {
testImage4.style[property] = 'url(' + base64Url() + ')';
assertLoadedDotImageValue(
testImage4.computedStyleMap().get(property),
base64Url(),
1,
1,
1);
assertLoadedDotImageValue(
testImage4.attributeStyleMap.get(property),
base64Url(),
1,
1,
1);
}, "Getting CSSURLImageValue from StyleMap for " + property);
}
</script>