Bug 11694

Summary: XSLT output method does not default to HTML when the target document is HTML
Product: WebKit Reporter: Alex Taylor <darwin>
Component: XMLAssignee: Alexey Proskuryakov <ap>
Status: RESOLVED FIXED    
Severity: Normal CC: ap
Priority: P2 Keywords: HasReduction
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
URL: http://blog.ilikeu2.nl/demo/demo.html
Attachments:
Description Flags
test case
none
proposed fix hyatt: review+

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.