Closed
Bug 106110
Opened 23 years ago
Closed 17 years ago
DOMParser parseFromString does not load stylesheet data
Categories
(Core :: XML, defect)
Tracking
()
RESOLVED
INVALID
Future
People
(Reporter: pwilson, Assigned: hjtoi-bugzilla)
References
()
Details
Attachments
(4 files)
DOMParser.parseFromString does not load stylesheet data for an XUL document. If I load an XUL document containing xml-stylesheet PI's the sylesheet structures (available through the nsIDocumentStyle interface) return a length of zero. The stylesheets are being processed as this was the cause of bug #78622 (which is now fixed) - the data is just not available. If I look at the same document loaded by the browser the nsIDocumentStyle interface return the correct data. Test case to follow.
Reporter | ||
Comment 1•23 years ago
|
||
Reporter | ||
Comment 2•23 years ago
|
||
Reporter | ||
Comment 3•23 years ago
|
||
Reporter | ||
Comment 4•23 years ago
|
||
Comment 5•23 years ago
|
||
->XUL?
Assignee: asa → hyatt
Status: UNCONFIRMED → NEW
Component: Browser-General → XP Toolkit/Widgets: XUL
Ever confirmed: true
QA Contact: doronr → jrgm
Comment 6•23 years ago
|
||
Loading a XUL file via DOMParser means that it is just plain old XML (since DOMParser only knows XML).
Assignee: hyatt → heikki
Component: XP Toolkit/Widgets: XUL → XML
QA Contact: jrgm → petersen
Summary: DOMParser parseFromString does not load stylesheet data for XUL document → DOMParser parseFromString does not load stylesheet data for XML document
Updated•23 years ago
|
Attachment #54549 -
Attachment description: xul file for test case → xml file for test case
Attachment #54549 -
Attachment mime type: application/vnd.mozilla.xul+xml → text/xml
Assignee | ||
Comment 7•23 years ago
|
||
Um, jrgm, why did you change the XUL file to XML mime type & name?
Comment 8•23 years ago
|
||
I guess I was just trying to emphasize the point (correct me if I'm wrong) that when you load a XUL file with the DOMParser, it is no different than any other XML file; the elements <window>, <script>, and <button> could be elements <larry>, <curly> and <moe> for all the DOMParser knows. (right?) So, while it is "XUL" when that file is loaded as chrome in the mozilla browser, it is "XML" when loading with the DOMParser.
Assignee | ||
Updated•23 years ago
|
Summary: DOMParser parseFromString does not load stylesheet data for XML document → DOMParser parseFromString does not load stylesheet data for XUL document
Target Milestone: --- → Future
Updated•22 years ago
|
QA Contact: petersen → rakeshmishra
Updated•21 years ago
|
QA Contact: rakeshmishra → ashishbhatt
Comment 9•21 years ago
|
||
Could someone attach a self-contained testcase (as a zip if need be) so that testing this does not involve reassembling things and renaming files to the right names?
Comment 10•17 years ago
|
||
This applies to XHTML documents loaded from DOMParser as well. I've updated the URL field to some JavaScript code that parses an XHTML document containing an xml-stylesheet processing instruction, an html:link element, and an html:style element. It then alerts the length of document.styleSheets.length. It should be 3, but it's 0.
Summary: DOMParser parseFromString does not load stylesheet data for XUL document → DOMParser parseFromString does not load stylesheet data
Comment 11•17 years ago
|
||
We should wontfix this, imo. DOMParser shouldn't be loading external resources.
Comment 12•17 years ago
|
||
I agree that it shouldn't load external resources (or at least by default), but the code I gave uses data URLs.
Comment 13•17 years ago
|
||
That's still an external resource. I don't want to start special-casing data URIs, and other URI types that "don't actually hit the network" (javascript:? about:? chrome:? res:? file:?). Especially because then we'd need to have this pervasively through the codebase (e.g. if a sheet from data: @imports a sheet we'd need to check for whether it's http: or data: or not, etc, etc). Right now the conceptual model is simple: you get a raw DOM with no external resources loaded. If you want them loaded, use an <iframe>.
Agreed, this is by design. Data-document such as the one produced by the DOMParser should not attempt to load uris.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → INVALID
Comment 15•17 years ago
|
||
What about style elements?
Comment 16•17 years ago
|
||
Data documents disable all processing of anything other than parsing the DOM. That means no XBL bindings, no CSS loading (inline or not), no script loading (inline or not). The CSS loader and script loader are explicitly disabled in this case; see http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/content/base/src/nsDocument.cpp&rev=3.765&mark=1445,1448#1438
You need to log in
before you can comment on or make changes to this bug.
Description
•