|
Let ContentSecurityPolicy shared between imports and the master.
This change is to match Blink's HTML Imports implementation
match the spec change [1] which says that all imported document
should follow CSP of the master document, instead of its own.
The implementation is straightforward. It:
- Makes ContentSecurityPolicy object ref-counted and passes
one of the master to its imported document.
- Disables <meta> directive for CSP when the document is an import.
Tests have to be changed much. As one CSP constraints all the scripts in each test,
things like shouldBe() is no longer usable in many test. Also, many imports
are now need to be servced via CORS so the change turns some of them from HTML to CGI.
Removed tests are ones that is no longer relevant: if script-src is unsafe-inline,
we cannot load any imports thus cannot test scripts in such imports.
[1] https://www.w3.org/Bugs/Public/show_bug.cgi?id=24268
BUG= 334210
TEST=http/tests/htmlimports/
R=abarth@chromium.org, dglazkov@chromium.org
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=168331
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+290 lines, -278 lines) |
Patch |
 |
M |
LayoutTests/http/tests/htmlimports/csp-import-block-but-domain.html
|
View
|
|
1 chunk |
+3 lines, -12 lines |
0 comments
|
Download
|
 |
M |
LayoutTests/http/tests/htmlimports/csp-import-block-but-domain-expected.txt
|
View
|
|
1 chunk |
+14 lines, -9 lines |
0 comments
|
Download
|
 |
M |
LayoutTests/http/tests/htmlimports/csp-import-block-but-domain-nested.html
|
View
|
|
1 chunk |
+3 lines, -13 lines |
0 comments
|
Download
|
 |
M |
LayoutTests/http/tests/htmlimports/csp-import-block-but-domain-nested-expected.txt
|
View
|
|
1 chunk |
+14 lines, -9 lines |
0 comments
|
Download
|
 |
M |
LayoutTests/http/tests/htmlimports/csp-import-block-but-nonce.html
|
View
|
|
1 chunk |
+22 lines, -13 lines |
0 comments
|
Download
|
 |
M |
LayoutTests/http/tests/htmlimports/csp-import-block-but-nonce-expected.txt
|
View
|
|
1 chunk |
+20 lines, -11 lines |
0 comments
|
Download
|
 |
M |
LayoutTests/http/tests/htmlimports/csp-import-block-but-nonce-nested.html
|
View
|
|
1 chunk |
+22 lines, -13 lines |
0 comments
|
Download
|
 |
M |
LayoutTests/http/tests/htmlimports/csp-import-block-but-nonce-nested-expected.txt
|
View
|
|
1 chunk |
+20 lines, -11 lines |
0 comments
|
Download
|
 |
M |
LayoutTests/http/tests/htmlimports/csp-import-block-but-self.html
|
View
|
|
1 chunk |
+2 lines, -11 lines |
0 comments
|
Download
|
 |
M |
LayoutTests/http/tests/htmlimports/csp-import-block-but-self-expected.txt
|
View
|
|
1 chunk |
+16 lines, -9 lines |
0 comments
|
Download
|
 |
M |
LayoutTests/http/tests/htmlimports/csp-import-block-but-self-nested.html
|
View
|
|
1 chunk |
+2 lines, -11 lines |
0 comments
|
Download
|
 |
M |
LayoutTests/http/tests/htmlimports/csp-import-block-but-self-nested-expected.txt
|
View
|
|
1 chunk |
+16 lines, -9 lines |
0 comments
|
Download
|
 |
D |
LayoutTests/http/tests/htmlimports/csp-import-block-but-unsafe-inline.html
|
View
|
|
1 chunk |
+0 lines, -19 lines |
0 comments
|
Download
|
 |
D |
LayoutTests/http/tests/htmlimports/csp-import-block-but-unsafe-inline-and-eval.html
|
View
|
|
1 chunk |
+0 lines, -19 lines |
0 comments
|
Download
|
 |
D |
LayoutTests/http/tests/htmlimports/csp-import-block-but-unsafe-inline-and-eval-expected.txt
|
View
|
|
1 chunk |
+0 lines, -10 lines |
0 comments
|
Download
|
 |
