Closed
Bug 1443344
Opened 6 years ago
Closed 6 years ago
Correctly propagate failures from child sheets blocked by content policy up to parent sheets
Categories
(Core :: CSS Parsing and Computation, enhancement)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
mozilla60
Tracking | Status | |
---|---|---|
firefox60 | --- | fixed |
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
Details
Attachments
(1 file, 1 obsolete file)
3.94 KB,
patch
|
bholley
:
review+
|
Details | Diff | Splinter Review |
This testcase: <!DOCTYPE html> <link rel="stylesheet" href="data:text/css,@import url('http://example.com')" onload="alert('success')" onerror="alert('fail')"> when loaded over https:// alerts "success". That's because css::Loader::LoadStyleLink does a content policy check which fails, but never tells the parent load data about that. Fixing this on top of bug 1442126 is pretty straightforward.
![]() |
Assignee | |
Comment 1•6 years ago
|
||
MozReview-Commit-ID: AArgnuHbCYL
Attachment #8956272 -
Flags: review?(bobbyholley)
![]() |
Assignee | |
Comment 2•6 years ago
|
||
Comment on attachment 8956272 [details] [diff] [review] Flag a parent sheet load as failed if an import is blocked by content policy I guess I still need to write a test.
Attachment #8956272 -
Flags: review?(bobbyholley)
![]() |
Assignee | |
Comment 3•6 years ago
|
||
MozReview-Commit-ID: AArgnuHbCYL
Attachment #8956326 -
Flags: review?(bobbyholley)
![]() |
Assignee | |
Updated•6 years ago
|
Attachment #8956272 -
Attachment is obsolete: true
Comment 4•6 years ago
|
||
Comment on attachment 8956326 [details] [diff] [review] Flag a parent sheet load as failed if an import is blocked by content policy Review of attachment 8956326 [details] [diff] [review]: ----------------------------------------------------------------- ::: layout/style/Loader.cpp @@ +2275,5 @@ > nsresult rv = CheckContentPolicy(loadingPrincipal, principal, aURL, context, false); > + if (NS_WARN_IF(NS_FAILED(rv))) { > + if (aParentData) { > + aParentData->mLoadFailed = true; > + } Add a comment explaining exactly why we don't need to call MarkLoadTreeFailed here?
Attachment #8956326 -
Flags: review?(bobbyholley) → review+
![]() |
Assignee | |
Comment 5•6 years ago
|
||
> Add a comment explaining exactly why we don't need to call MarkLoadTreeFailed here?
Nice catch. We do in fact need MarkLoadTreeFailed. I added a test that would have caught that and made the change.
Pushed by bzbarsky@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/c64f3b38bf58 Flag a parent sheet load as failed if an import is blocked by content policy. r=bholley
Comment 7•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/c64f3b38bf58
Status: NEW → RESOLVED
Closed: 6 years ago
status-firefox60:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
You need to log in
before you can comment on or make changes to this bug.
Description
•