Last Comment Bug 451232 - Setting ui.* color pref to empty string or removing pref doesn't immediately reset color to default
: Setting ui.* color pref to empty string or removing pref doesn't immediately ...
Status: VERIFIED FIXED
: testcase
Product: Core
Classification: Components
Component: Widget (show other bugs)
: Trunk
: All All
: -- minor (vote)
: mozilla1.9.1b1
Assigned To: Graeme McCutcheon [:graememcc]
:
Mentors:
Depends on:
Blocks: 263683
  Show dependency treegraph
 
Reported: 2008-08-19 12:13 PDT by Martijn Wargers [:mwargers] (not working for Mozilla)
Modified: 2008-09-11 17:17 PDT (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
testcase (uses enhanced privileges) (1.68 KB, text/html)
2008-08-19 12:13 PDT, Martijn Wargers [:mwargers] (not working for Mozilla)
no flags Details
testcase for textSelectBackground (1.32 KB, text/html)
2008-08-19 12:28 PDT, Graeme McCutcheon [:graememcc]
no flags Details
Patch v1 (1.74 KB, patch)
2008-08-20 04:56 PDT, Graeme McCutcheon [:graememcc]
roc: review+
roc: superreview+
Details | Diff | Splinter Review

Description Martijn Wargers [:mwargers] (not working for Mozilla) 2008-08-19 12:13:23 PDT
Created attachment 334532 [details]
testcase (uses enhanced privileges)

See testcase.
When clicking on the first 2 buttons, you can see the find highlighted text selection go to green/blue, respectively.
However, with the 3rd and 4th button, I would expect the find highlighted text selection to go to the default color (which is yellow in my case).
This doesn't happen for me, it only happens for me after I have restarted my browser.

It's not a big deal, but extension writers might find this annoying.
Comment 1 Graeme McCutcheon [:graememcc] 2008-08-19 12:28:29 PDT
Created attachment 334536 [details]
testcase for textSelectBackground

This doesn't appear to be unique to ui.textHighlightBackground.

The above testcase exhibits the same behavior for ui.textSelectBackground
Comment 2 Graeme McCutcheon [:graememcc] 2008-08-20 04:56:01 PDT
Created attachment 334679 [details] [diff] [review]
Patch v1

So, this is definitely not unique to the ui.textHighlightBackground pref: it is in fact the same for for all ui.* color preferences.

nsXPLookAndFeel observes the various color prefs it cares about, and if the pref is set or changed to a color string, nsXPLookAndFeel will cache the new value for future lookups. However, if the value is cleared, there's currently no mechanism to say "stop using the cached value, and look up the default".

Not sure how to test this...
Comment 3 Robert O'Callahan (:roc) (Exited; email my personal email if necessary) 2008-08-20 12:15:34 PDT
Comment on attachment 334679 [details] [diff] [review]
Patch v1

Excellent, thanks!
Comment 4 Dão Gottwald [:dao] 2008-09-05 03:01:15 PDT
http://hg.mozilla.org/mozilla-central/rev/6a6a0717bbfd
Comment 5 Martijn Wargers [:mwargers] (not working for Mozilla) 2008-09-10 14:19:47 PDT
Verified fixed, using:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b1pre) Gecko/20080908091724 Minefield/3.1b1pre

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