-
Notifications
You must be signed in to change notification settings - Fork 3
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 <dom@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#777203} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: f104795245d1a32fde965862578baeb6e75961be
- Loading branch information
1 parent
ca66a16
commit bdc15d6
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
blink/web_tests/fast/parser/move-during-parsing-expected.txt
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
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
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 |