Closed Bug 71262 Opened 24 years ago Closed 24 years ago

Add support for <stylesheet src=""> to XBL

Categories

(Core :: XBL, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla0.9

People

(Reporter: hyatt, Assigned: hyatt)

References

Details

Attachments

(1 file)

Instead of improperly using the PI for loading stylesheets, XBL should have its own stylesheet loading directive.
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9
Summary: Add support for <resource type="stylesheet"> to XBL → Add support for <stylesheet src=""> to XBL
*** Bug 58758 has been marked as a duplicate of this bug. ***
sr=shaver.
+ nsCOMPtr<nsIContent> content(do_QueryInterface(supp)); + nsCOMPtr<nsIDocument> doc; + content->GetDocument(*getter_AddRefs(doc)); + + PRBool ready = PR_FALSE; + xblService->BindingReady(content, bindingURI, &ready); + + if (ready) { You could move the |doc| declaration and getter inside the |if (ready)| r=jag
Is this absolutely necessary? Can't we reuse the standard ways of loading stylesheets (PI in a document prolog or XHTML link element)?
heikki: XBL allows you to scope stylesheets so that they don't affect other bindings. For example, if your <button> binding uses several <div>s in its generated content, then the stylesheet for the binding could say div { border: solid } ...without affecting any other <div> elements in the document. This is the basis of skinning widgets. That's why we want this. Now as to why we want to do it this way: Per the specs, the XML PI would load the stylesheet for the binding document if you viewed the binding document. If you just link in to the binding document, it shouldn't do anything particularly clever with it -- the XML PI doesn't apply to the bound element, but to the binding document. Also, using an element as hyatt proposes here means you can have binding stylesheets on a per-binding basis -- the XML PI applies to an entire document. The reason we don't use <html:link> is because XBL has nothing to do with HTML and so there is no reason to use it. (This is just like SVG -- they don't use the HTML <style> element, they have their own.)
Ok, I buy it (actually after reading the dupe I realized this was probably the case). Does the stylesheet element have type attribute, a la the stylesheet PI? Theoretically at least you should probably be able to use any style language you'd want...
It supports type and media. It does not support title, since alternate stylesheets in this context are non-sensical.
Fixed.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: