Closed Bug 109918 Opened 23 years ago Closed 22 years ago

CSS stylesheets need lowercase tagnames, which isn't like html

Categories

(Core :: XSLT, defect)

x86
Linux
defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: lars, Assigned: sicking)

References

Details

(Keywords: testcase)

Attachments

(3 files)

I was pleased to find that Mozilla will read an xml file and an associate XSLT stylesheet and render the resulting HTML output. Nifty! Unfortunately, it appears that if the generated output includes stylesheet <link> elements in the <head> element, these are ignored. In other words: The HTML generated by my XSLT stylesheet includes: <link rel="stylesheet" type="text/css" href="standard.css"> If I generate the html manually using xsltproc and point Mozilla at the resulting html file, the CSS stylesheet works as expected. On the other hand, if I point mozilla at the XML file (with an embedded xml-stylesheet element), the XSLT transform works correctly, but the CSS stylesheet is never consulted.
IIRC, this is something glazou has a fix for. But I can't find the bug. dumb me.
Whiteboard: [dupeme]
This should be being covered under bug 96647. I think its actually a dup of bug 53030, but I'm not totally sure so aren't going to mark it as such myself.
non of the above. It is indeed bug 34849, which I found by looking at the bugs above, so thanx for the links. Leaving up for peterv or glazou to make up if this depends or dupes. (I tend to depend)
I don't think it's that one either. This is a linked stylesheet which should work since the fix of bug 7515! lars: could you attach the xml-page and the xslt-stylesheet that you get this error in. Please read the guidelines in http://www.mozilla.org/projects/xslt before attaching
Attached file test case: xml source file (deleted) —
Attached file test case: xsl stylesheet (deleted) —
Attached file test case: css stylesheet (deleted) —
I've attached a trivial xml document, the corresponding xslt stylesheet, and the css stylesheet. Note that I am opening these on disks, not from a server.
This is due to the stylesheet having capital tag names, BODY and P, but xhtml (which is our output) being lower case. Confirming, though I'm not sure if we gonna fix this
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Mozilla ignores html stylesheets in content generated with XSLT. → CSS stylesheets need lowercase tagnames, which isn't like html
Whiteboard: [dupeme]
Interesting. I hadn't considered the fact the the css selectors were case sensitive, but of course that makes perfect sense when the target document is XHTML. Not really a bug, I guess, although it might be worth noting prominently somewhere...
Excerpt from CSS 2 spec section 4.1.3 : All CSS style sheets are case-insensitive, except for parts that are not under the control of CSS. For example, the case-sensitivity of values of the HTML attributes "id" and "class", of font names, and of URIs lies outside the scope of this specification. Note in particular that element names are case-insensitive in HTML, but case-sensitive in XML. Excerpt from section 5.1 : The case-sensitivity of document language element names in selectors depends on the document language. For example, in HTML, element names are case-insensitive, but in XML they are case-sensitive. Excerpt from section 5.8.1 : The case-sensitivity of attribute names and values in selectors depends on the document language.
glazou: how does layout know that some content is html and should be styled case-insensitive? Does it check the document-object or the elements? What does it check on these objects? Would it be possible for us to fool style that the xhtml document is a html document? Since transformiix really should output html and not xhtml it would be good if we could make the xhtml behave as much as possible as html.
Jonas! (I hope)
Assignee: kvisco → sicking
Depends on: txxhtml
> how does layout know that some content is html and should be styled > case-insensitive? Does it check the document-object or the elements? The HTML content sink asks the document object for a CSSLoader. If you look at GetCSSLoader() on the various documents (nsHTMLDocument, nsXMLDocument being the two you care about here) you'll see that the document sets the case-sensitivity of the CSSLoader. I'm not sure how you can go about fooling the document into mis-setting the case-sensitivity of the CSSLoader.
Keywords: testcase
fixed with branch-landing
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
mass verifying
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: