-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #14841 - jdm:stylesheet_document, r=emilio
Track stylesheet load's document instead of using element's current document For cases where a stylesheet load finishes in a different document than it started, we need to be more careful about which document we report the completion to. In this case we actually have separate requests for each document involved, but they previously used the same element to determine which document to interact with. --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #14641 - [X] There are tests for these changes OR <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14841) <!-- Reviewable:end -->
- Loading branch information
Showing
6 changed files
with
56 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
body { | ||
background-color: green; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<!doctype html> | ||
<title>Blank document</title> |
8 changes: 8 additions & 0 deletions
8
tests/wpt/mozilla/tests/mozilla/stylesheet-adopt-panic-ref.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<!doctype html> | ||
<meta charset="utf-8"> | ||
<iframe src="blank.html"></iframe> | ||
<style> | ||
body { | ||
background-color: green; | ||
} | ||
</style> |
13 changes: 13 additions & 0 deletions
13
tests/wpt/mozilla/tests/mozilla/stylesheet-adopt-panic.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |