gecko-dev/testing/web-platform/tests/css/css-pseudo/first-letter-background-image-dynamic.html
Emilio Cobos Álvarez 85e9363f96 Bug 1528451 - Move code that starts image loads to DidSetComputedStyle. r=heycam
This is more consistent with all the other image request code, and handles
pseudo-elements properly without having to add more out-of-band calls to
UpdateStyleOfOwnedChildFrame and such.

Differential Revision: https://phabricator.services.mozilla.com/D20107
2019-02-19 15:00:58 +01:00

24 lines
889 B
HTML

<!doctype html>
<title>CSS Test: ::first-letter correctly applies background-image dynamically</title>
<link rel="author" href="mailto:emilio@crisal.io" title="Emilio Cobos Álvarez">
<link rel="author" href="https://mozilla.org" title="Mozilla">
<link rel="help" href="https://drafts.csswg.org/css-pseudo-4/#first-letter-styling">
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1528451">
<link rel="match" href="first-letter-background-image-ref.html">
<style>
div::first-letter {
color: lime;
}
div.image::first-letter {
/* Lime background */
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M/wHwAEBgIApD5fRAAAAABJRU5ErkJggg==');
}
</style>
<div>
A letter
</div>
<script>
let div = document.querySelector("div");
getComputedStyle(div).color;
div.classList.add('image');
</script>