forked from chromium/chromium
-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Script: Implement the parser document check
The #prepare-a-script algorithm [1] includes a check asserting that a script element's parser document == its node document, for parser-inserted scripts. Spec discussion has been happening around this at [2], and WPTs have been added for this in [3] and [4] as part of an overall effort to test and better-specify the behavior of script elements that move between documents. Before this CL, Chromium had no concept of a parser document, and therefore would execute scripts that were moved to another document before ScriptLoader::PrepareScript was invoked. This CL introduces a |parser_document_| to ScriptLoader, which is populated from CreateElementFlags::ParserDocument(), similar to the |parser_inserted_| flag. [1]: https://html.spec.whatwg.org/C/#prepare-a-script [2]: whatwg/html#2137 [2]: web-platform-tests/wpt#19632 [3]: web-platform-tests/wpt#23162 Bug: 721914, 1086507 Change-Id: I7a0980afb47be93f8ed9948658b2cc8e4fa04669 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2214301 Commit-Queue: Dominic Farolino <[email protected]> Reviewed-by: Kouhei Ueno <[email protected]> Reviewed-by: Hiroshige Hayashizaki <[email protected]> Cr-Commit-Position: refs/heads/master@{#777203}
- Loading branch information
1 parent
3d8e49e
commit f104795
Showing
19 changed files
with
34 additions
and
153 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
8 changes: 0 additions & 8 deletions
8
.../moving-between-documents/before-prepare-iframe-fetch-error-external-classic-expected.txt
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
...t/moving-between-documents/before-prepare-iframe-fetch-error-external-module-expected.txt
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
.../moving-between-documents/before-prepare-iframe-parse-error-external-classic-expected.txt
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
...t/moving-between-documents/before-prepare-iframe-parse-error-external-module-expected.txt
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
...nt/moving-between-documents/before-prepare-iframe-parse-error-inline-classic-expected.txt
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
...ent/moving-between-documents/before-prepare-iframe-parse-error-inline-module-expected.txt
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
...ent/moving-between-documents/before-prepare-iframe-success-empty-src-classic-expected.txt
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
...ment/moving-between-documents/before-prepare-iframe-success-empty-src-module-expected.txt
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
...ment/moving-between-documents/before-prepare-iframe-success-external-classic-expected.txt
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
...ement/moving-between-documents/before-prepare-iframe-success-external-module-expected.txt
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
...lement/moving-between-documents/before-prepare-iframe-success-inline-classic-expected.txt
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
...element/moving-between-documents/before-prepare-iframe-success-inline-module-expected.txt
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
third_party/blink/web_tests/fast/parser/move-during-parsing-expected.txt
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
third_party/blink/web_tests/fast/parser/move-during-parsing.html
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
third_party/blink/web_tests/fast/parser/resources/move-during-parsing-iframe.html
This file was deleted.
Oops, something went wrong.
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
1 change: 0 additions & 1 deletion
1
third_party/blink/web_tests/fast/parser/script-modify-page-outer-expected.txt
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 |
---|---|---|
@@ -1,3 +1,2 @@ | ||
ALERT: should be outer: parser/script-modify-page-outer.html | ||
ALERT: should be inner: parser/resources/script-modify-page-inner.html | ||
DONE |