D |
LayoutTests/http/tests/htmlimports/csp-import-block-but-unsafe-inline-and-eval-nested.html
|
View
|
|
1 chunk |
+0 lines, -19 lines |
0 comments
|
Download
|
 |
D |
LayoutTests/http/tests/htmlimports/csp-import-block-but-unsafe-inline-and-eval-nested-expected.txt
|
View
|
|
1 chunk |
+0 lines, -10 lines |
0 comments
|
Download
|
 |
D |
LayoutTests/http/tests/htmlimports/csp-import-block-but-unsafe-inline-expected.txt
|
View
|
|
1 chunk |
+0 lines, -10 lines |
0 comments
|
Download
|
 |
D |
LayoutTests/http/tests/htmlimports/csp-import-block-but-unsafe-inline-nested.html
|
View
|
|
1 chunk |
+0 lines, -19 lines |
0 comments
|
Download
|
 |
D |
LayoutTests/http/tests/htmlimports/csp-import-block-but-unsafe-inline-nested-expected.txt
|
View
|
|
1 chunk |
+0 lines, -10 lines |
0 comments
|
Download
|
 |
M |
LayoutTests/http/tests/htmlimports/csp-in-imports.html
|
View
|
|
1 chunk |
+4 lines, -4 lines |
0 comments
|
Download
|
 |
M |
LayoutTests/http/tests/htmlimports/csp-not-block-import-in-import.html
|
View
|
|
1 chunk |
+3 lines, -2 lines |
0 comments
|
Download
|
 |
M |
LayoutTests/http/tests/htmlimports/csp-not-block-import-in-import-expected.txt
|
View
|
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
 |
A + |
LayoutTests/http/tests/htmlimports/resources/child-having-domain-policy.cgi
|
View
|
|
1 chunk |
+8 lines, -2 lines |
0 comments
|
Download
|
 |
A + |
LayoutTests/http/tests/htmlimports/resources/child-having-nonce-policy.cgi
|
View
|
|
1 chunk |
+8 lines, -2 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/resources/csp-import-block-but-domain.js
|
View
|
|
1 chunk |
+18 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/resources/csp-import-block-but-self.js
|
View
|
|
1 chunk |
+18 lines, -0 lines |
0 comments
|
Download
|
 |
M |
LayoutTests/http/tests/htmlimports/resources/external-script.js
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/resources/having-domain-policy.cgi
|
View
|
|
1 chunk |
+21 lines, -0 lines |
0 comments
|
Download
|
 |
M |
LayoutTests/http/tests/htmlimports/resources/having-domain-policy.html
|
View
|
|
1 chunk |
+2 lines, -3 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/http/tests/htmlimports/resources/having-nonce-policy.cgi
|
View
|
|
1 chunk |
+25 lines, -0 lines |
0 comments
|
Download
|
 |
M |
LayoutTests/http/tests/htmlimports/resources/having-nonce-policy.html
|
View
|
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
 |
M |
LayoutTests/http/tests/htmlimports/resources/having-self-policy.html
|
View
|
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
 |
M |
LayoutTests/http/tests/htmlimports/resources/having-unsafe-inline-policy.html
|
View
|
|
1 chunk |
+0 lines, -4 lines |
0 comments
|
Download
|
 |
M |
Source/core/dom/Document.cpp
|
View
|
|
3 chunks |
+10 lines, -1 line |
0 comments
|
Download
|
 |
M |
Source/core/dom/SecurityContext.h
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
Source/core/dom/SecurityContext.cpp
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/core/frame/ContentSecurityPolicy.h
|
View
|
|
2 chunks |
+5 lines, -3 lines |
0 comments
|
Download
|
 |
M |
Source/core/html/imports/HTMLImportChild.h
|
View
|
1
|
2 chunks |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
Source/core/html/imports/HTMLImportChild.cpp
|
View
|
1
|
2 chunks |
+5 lines, -1 line |
0 comments
|
Download
|
 |
M |
Source/core/html/imports/HTMLImportLoader.cpp
|
View
|
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
 |
M |
Source/core/html/imports/HTMLImportsController.cpp
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
Total messages: 16 (0 generated)
|