Closed Bug 203211 Opened 22 years ago Closed 21 years ago

[FIXr]pay attention to content-policies when loading XSLT stylesheets (nsIContentPolicy)

Categories

(Core :: XSLT, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla1.8alpha5

People

(Reporter: axel, Assigned: bzbarsky)

References

Details

Attachments

(2 files, 1 obsolete file)

bz asked us to ask the content policies when loading XSLT stylesheets. Marking deps on the nsIContentPolicy API bug for starters.
Summary: pay attention to content-policies when loading XSLT stylesheets → pay attention to content-policies when loading XSLT stylesheets (nsIContentPolicy)
Blocks: 251354
Attachment #161680 - Flags: superreview?(peterv)
Attachment #161680 - Flags: review?(bugmail)
Comment on attachment 161680 [details] [diff] [review] Somewhat like this >Index: extensions/transformiix/source/xslt/txMozillaStylesheetCompiler.cpp >=================================================================== >+ rv = conpol->ShouldLoad(nsIContentPolicy::TYPE_STYLESHEET, >+ aUri, >+ referrerURI, >+ // XXXbz do we have a document here? Or >+ // can we get a window off the loadgroup? >+ // Or something for the context? >+ nsnull, mProcessor (a txMozillaXSLTProcessor) holds the source document (mSource), I'd be fine with exposing it so you can get at it here. >+ NS_LITERAL_CSTRING("text/xsl"), Hmm, text/xsl doesn't really exist as a mimetype. We only accept it in the type attribute of the stylesheet PI for compatibility with IE. text/xml? >+ nsnull, >+ &decision); >+ if (decision != nsIContentPolicy::ACCEPT) { Any reason why you're not using the helper functions and macros from nsContentPolicyUtils.h in this file?
Attachment #161680 - Flags: superreview?(peterv) → superreview+
> I'd be fine with exposing it so you can get at it here. Sure. Care to attach a patch so I can test? > text/xml? Sure. > Any reason why you're not using the helper functions and macros I wasn't sure I could include that header here.
Attached patch GetSourceContentModel (obsolete) — Splinter Review
This should allow you to use mProcessor->GetSourceContentModel();
Attachment #161680 - Attachment is obsolete: true
Attachment #162488 - Attachment is obsolete: true
Attachment #161680 - Attachment is obsolete: false
Attachment #161680 - Flags: review?(bugmail) → review-
Attachment #162545 - Flags: superreview?(peterv)
Attachment #162545 - Flags: review?(bugmail)
Attachment #162545 - Flags: superreview?(peterv) → superreview+
Comment on attachment 162545 [details] [diff] [review] Patch updated to comments, with fixed GetSourceContentModel r=me do we want to add code for document() loaded documents as well. That's extra datadocuments loaded by the xslt stylesheet.
Attachment #162545 - Flags: review?(bugmail) → review+
Taking. (In reply to comment #6) > do we want to add code for document() loaded documents as well. That's extra > datadocuments loaded by the xslt stylesheet. I basically added the content policy check to the one place where XSLT called CheckLoadURI. Does it not call CheckLoadURI for document() loaded documents? If so, then we should indeed add both CheckLoadURI and content policy checks there...
Assignee: peterv → bzbarsky
Priority: -- → P2
Summary: pay attention to content-policies when loading XSLT stylesheets (nsIContentPolicy) → [FIXr]pay attention to content-policies when loading XSLT stylesheets (nsIContentPolicy)
Target Milestone: --- → mozilla1.8alpha5
Fixed. Sicking, want to file a followup on the document() issue?
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: