Files
firefox/testing/web-platform/tests/css/css-values/inline-cache-base-uri.html
Emilio Cobos Álvarez f96a8e0cdd Bug 1978217 - Add a test for relative URIs inside cacheable inline stylesheets. r=firefox-style-system-reviewers,layout-reviewers,dshin
This tests both @import and regular declarations. Without this fix, the test
page renders blue, rather than a blue background with a purple square inside
and a smaller lime square inside.

Differential Revision: https://phabricator.services.mozilla.com/D258293
2025-07-23 01:35:31 +00:00

29 lines
1.3 KiB
HTML

<!doctype html>
<meta charset="utf-8">
<title>Test that base URIs are correct in presence of the same inline stylesheet</title>
<link rel="author" href="mailto:[email protected]" title="Emilio Cobos Álvarez">
<link rel="author" href="https://mozilla.org" title="Mozilla">
<link rel="help" href="https://drafts.csswg.org/css-values-4/#relative-urls">
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1978217">
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1978555">
<link rel="match" href="inline-cache-base-uri-ref.html">
<!-- NOTE(emilio): inline-cache-base-uri.css is invalid from here -->
<style>@import "inline-cache-base-uri.css";</style>
<style>
:root {
background-image: url("../../images/blue.png");
background-color: purple;
}
</style>
<script>
// This script ensures that @import above has fully loaded
</script>
<style>@import "inline-cache-base-uri.css";</style>
<script>
// Same, but this should make extra sure that we cache the @import before we start the frame load.
document.documentElement.getBoundingClientRect();
</script>
<iframe style="width: 100px; height: 100px; border: 0;" src="inline-cache-base-uri/inner.html"></iframe>
<!-- This div makes sure that the inner inline-cache-base-uri.css is not loaded in this page (otherwise the test would fail) -->
<div></div>