Closed Bug 322461 Opened 19 years ago Closed 19 years ago

[FIX]FF 1.5 doesn't apply CSS stylesheets in document after XSLT transformation

Categories

(Core :: XSLT, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla1.9alpha1

People

(Reporter: p.franc, Assigned: bzbarsky)

References

Details

(4 keywords, Whiteboard: [rft-dl])

Attachments

(4 files)

FF 1.5 doesn't apply CSS rules with selector in uppercase in document after XSLT transformation with the output set to html.
Attached file Testcase
For reference, this is the output of the transform, as html.
Ria, could you explain that with a bit more detail? Did you test nightlies between
1.7 and 1.8?
Yes, that's what she did.
From that regression range, I would think this could be a regression from bug 290068.
Keywords: regression, testcase
Seems like we're setting case sensitivity eagerly, too.
So we call SetCaseSensitive() in the nsDocument Init() (and at this point we're assuming case-sensitive).  Then we reset it once we know whether we're HTML or XHTML, which is in nsHTMLDocument::StartDocumentLoad().  Of course XSLT doesn't call StartDocumentLoad(), right?

So how does XSLT actually create the document?  How is the document supposed to know it's an HTML document and not an XHTML one?
OK, I see what's up.  The document is created via createInstance, which never initializes the mDefaultNamespaceID member of HTMLDocument.  That means the zeroing allocator sets it to 0, which happens to be kNamespaceID_None.  We should probably fix this part.

But anyway, it looks like creating by contract id gives us an HTML document, not an XHTML one.  So we should probably override Init() in nsHTMLDocument to call the superclass Init() and then reset the case-sensitivity as needed...
Attached patch FixSplinter Review
Assignee: xslt → bzbarsky
Status: NEW → ASSIGNED
Attachment #207628 - Flags: superreview?(jst)
Attachment #207628 - Flags: review?(jst)
OS: Windows 2000 → All
Priority: -- → P1
Hardware: PC → All
Summary: FF 1.5 doesn't apply CSS stylesheets in document after XSLT transformation → [FIX]FF 1.5 doesn't apply CSS stylesheets in document after XSLT transformation
Target Milestone: --- → mozilla1.9alpha
Version: 1.8 Branch → Trunk
Why bother setting mDefaultNamespace to kNameSpaceID_None (== 0)?

This is a pretty bad regression (one that we should test for when we get automated tests), would be good to get this on the branches.
> Why bother setting mDefaultNamespace to kNameSpaceID_None (== 0)?

Because I think depending on kNameSpaceID_None == 0 is a bad idea.
Comment on attachment 207628 [details] [diff] [review]
Fix

r+sr=jst
Attachment #207628 - Flags: superreview?(jst)
Attachment #207628 - Flags: superreview+
Attachment #207628 - Flags: review?(jst)
Attachment #207628 - Flags: review+
Comment on attachment 207628 [details] [diff] [review]
Fix

This is probably serious enough a regression to be worth considering for 1.8.0.x.  I definitely think we should take this for 1.8.1.

The patch is very very safe.  Only cases where the document is not actually being loaded (like XSLT) are affected.
Attachment #207628 - Flags: approval1.8.1?
Attachment #207628 - Flags: approval1.8.0.1?
how will this affect things like document.implementation.createDocument? I guess not very much since such documents are never styled?
Fixed on trunk.

Sicking, createDocument creates the same thing after this patch as it always did.  But yes, those documents are never styled, at the moment.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
createDocument only creates XML documents anyway.
Comment on attachment 207628 [details] [diff] [review]
Fix

This has come in too late for 1.8.0.1 (no trunk-baking time) but we'll consider for 1.8.0.2
Attachment #207628 - Flags: approval1.8.1?
Attachment #207628 - Flags: approval1.8.1+
Attachment #207628 - Flags: approval1.8.0.2?
Attachment #207628 - Flags: approval1.8.0.1?
Attachment #207628 - Flags: approval1.8.0.1-
Fixed on the 1.8 branch.
Keywords: fixed1.8.1
Target Milestone: mozilla1.9alpha → mozilla1.8.1
Flags: blocking1.8.0.2+
Attachment #207628 - Flags: approval1.8.0.2?
Comment on attachment 208126 [details] [diff] [review]
Patch merged to 1.8.x branch

approved for 1.8.0 branch, a=dveditz
Attachment #208126 - Flags: approval1.8.0.2+
Fixed for 1.8.0.2
Keywords: fixed1.8.0.2
Marking [rft-dl] (ready for testing in Firefox 1.5.0.2 release candidates)
Whiteboard: [rft-dl]
v.fixed on 1.8.0 branch with Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.2) Gecko/20060308 Firefox/1.5.0.2, I see green.
*** Bug 315380 has been marked as a duplicate of this bug. ***
*** Bug 327902 has been marked as a duplicate of this bug. ***
*** Bug 340980 has been marked as a duplicate of this bug. ***
Target Milestone: mozilla1.8.1 → mozilla1.9alpha
Added to reftest.
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: