Interact with the originating document for stylesheet loads, rather than the element's current document.

This commit is contained in:
Josh Matthews 2016-12-22 16:38:55 -05:00
parent 1e927ca88b
commit 318a047ee5
6 changed files with 56 additions and 3 deletions

View file

@ -6474,6 +6474,18 @@
"url": "/_mozilla/mozilla/sslfail.html"
}
],
"mozilla/stylesheet-adopt-panic.html": [
{
"path": "mozilla/stylesheet-adopt-panic.html",
"references": [
[
"/_mozilla/mozilla/stylesheet-adopt-panic-ref.html",
"=="
]
],
"url": "/_mozilla/mozilla/stylesheet-adopt-panic.html"
}
],
"mozilla/svg/svg.html": [
{
"path": "mozilla/svg/svg.html",
@ -21756,6 +21768,18 @@
"url": "/_mozilla/mozilla/sslfail.html"
}
],
"mozilla/stylesheet-adopt-panic.html": [
{
"path": "mozilla/stylesheet-adopt-panic.html",
"references": [
[
"/_mozilla/mozilla/stylesheet-adopt-panic-ref.html",
"=="
]
],
"url": "/_mozilla/mozilla/stylesheet-adopt-panic.html"
}
],
"mozilla/svg/svg.html": [
{
"path": "mozilla/svg/svg.html",

View file

@ -0,0 +1,3 @@
body {
background-color: green;
}

View file

@ -0,0 +1,2 @@
<!doctype html>
<title>Blank document</title>

View file

@ -0,0 +1,8 @@
<!doctype html>
<meta charset="utf-8">
<iframe src="blank.html"></iframe>
<style>
body {
background-color: green;
}
</style>

View file

@ -0,0 +1,13 @@
<!doctype html>
<meta charset="utf-8">
<title>Verify that adopting a stylesheet with an import applies its styles and doesn't panic</title>
<link rel="match" href="stylesheet-adopt-panic-ref.html">
<iframe src="blank.html" onload="foo()"></iframe>
<script>
function foo() {
var i = document.querySelector('iframe');
i.contentDocument.documentElement.innerHTML = "<style>@import 'adopt-panic.css';</style>";
var e = i.contentDocument.querySelector('style');
document.body.appendChild(e);
}
</script>