Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.6) Gecko/20040206 Firefox/0.8
it'd be awesome if the drag-and-drop css support styled the *entire* app.
thanks for a great irc client.
Steps to Reproduce:
I'm not sure how possible this is (though it would be cool). I currently can't
figure out any way to /add/ a stylesheet to a XUL window, so it may have to have
a dummy one in the source that is just changed at run-time instead. Also,
Mozilla *may* have objection to such changes, as the dynamic theme changing has
been very prone to crashes in the past.
Cleaning up UNCO's - valid enhancement request --> Confirming.
Created attachment 248636 [details] [diff] [review]
Wee, patch! :-)
So, I tested this on Mozilla 1.0. document.insertBefore totally b0rks there, so I added a fallback for that (ie, not do anything at all, and alert the user).
Apart from this, it seems to work pretty well on current Fx 2.0 and trunk - with the exception that changes really don't get through to it. Even trying to force it to flush the cache before/after changing things (/eval getService("@mozilla.org/observer-service;1", "nsIObserverService").notifyObservers(null, "chrome-flush-caches", null)) didn't convince it to actually update the cached css. sync-output continues to work fine for the content part, however.
Comment on attachment 248636 [details] [diff] [review]
>+ var node = document.firstChild;
>+ while (node && ((node.nodeType != node.PROCESSING_INSTRUCTION_NODE) ||
>+ node = node.nextSibling;
>+ var dataStr = "href=\"" + motifURL + "\" name=\"dyn-motif\"";
motifURL will need some sanity here; if it contains a double-quote, what happens?
>+ // No dynamical style node yet.
This code makes me cry (it's so hacky), but r=silver with above problems fixed.
Checked in with:
motifURL = motifURL.replace(/"/g, "%22");
and the comment fix. URL-escaping it might even make something broken work - given that you can't have double quotes in URLs in the first place. We don't do a full encodeURIComponent cause that'd screw up all the 'special' characters that we really do want (slashes, colons, etc.) According to the spec, XML entities aren't parsed as such in PIs, luckily for us, so we can leave that part of the universe for what it is.
Oh, right. --> FIXED.
I was thinking, we might want to update the dark motif so it styles the userlist? Sander has done all the work for us anyway: http://weblog.juima.org/showpost.asp?postid=3379
We should probably file a new bug for that, depending on this one.