Bug 49281 - Remove broken code for embedded CSS xml-stylesheet
Summary: Remove broken code for embedded CSS xml-stylesheet
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Alexey Proskuryakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-09 14:36 PST by Alexey Proskuryakov
Modified: 2010-11-09 15:09 PST (History)
0 users

See Also:


Attachments
proposed patch (2.25 KB, patch)
2010-11-09 14:49 PST, Alexey Proskuryakov
darin: review+
ap: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>.