Bug 49281

Summary: Remove broken code for embedded CSS xml-stylesheet
Product: WebKit Reporter: Alexey Proskuryakov <ap>
Component: CSSAssignee: Alexey Proskuryakov <ap>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
proposed patch darin: review+, ap: commit-queue-

Description Alexey Proskuryakov 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.
Comment 1 Alexey Proskuryakov 2010-11-09 14:41:00 PST
https://bugzilla.mozilla.org/show_bug.cgi?id=61675
Comment 2 Alexey Proskuryakov 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.
Comment 3 Alexey Proskuryakov 2010-11-09 14:49:39 PST
Created attachment 73423 [details]
proposed patch
Comment 4 Alexey Proskuryakov 2010-11-09 15:09:42 PST
Committed <http://trac.webkit.org/changeset/71684>.