Closed
Bug 71262
Opened 24 years ago
Closed 24 years ago
Add support for <stylesheet src=""> to XBL
Categories
(Core :: XBL, defect)
Tracking
()
RESOLVED
FIXED
mozilla0.9
People
(Reporter: hyatt, Assigned: hyatt)
References
Details
Attachments
(1 file)
23.59 KB,
patch
|
Details | Diff | Splinter Review |
Instead of improperly using the PI for loading stylesheets, XBL should have its
own stylesheet loading directive.
Assignee | ||
Updated•24 years ago
|
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9
Assignee | ||
Comment 1•24 years ago
|
||
Assignee | ||
Updated•24 years ago
|
Summary: Add support for <resource type="stylesheet"> to XBL → Add support for <stylesheet src=""> to XBL
Comment 3•24 years ago
|
||
sr=shaver.
Comment 4•24 years ago
|
||
+ 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)?
Comment 6•24 years ago
|
||
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...
Assignee | ||
Comment 8•24 years ago
|
||
It supports type and media. It does not support title, since alternate
stylesheets in this context are non-sensical.
Assignee | ||
Comment 9•24 years ago
|
||
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.
Description
•