Closed
Bug 93218
Opened 23 years ago
Closed 23 years ago
XMLContentSink doesn't have a ProcessHTTPHeaders() method
Categories
(Core :: XML, defect, P3)
Core
XML
Tracking
()
VERIFIED
FIXED
mozilla1.0
People
(Reporter: ian, Assigned: hjtoi-bugzilla)
Details
(Keywords: testcase, Whiteboard: [Hixie-P3][ADT3][fixinhand])
Attachments
(1 file, 1 obsolete file)
16.09 KB,
patch
|
harishd
:
review+
darin.moz
:
superreview+
dbaron
:
approval+
|
Details | Diff | Splinter Review |
setting to m0.9.4
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.4
Giving bug to heikki!
I tried to copy the code into XMLContentSink but then got stuck with the
difference in ProcessStyleLink() signature :-(
Assignee: harishd → heikki
Status: ASSIGNED → NEW
Assignee | ||
Updated•23 years ago
|
Status: NEW → ASSIGNED
Priority: -- → P3
Reporter | ||
Comment 4•23 years ago
|
||
HTML case, works: http://www.hixie.ch/tests/adhoc/http/link/001.html
XML case, doesn't work: http://www.hixie.ch/tests/adhoc/http/link/002.xml
Keywords: testcase
Whiteboard: [Hixie-P3]
Assignee | ||
Comment 5•23 years ago
|
||
Assignee | ||
Updated•23 years ago
|
Target Milestone: mozilla0.9.4 → mozilla0.9.5
Assignee | ||
Updated•23 years ago
|
Target Milestone: mozilla0.9.5 → mozilla0.9.6
Assignee | ||
Updated•23 years ago
|
Target Milestone: mozilla0.9.6 → mozilla0.9.7
Assignee | ||
Updated•23 years ago
|
Target Milestone: mozilla0.9.7 → mozilla0.9.8
Assignee | ||
Updated•23 years ago
|
Target Milestone: mozilla0.9.8 → mozilla0.9.9
Assignee | ||
Updated•23 years ago
|
Assignee | ||
Comment 7•23 years ago
|
||
*** Bug 120836 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 8•23 years ago
|
||
Attachment #47405 -
Attachment is obsolete: true
Assignee | ||
Comment 9•23 years ago
|
||
Harish, can you review?
This makes us process the HTTP headers pretty much the same way we do them for
HTML. Most of the code has been copied from HTML content sink. *shiver* Horrible
looking code...
Notice that we do this only for XML documents that are loaded normally for
viewing (also when they are loaded as data) but not for XSLT style sheets or
XBL. XSLT and XBL reuse the XML content sink so they would get this benefit if
they passed in a channel to the XML content sink Init() method, or if they
create a sink with NS_NewXMLContentSink() and pass in a channel.
XBL is currently loaded from local disc so there is no reason to do it.
I believe it would be really rare to see an XML document have XSLT stylesheet
that had HTTP header supplying XSLT stylesheet for the first XSLT stylesheet - I
am not even sure if we have the architecture for that in the XSLT engine. It
looks like there would be a little bit of work to get a channel from XSLT in any
case. If we want this, a new bug should be filed.
I don't know if XUL supports HTTP headers, but if it doesn't and we want it to
we could use this approach there as well. We should file a new bug on that.
OS: Windows 2000 → All
Hardware: PC → All
Whiteboard: [Hixie-P3][ADT3] → [Hixie-P3][ADT3][fixinhand]
Reporter | ||
Comment 10•23 years ago
|
||
heikki: Wouldn't the bug for that be the one that asks for us to merge the XML
and XUL content sinks? :-)
Assignee | ||
Comment 11•23 years ago
|
||
That is one way of fixing it, but not the only one.
Comment 12•23 years ago
|
||
Comment on attachment 75500 [details] [diff] [review]
Proposed fix, mostly copy from HTML
sr=darin, i hate seeing so much duplicated code :( hopefully, only temporary.
Attachment #75500 -
Flags: superreview+
Comment 13•23 years ago
|
||
Comment on attachment 75500 [details] [diff] [review]
Proposed fix, mostly copy from HTML
>+ } else if (aType.Equals(NS_LITERAL_STRING("text/css"))) {
>+ nsCOMPtr<nsIURI> url;
>+ rv = NS_NewURI(getter_AddRefs(url), aHref, nsnull, mDocumentBaseURL);
>+ if (NS_FAILED(rv)) {
>+ return NS_OK; // The URL is bad, move along, don't propagate the error (for now)
>+ }
>+ PRBool doneLoading;
>+ rv = mCSSLoader->LoadStyleLink(aElement, url, aTitle, aMedia, kNameSpaceID_Unknown,
>+ mStyleSheetCount++,
>+ ((!aAlternate) ? mParser : nsnull),
>+ doneLoading,
>+ this);
>+ if (NS_SUCCEEDED(rv) || (rv == NS_ERROR_HTMLPARSER_BLOCK)) {
>+ if (rv == NS_ERROR_HTMLPARSER_BLOCK && mParser) {
>+ mParser->BlockParser();
>+ }
>+ mStyleSheetCount++;
>+ }
How is this related to supporting HTTP headers in XML?
>+static IsAlternateHTTPStyleSheetHeader(const nsAString& aRel)
>+{
How did this work without any return type?
>+nsresult
>+nsXMLContentSink::ProcessLink(nsIHTMLContent* aElement, const nsAReadableString& aLinkData)
>+{
> nsXMLContentSink::ProcessHeaderData(nsIAtom* aHeader,const nsAReadableString& aValue,nsIHTMLContent* aContent)
> {
>+nsXMLContentSink::ProcessHTTPHeaders(nsIChannel* aChannel) {
Are these methods a verbatim of HTMLContentSink? If they are then I don't have
to
review it. right? :)
Assignee | ||
Comment 14•23 years ago
|
||
That part that you questioned is executed if a HTTP header specifies a CSS
stylesheet.
Good catch about the missing return type, I'll fix it. Still, it works because
by default a return type is |int|.
They are nearly verbatim - see them side by side and there may be a difference
in how some function is called, or such a thing, because some functions these
functions are calling may have different signatures between the sinks.
Comment 15•23 years ago
|
||
Comment on attachment 75500 [details] [diff] [review]
Proposed fix, mostly copy from HTML
>+ result = ProcessStyleLink(
>+ aElement,
>+ href,
>+ !title.IsEmpty() && IsAlternateHTTPStyleSheetHeader(rel),
>+ title,
>+ type,
>+ media);
OPTIONAL :
Could you write this as
result =
ProcessStyleLink(aElement,
href,
!title.IsEmpty() && IsAlternateHTTPStyleSheetHeader(rel),
title,
type,
media);
Attachment #75500 -
Flags: review+
Comment on attachment 75500 [details] [diff] [review]
Proposed fix, mostly copy from HTML
a=dbaron for trunk checkin
Attachment #75500 -
Flags: approval+
Comment 17•23 years ago
|
||
Fix checked in. Marking FIXED.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 19•23 years ago
|
||
VERIFIED with test case in comment 4.
Thanks!!!
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•