Last Comment Bug 322461 - [FIX]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
: fixed1.8.1, regression, testcase, verified1.8.0.2
Product: Core
Classification: Components
Component: XSLT (show other bugs)
: Trunk
: All All
: P1 normal with 1 vote (vote)
: mozilla1.9alpha1
Assigned To: Boris Zbarsky [:bz]
: Keith Visco
: 315380 327902 340980 (view as bug list)
Depends on:
  Show dependency treegraph
Reported: 2006-01-05 04:45 PST by Pavel Franc -
Modified: 2007-01-17 16:39 PST (History)
7 users (show)
dveditz: blocking1.8.0.2+
bzbarsky: in‑testsuite+
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Testcase (633 bytes, application/xml)
2006-01-05 04:46 PST, Pavel Franc -
no flags Details
result of the above as HTML (382 bytes, text/html)
2006-01-05 04:57 PST, Axel Hecht [:Pike]
no flags Details
Fix (2.91 KB, patch)
2006-01-05 09:16 PST, Boris Zbarsky [:bz]
jst: review+
jst: superreview+
dveditz: approval1.8.0.1-
dveditz: approval1.8.1+
Details | Diff | Review
Patch merged to 1.8.x branch (2.95 KB, patch)
2006-01-10 14:05 PST, Boris Zbarsky [:bz]
dveditz: approval1.8.0.2+
Details | Diff | Review

Description Pavel Franc - 2006-01-05 04:45:42 PST
FF 1.5 doesn't apply CSS rules with selector in uppercase in document after XSLT transformation with the output set to html.
Comment 1 Pavel Franc - 2006-01-05 04:46:23 PST
Created attachment 207601 [details]
Comment 2 Axel Hecht [:Pike] 2006-01-05 04:57:41 PST
Created attachment 207603 [details]
result of the above as HTML

For reference, this is the output of the transform, as html.
Comment 4 Axel Hecht 2006-01-05 06:37:41 PST
Ria, could you explain that with a bit more detail? Did you test nightlies between
1.7 and 1.8?
Comment 5 Martijn Wargers [:mwargers] (gone per 2016-05-31 :-( ) 2006-01-05 07:55:21 PST
Yes, that's what she did.
From that regression range, I would think this could be a regression from bug 290068.
Comment 6 Axel Hecht 2006-01-05 08:26:27 PST
Seems like we're setting case sensitivity eagerly, too.
Comment 7 Boris Zbarsky [:bz] 2006-01-05 08:54:58 PST
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?
Comment 8 Boris Zbarsky [:bz] 2006-01-05 09:00:30 PST
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...
Comment 9 Boris Zbarsky [:bz] 2006-01-05 09:16:20 PST
Created attachment 207628 [details] [diff] [review]
Comment 10 Jonas Sicking (:sicking) 2006-01-05 10:40:11 PST
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.
Comment 11 Boris Zbarsky [:bz] 2006-01-05 12:26:04 PST
> Why bother setting mDefaultNamespace to kNameSpaceID_None (== 0)?

Because I think depending on kNameSpaceID_None == 0 is a bad idea.
Comment 12 Jonas Sicking (:sicking) 2006-01-05 12:29:58 PST
Good point
Comment 13 Johnny Stenback (:jst, 2006-01-05 17:23:46 PST
Comment on attachment 207628 [details] [diff] [review]

Comment 14 Boris Zbarsky [:bz] 2006-01-05 18:49:47 PST
Comment on attachment 207628 [details] [diff] [review]

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.
Comment 15 Jonas Sicking (:sicking) 2006-01-05 18:53:42 PST
how will this affect things like document.implementation.createDocument? I guess not very much since such documents are never styled?
Comment 16 Boris Zbarsky [:bz] 2006-01-05 19:13:00 PST
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.
Comment 17 Axel Hecht 2006-01-06 04:46:08 PST
createDocument only creates XML documents anyway.
Comment 18 Daniel Veditz [:dveditz] 2006-01-10 13:46:43 PST
Comment on attachment 207628 [details] [diff] [review]

This has come in too late for (no trunk-baking time) but we'll consider for
Comment 19 Boris Zbarsky [:bz] 2006-01-10 14:05:58 PST
Created attachment 208126 [details] [diff] [review]
Patch merged to 1.8.x branch
Comment 20 Boris Zbarsky [:bz] 2006-01-10 14:06:43 PST
Fixed on the 1.8 branch.
Comment 21 Daniel Veditz [:dveditz] 2006-02-21 23:38:55 PST
Comment on attachment 208126 [details] [diff] [review]
Patch merged to 1.8.x branch

approved for 1.8.0 branch, a=dveditz
Comment 22 Boris Zbarsky [:bz] 2006-02-22 21:04:23 PST
Fixed for
Comment 23 Dave Liebreich [:davel] 2006-03-01 16:31:20 PST
Marking [rft-dl] (ready for testing in Firefox release candidates)
Comment 24 Jay Patel [:jay] 2006-03-08 16:42:37 PST
v.fixed on 1.8.0 branch with Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20060308 Firefox/, I see green.
Comment 25 Jonas Sicking (:sicking) 2006-03-13 03:03:35 PST
*** Bug 315380 has been marked as a duplicate of this bug. ***
Comment 26 Jonas Sicking (:sicking) 2006-03-13 03:04:36 PST
*** Bug 327902 has been marked as a duplicate of this bug. ***
Comment 27 Jonas Sicking (:sicking) 2006-06-17 00:20:24 PDT
*** Bug 340980 has been marked as a duplicate of this bug. ***
Comment 28 Boris Zbarsky [:bz] 2007-01-17 16:39:10 PST
Added to reftest.

Note You need to log in before you can comment on or make changes to this bug.