Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Fire error event when CSP blocks inline stylesheets
https://bugs.webkit.org/show_bug.cgi?id=246710 rdar://101308540 Reviewed by Chris Dumez. When we block inline style with CSP we don't fire an error event. This change will cause the element to fire an error event when CSP blocks us from creating a stylesheet. * LayoutTests/TestExpectations: * LayoutTests/http/tests/security/contentSecurityPolicy/style-src-blocked-error-event-expected.txt: Removed. * LayoutTests/http/tests/security/contentSecurityPolicy/style-src-blocked-error-event.html: Removed. This test is redundant to imported/w3c/web-platform-tests/content-security-policy/style-src/style-blocked.html and any other tests which block style but allow unsafe-inline. * LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/style-src-error-event-fires-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/style-src-inline-style-nonce-blocked-error-event-expected.txt: * Source/WebCore/dom/InlineStyleSheetOwner.cpp: (WebCore::InlineStyleSheetOwner::createSheet): Canonical link: https://commits.webkit.org/255744@main
- Loading branch information
Showing
6 changed files
with
5 additions
and
44 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 was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,4 @@ | ||
CONSOLE MESSAGE: Refused to load http://localhost:8800/content-security-policy/style-src/resources/style-src.css because it does not appear in the style-src directive of the Content Security Policy. | ||
CONSOLE MESSAGE: Refused to load http://localhost:8800/content-security-policy/style-src/resources/style-src.css because it does not appear in the style-src directive of the Content Security Policy. | ||
CONSOLE MESSAGE: Refused to apply a stylesheet because its hash, its nonce, or 'unsafe-inline' does not appear in the style-src directive of the Content Security Policy. | ||
|
||
Harness Error (TIMEOUT), message = null | ||
|
||
PASS Test error event fires on stylesheet link | ||
NOTRUN Test error event fires on inline style | ||
PASS Test error event fires on inline style | ||
Lorem ipsum |
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,7 +1,4 @@ | ||
CONSOLE MESSAGE: Refused to apply a stylesheet because its hash, its nonce, or 'unsafe-inline' does not appear in the style-src directive of the Content Security Policy. | ||
|
||
Harness Error (TIMEOUT), message = null | ||
|
||
PASS Should fire a securitypolicyviolation event | ||
NOTRUN Test that paragraph remains unmodified and error events received. | ||
PASS Test that paragraph remains unmodified and error events received. | ||
Lorem ipsum |
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