|
[HTML Imports] Let script of imported document running.
This change allows <script> inside imported document running.
The implementation is based on a proposal at
https://www.w3.org/Bugs/Public/show_bug.cgi?id=22413.
This CL teaches ScriptLoader about HTML Imports so that it loads and
evaluates script if the document is an import.
For that purpose, now ScriptLoader distinguishes "executing document" which
is a master and "element" document which is an import, then executes scripts
on "executing" document.
Here are some remarks:
- This change doesn't make other resources, including stylesheets and images,
being loaded on imports. The spec doesn't mention about them.
- This change doesn't take care of execution order. It will be attacked in
following changes.
- Some of new CSP related tests capture some FAILures. This represents the
current limitation of Blink's CSP handling of HTML Import:
It cannot prohibit eval() in imports and just follows master's context.
This is because the imported scripts run on master's context and
there is no way to the source of the eval() calls.
BUG= 240592
TEST=csp-import-block-but-*.html, import-script-nosniff.html, import-script.html,
import-script-prototypes.html
R=dglazkov,abarth
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=155149
Total comments: 6
Total comments: 5
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+767 lines, -50 lines) |
Patch |
 |
M |
LayoutTests/fast/html/imports/import-master.html
|
View
|
1
2
3
|
1 chunk |
+15 lines, -4 lines |
0 comments
|
Download
|
 |
M |
LayoutTests/fast/html/imports/import-master-expected.txt
|
View
|
1
2
|
1 chunk |
+8 lines, -5 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/fast/html/imports/import-script.html
|
View
|
|
1 chunk |
+43 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/fast/html/imports/import-script-expected.txt
|
View
|
1
|
1 chunk |
+20 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/fast/html/imports/import-script-prototypes.html
|
View
|
1
2
3
|
1 chunk |
+12 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/fast/html/imports/import-script-prototypes-expected.txt
|
View
|
1
2
3
4
5
|
1 chunk |
+17 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/fast/html/imports/resources/script-leaf.html
|
View
|
|
1 chunk |
+10 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/fast/html/imports/resources/script-leaf-external.js
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/fast/html/imports/resources/script-leaf-external-async.js
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/fast/html/imports/resources/script-leaf-external-dynamic.js
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/fast/html/imports/resources/script-prototype-test.html
|
View
|
1
2
3
|
1 chunk |
+31 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/csp-import-block-but-domain.html
|
View
|
1
2
3
|
1 chunk |
+20 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/csp-import-block-but-domain-expected.txt
|
View
|
1
2
3
|
1 chunk |
+10 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/csp-import-block-but-domain-nested.html
|
View
|
1
2
3
|
1 chunk |
+21 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/csp-import-block-but-domain-nested-expected.txt
|
View
|
1
2
3
|
1 chunk |
+10 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/csp-import-block-but-nonce.html
|
View
|
1
2
3
|
1 chunk |
+22 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/csp-import-block-but-nonce-expected.txt
|
View
|
1
2
3
|
1 chunk |
+12 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/csp-import-block-but-nonce-nested.html
|
View
|
1
2
3
|
1 chunk |
+22 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/csp-import-block-but-nonce-nested-expected.txt
|
View
|
1
2
3
|
1 chunk |
+12 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/csp-import-block-but-self.html
|
View
|
1
2
3
|
1 chunk |
+20 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/csp-import-block-but-self-expected.txt
|
View
|
1
2
3
|
1 chunk |
+10 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/csp-import-block-but-self-nested.html
|
View
|
1
2
3
|
1 chunk |
+20 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/csp-import-block-but-self-nested-expected.txt
|
View
|
1
2
3
|
1 chunk |
+10 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/csp-import-block-but-unsafe-inline.html
|
View
|
1
2
3
|
1 chunk |
+20 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/csp-import-block-but-unsafe-inline-and-eval.html
|
View
|
1
2
3
|
1 chunk |
+20 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/csp-import-block-but-unsafe-inline-and-eval-expected.txt
|
View
|
1
2
3
|
1 chunk |
+10 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/csp-import-block-but-unsafe-inline-and-eval-nested.html
|
View
|
1
2
3
|
1 chunk |
+20 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/csp-import-block-but-unsafe-inline-and-eval-nested-expected.txt
|
View
|
1
2
3
|
1 chunk |
+10 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/csp-import-block-but-unsafe-inline-expected.txt
|
View
|
1
2
3
|
1 chunk |
+10 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/csp-import-block-but-unsafe-inline-nested.html
|
View
|
1
2
3
|
1 chunk |
+20 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/csp-import-block-but-unsafe-inline-nested-expected.txt
|
View
|
1
2
3
|
1 chunk |
+10 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/import-script-block-crossorigin-dynamic.html
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+41 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/import-script-block-crossorigin-dynamic-expected.txt
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+14 lines, -0 lines |
0 comments
|
Download
|
 |
A + |
LayoutTests/http/tests/htmlimports/import-script-nosniff.html
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+3 lines, -2 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/import-script-nosniff-expected.txt
|
View
|
1
2
3
|
1 chunk |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/resources/child-having-domain-policy.html
|
View
|
1
2
3
|
1 chunk |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/resources/child-having-nonce-policy.html
|
View
|
1
2
3
|
1 chunk |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/resources/child-having-self-policy.html
|
View
|
1
2
3
|
1 chunk |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/resources/child-having-unsafe-eval-policy.html
|
View
|
1
2
3
|
1 chunk |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/resources/child-having-unsafe-inline-policy.html
|
View
|
1
2
3
|
1 chunk |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/resources/cors-having-crossorigin-scripts.cgi
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+26 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/resources/cors-js.cgi
|
View
|
1
2
3
|
1 chunk |
+9 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/resources/cors-js-for-localhost.cgi
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+9 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/resources/external-script.js
|
View
|
1
2
3
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/resources/external-script-with-nonce.js
|
View
|
1
2
3
|
1 chunk |
+4 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/resources/having-domain-policy.html
|
View
|
1
2
3
|
1 chunk |
+13 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/resources/having-nonce-policy.html
|
View
|
1
2
3
|
1 chunk |
+17 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/resources/having-self-policy.html
|
View
|
1
2
3
|
1 chunk |
+13 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/resources/having-sniffing-script.html
|
View
|
1
2
3
|
1 chunk |
+11 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/resources/having-unsafe-eval-policy.html
|
View
|
1
2
3
|
1 chunk |
+13 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/resources/having-unsafe-inline-policy.html
|
View
|
1
2
3
|
1 chunk |
+13 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/resources/run-check.js
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/resources/sniff-js.cgi
|
View
|
1
2
3
|
1 chunk |
+7 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Source/core/dom/DocumentInit.cpp
|
View
|
1
2
3
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
Source/core/dom/ScriptLoader.h
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
M |
Source/core/dom/ScriptLoader.cpp
|
View
|
1
2
3
4
5
6
7
|
10 chunks |
+41 lines, -27 lines |
0 comments
|
Download
|
 |
M |
Source/core/html/HTMLImport.h
|
View
|
1
2
3
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
M |
Source/core/html/HTMLImportsController.cpp
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/core/html/parser/HTMLDocumentParser.cpp
|
View
|
1
2
3
4
5
6
7
|
3 chunks |
+11 lines, -3 lines |
0 comments
|
Download
|
 |
M |
Source/core/html/parser/HTMLResourcePreloader.cpp
|
View
|
1
2
3
4
5
6
7
|
2 chunks |
+9 lines, -6 lines |
0 comments
|
Download
|
 |
M |
Source/core/loader/cache/ResourceFetcher.cpp
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
Total messages: 17 (0 generated)
|