Last Comment Bug 235169 - ChatZilla's motifs should style the user list and other UI elements
: ChatZilla's motifs should style the user list and other UI elements
Status: RESOLVED FIXED
[cz-0.9.78]
:
Product: Other Applications
Classification: Client Software
Component: ChatZilla (show other bugs)
: Trunk
: All All
: -- enhancement (vote)
: ---
Assigned To: :Gijs Kruitbosch (Gone July 28 - Aug 11)
: Samuel Sieb
Mentors:
Depends on: 325358
Blocks:
  Show dependency treegraph
 
Reported: 2004-02-21 16:48 PST by rob lord
Modified: 2006-12-17 02:33 PST (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Patch (5.76 KB, patch)
2006-12-14 04:02 PST, :Gijs Kruitbosch (Gone July 28 - Aug 11)
bugzilla-mozilla-20000923: review+
Details | Diff | Splinter Review

Description rob lord 2004-02-21 16:48:33 PST
User-Agent:       
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. 

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 James Ross 2004-02-21 16:55:07 PST
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.
Comment 2 :Gijs Kruitbosch (Gone July 28 - Aug 11) 2006-02-05 08:33:37 PST
Cleaning up UNCO's - valid enhancement request --> Confirming.
Comment 3 :Gijs Kruitbosch (Gone July 28 - Aug 11) 2006-12-14 04:02:11 PST
Created attachment 248636 [details] [diff] [review]
Patch

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 4 James Ross 2006-12-16 09:08:45 PST
Comment on attachment 248636 [details] [diff] [review]
Patch

>+function updateAppMotif(motifURL)
>+{
>+    var node = document.firstChild;
>+    while (node && ((node.nodeType != node.PROCESSING_INSTRUCTION_NODE) ||
>+                    !(/name="dyn-motif"/).test(node.data)))
>+    {
>+        node = node.nextSibling;
>+    }
>+
>+    var dataStr = "href=\"" + motifURL + "\" name=\"dyn-motif\"";

motifURL will need some sanity here; if it contains a double-quote, what happens?

>+    try 
>+    {
>+        // No dynamical style node yet.

s/dynamical/dynamic/

This code makes me cry (it's so hacky), but r=silver with above problems fixed.
Comment 5 :Gijs Kruitbosch (Gone July 28 - Aug 11) 2006-12-17 02:33:02 PST
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.

Note You need to log in before you can comment on or make changes to this bug.