Closed Bug 178463 Opened 24 years ago Closed 23 years ago

add META tag to HEAD for html output in module

Categories

(Core :: XSLT, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla1.4alpha

People

(Reporter: axel, Assigned: axel)

References

()

Details

Attachments

(1 file, 1 obsolete file)

As Mozilla considers whitespace significant in the DOM, XSLT should generate whitespace nodes as requested by the spec for indent="true". We should generate the html/head/meta tag with the encoding, too. (This should fix a bunch of buster tests, as those mostly fail on the whitespace now)
hmm.. i'm not so sure. Indentation is part of outputting and we don't do that.
The backbone of indent was already there, shared with standalone. So it's just hooking it up in the output handler. Two cases are a bit special with indenting the end tag, empty elements and those with text content. (Indenting end tag is having a textnode as last child.) Empty elements should stay empty, so the endtag doesn't get indented. Same for elements with text content. The easiest way to detect that is going for the last child, if that's text, don't indent the end tag. As mixed content (element and text being siblings) is messy by spec, I don't mind going for the easy way.
this patch doesn't fix lots of buster, but it increases the readability of generated source a great deal. Just try test.xml, select all and view selection source. (the xalan testcases have odd formatting for html references :-( )
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.3alpha
Comment on attachment 105966 [details] [diff] [review] implement <xsl:output indent="true"/> peterv, should we do this?
Attachment #105966 - Attachment description: implement <xsl:output indent="true"7> → implement <xsl:output indent="true"/>
Attachment #105966 - Flags: superreview?(peterv)
There are two arguments that i can think of against doing this. First off we would end up wasting cycles a lot of the time since indent defaults to on for html-output and hardly ever people actually need the whitespace to be there. Second if we did this then the argument for not supporting d-o-e kind'a falls since we can no longer claim that we don't do output. I don't really mind that we end up failing some of the xalan testcases due to this, especially if those tests are in the 'output' section. Since we don't do any outputting we IMHO don't really need to pass any of the tests in that section. Something that would be nice to do though would be to have a transformToString method that used the outputhandlers from standalone and let buster use that. Or even better, be able to switch between using transformToString and transformToDocument.
rereading the spec in a discussion with peterv about output in Mozilla, I have to reinterpret my initial argument. <Pike> the output tree is the thing that is created as we do now. You can add and remove whitespace as long as it doesn't change anything in HTML. Mozilla considers whitespace to be significant at all times, so no indent in HTML (see the glorious whitespace textnodes bug somewhere) <Pike> xml indent is hard <Pike> so I'll INVALID the indent part of it I'd like to keep the META part of the patch though.
Summary: <xsl:output indent="true"> and meta tag for html in module → add META tag to HEAD for html output in module
Attachment #105966 - Attachment is obsolete: true
Attachment #105966 - Flags: superreview?(peterv)
this patch adds a meta tag for html output. it uses the mediatype and the encoding from the output format, which have the correct defaults. the rv= chunk is just a nit I found in the code, we check the same rv twice, but really want to check the rv of the AppendChild
Comment on attachment 106362 [details] [diff] [review] implement META tag insertion for html output you need to make sure that this is only done in html-output mode, not in xml. startHTMLElement is called for xhtml elements in xml mode. Other then that this looks good
Attachment #106362 - Flags: review+
fix for Jonas' comment in my tree, just a if (atom == txHTMLAtoms::head) { to if (atom == txHTMLAtoms::head && mOutputFormat.mMethod == eHTMLOutput) {
Attachment #106362 - Flags: superreview+
oops
Target Milestone: mozilla1.3alpha → mozilla1.4alpha
checked in
Status: ASSIGNED → RESOLVED
Closed: 23 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: