RESOLVED FIXED 49281
Remove broken code for embedded CSS xml-stylesheet
https://bugs.webkit.org/show_bug.cgi?id=49281
Summary Remove broken code for embedded CSS xml-stylesheet
Alexey Proskuryakov
Reported 2010-11-09 14:36:18 PST
We have code in Document.cpp to support something like <?xml-stylesheet href="#mystyle" type="text/css" ?> <foo id="mystyle">heading { color: red; }</foo> It's not clear to me whether this is supposed to work. The spec <http://www.w3.org/TR/xml-stylesheet/> only says: --------------------------------- It is possible to associate a style sheet that is in the same document as the xml-stylesheet processing instruction by using just a fragment identifier in the href pseudo-attribute. For details on how this is managed in XSLT, see 3.11 Embedded Stylesheet Modules in [XSLT]. --------------------------------- One needs an actual xsl:stylesheet element to reference. For CSS, the analog would be a <style> element, but it makes no sense to reference it - it works by the virtue of being in document. I couldn't make a reference like this work in Firefox. This code is completely untested, and I think that it's wrong, because it sets stylesheet owner node to document, but assigns it to processing instruction node.
Attachments
proposed patch (2.25 KB, patch)
2010-11-09 14:49 PST, Alexey Proskuryakov
darin: review+
ap: commit-queue-
Alexey Proskuryakov
Comment 1 2010-11-09 14:41:00 PST
Alexey Proskuryakov
Comment 2 2010-11-09 14:48:57 PST
So, it's a bit more useful for Mozilla, because you can style arbitrary XML, not just XHTML. But there is no clarity on how this should work, and our implementation is definitely broken.
Alexey Proskuryakov
Comment 3 2010-11-09 14:49:39 PST
Created attachment 73423 [details] proposed patch
Alexey Proskuryakov
Comment 4 2010-11-09 15:09:42 PST
Note You need to log in before you can comment on or make changes to this bug.