Bug 11694 - XSLT output method does not default to HTML when the target document is HTML
Summary: XSLT output method does not default to HTML when the target document is HTML
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: XML (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Alexey Proskuryakov
URL: http://blog.ilikeu2.nl/demo/demo.html
Keywords: HasReduction
Depends on:
Blocks:
 
Reported: 2006-11-26 20:53 PST by Alex Taylor
Modified: 2006-11-27 21:45 PST (History)
1 user (show)

See Also:


Attachments
test case (626 bytes, text/html)
2006-11-27 10:04 PST, Alexey Proskuryakov
no flags Details
proposed fix (5.80 KB, patch)
2006-11-27 11:43 PST, Alexey Proskuryakov
hyatt: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Taylor 2006-11-26 20:53:03 PST
The rows in this "LiveGrid demo" don't look correct, they don't appear to have been transformed or had style applied. Result differs from Firefox.
Comment 1 Alexey Proskuryakov 2006-11-27 10:04:10 PST
Created attachment 11644 [details]
test case
Comment 2 Alexey Proskuryakov 2006-11-27 10:12:30 PST
The problem here is that the result of the transformation is plain XML, without an XHTML namespace. So, tags have no meaning when the result is inserted into the HTML document with appendChild(). I don't know why Firefox styles it, maybe they have some good reason?

To work around this, add an XSLT output directive: "<xsl:output method="html"/>".
Comment 3 Alexey Proskuryakov 2006-11-27 10:23:32 PST
I think I know the reason - Firefox defaults the output method to HTML because the target document of transformToFragment() is an HTML one.
Comment 4 Alexey Proskuryakov 2006-11-27 11:43:02 PST
Created attachment 11645 [details]
proposed fix
Comment 5 Dave Hyatt 2006-11-27 13:12:45 PST
Comment on attachment 11645 [details]
proposed fix

r=me
Comment 6 Alexey Proskuryakov 2006-11-27 21:45:50 PST
Committed revision 17902.