Closed
Bug 186835
Opened 22 years ago
Closed 22 years ago
{ib}CSS style sheet not working if XML is translated via XSL to XML-with-a-CSS-style-sheet
Categories
(Core :: XSLT, defect)
Tracking
()
VERIFIED
FIXED
People
(Reporter: bdowning, Assigned: sicking)
References
Details
Attachments
(6 files, 1 obsolete file)
200 bytes,
text/xml
|
Details | |
171 bytes,
text/xml
|
Details | |
547 bytes,
text/xml
|
Details | |
124 bytes,
text/css
|
Details | |
820 bytes,
patch
|
glazou
:
review+
jst
:
superreview+
|
Details | Diff | Splinter Review |
812 bytes,
application/xml
|
Details |
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021130
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3b) Gecko/20021223
XML translated to XML with a CSS stylesheet processing tag does not appear to
run the CSS stylesheet correctly. No visible output is generated if there is a
CSS stylesheet that styles the tags output by the XSL stylesheet. If the CSS
file is missing or empty, you get unstyled output. If the XSL processing is
done ahead of time and the postprocessed XML loaded into Mozilla, the CSS
styling works as expected.
Both files appear to have identical DOM trees.
I do not believe this is a dup of the stylesheet caching bugs (155715, etc.) as
a browser restart does not fix anything, and changes to the files as described
above appear on reload.
I'm classifying it as Major only because I don't know of another way to both
translate and style XML without resorting to XHTML.
Reproducible: Always
Steps to Reproduce:
1. Prepare directory with test.xml, test-processed.xml, test.xsl, and test.css
2. Load test.xml
3. Load test-processed.xml (which is test.xml with the XSLT processing already done)
4. Compare
Actual Results:
test.xml is not rendered. test-processed.xml is rendered fine. Their resultant
DOM trees in the DOM inspector appear to be identical - they both have the
proper XML tags and stylesheets.
Expected Results:
I think the results should be identical.
Reporter | ||
Comment 1•22 years ago
|
||
Reporter | ||
Comment 2•22 years ago
|
||
Reporter | ||
Comment 3•22 years ago
|
||
Reporter | ||
Comment 4•22 years ago
|
||
![]() |
||
Comment 5•22 years ago
|
||
Is this only a problem with current trunk builds, or also with 1.2.1?
Reporter | ||
Comment 6•22 years ago
|
||
1.2.1 is affected as well.
![]() |
||
Comment 7•22 years ago
|
||
OK. Out of curiousity, does opening the "File" menu do anything to change the
rendering in the "non-rendering" case?
Reporter | ||
Comment 8•22 years ago
|
||
Just opening the file menu? No, not in 1.2.1 or the trunk build from Dec. 23.
->XSLT
Assignee: dbaron → peterv
Component: Style System → XSLT
QA Contact: ian → keith
Assignee | ||
Comment 10•22 years ago
|
||
Strange, the stylesheet gets hooked up, but the rules in it cause everything to
get hidden. If I change the rule:
block {
display: block;
}
to
block {
display: inline;
}
everything works as expected.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee | ||
Comment 11•22 years ago
|
||
seems to be a block-in-inline problem. If I add a rule to make the root node a
block as well everything works as excepted.
so the following doesn't work if generated through XSLT:
inline <- A
block <- B
inline
#text
inline
#text
but works fine if loaded directly. Whereas if the A node is changed to a block,
or if the B node is changed to a inline everything works even when loaded
through XSLT.
![]() |
||
Comment 12•22 years ago
|
||
Hmm.. The only way an inline root node can work is if all the content gets
frames constructed at once. If the root node's frame is constructed and then
we get some ContentInserted/ContentAppended calls, we will flub the frame
construction.
I bet that's the difference between just loading the document (constructs the
DOM and then kicks off frame construction) and building it via XSLT (builds DOM
incrementally with notifications along the way??)
Summary: CSS style sheet not working if XML is translated via XSL to XML-with-a-CSS-style-sheet → {ib}CSS style sheet not working if XML is translated via XSL to XML-with-a-CSS-style-sheet
Assignee | ||
Comment 13•22 years ago
|
||
there should be no ContentInserted/ContentAppended calls after layout is
started. However the linked stylesheet won't be loaded until after the initial
reflow so that's probably what causes this to fail.
![]() |
||
Comment 14•22 years ago
|
||
Same thing; a reframe due to a display change is implemented via a pair of
calls to
nsCSSFrameConstructor::ContentRemoved/nsCSSFrameConstructor::ContentInserted.
Depends on: 168883
Assignee | ||
Comment 15•22 years ago
|
||
This holds off the notification that ends up starting layout until all linked
stylesheets in the result document are loaded. This should take care of all
cases where the stylesystem or layout doesn't fully deal with the incremental
changes of stylesheets comming in after the initial reflow.
The patch uses the existing mechanism in the nsCSSLoader that notifies an
observer when a stylesheet is fully loaded (including child-sheets). To do this
i've added a parameter to nsIStyleSheetLinkingElement::UpdateStylesheet that
lets you specify an observer to be notified when the stylesheet for the element
is done loading.
As a sidenote, the contentsinks should be using this same mechanism to unblock
the parser. I've filed bug 186943 on this.
Assignee | ||
Comment 16•22 years ago
|
||
I removed the comment in txMozillaXMLOutput::startHTMLElement about "XXX Trick
nsCSSLoader into blocking/notifying us?" since this patch does just that.
Assignee | ||
Updated•22 years ago
|
Attachment #110250 -
Flags: superreview?(bzbarsky)
Attachment #110250 -
Flags: review?(peterv)
![]() |
||
Comment 17•22 years ago
|
||
Comment on attachment 110250 [details] [diff] [review]
block layout until all stylesheets are loaded
> + // aSheet might not be in our list if the load was done syncronously
"synchronously"
sr=me otherwise, though we should remove all this code once sheets no longer
block the parser...
That said, this is all wallpaper over the {ib} issues which we need to fix for
other reasons and I'm not completely convinced we want to spend time doing this
instead of addressing that core issue...
Attachment #110250 -
Flags: superreview?(bzbarsky) → superreview+
Assignee | ||
Comment 18•22 years ago
|
||
bz: Agreed. The main reason i want to do this is that we will otherwise keep
getting bugs on XSLT where "it works for normal pages but not if I use XSLT".
Updated•22 years ago
|
Attachment #110250 -
Flags: review?(peterv) → review+
Assignee | ||
Comment 20•22 years ago
|
||
Checked in fix for XSLT.
Boris: Are there a bug on the underlying inline-in-block problem, or do you want
to use this bug for that?
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
![]() |
||
Comment 21•22 years ago
|
||
Um... see the "depends on" field of this bug, eh? ;) That will give you (via
its dependencies) all the {ib} goodness you want.
Comment 22•22 years ago
|
||
This commit have added a "uninitialized" warning on Brad TBox:
+extensions/transformiix/source/xslt/txMozillaXMLOutput.cpp:496
+ `nsresult rv' might be used uninitialized in this function
Indeed, it appears that the (rv == NS_ERROR_HTMLPARSER_BLOCK) comparison is
quite likely to be comparing an uninitialized rv. Is one of the previous lines
missing an "rv = "?
P.S. Per bug 179819 such warnings ought to be considered compilation errors.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 23•22 years ago
|
||
thanks for catching this
Attachment #110250 -
Attachment is obsolete: true
Assignee | ||
Comment 24•22 years ago
|
||
Comment on attachment 110811 [details] [diff] [review]
eek!
got r=glazman over irc
Attachment #110811 -
Flags: review+
Comment on attachment 110811 [details] [diff] [review]
eek!
r=glazman !!!
Comment 26•22 years ago
|
||
Comment on attachment 110811 [details] [diff] [review]
eek!
sr=jst
Attachment #110811 -
Flags: superreview+
Assignee | ||
Comment 27•22 years ago
|
||
warning-fixes checked in
Status: REOPENED → RESOLVED
Closed: 22 years ago → 22 years ago
Resolution: --- → FIXED
![]() |
||
Updated•18 years ago
|
Flags: in-testsuite?
Comment 29•10 years ago
|
||
Just to check the original testcase in browser online (without downloading).
You need to log in
before you can comment on or make changes to this bug.
Description
•