Closed
Bug 306241
Opened 19 years ago
Closed 19 years ago
calendarManagement not looking for contrasting color when null
Categories
(Calendar :: Sunbird Only, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: robin.edrenius, Assigned: mostafah)
Details
Attachments
(1 file, 2 obsolete files)
|
1.16 KB,
patch
|
jminta
:
first-review+
mvl
:
second-review-
|
Details | Diff | Splinter Review |
calendarManagement is not looking for contrasting textcolor if 'null'
| Reporter | ||
Comment 1•19 years ago
|
||
This should fix the issue.
Attachment #194097 -
Flags: first-review?(jminta)
Comment 2•19 years ago
|
||
Comment on attachment 194097 [details] [diff] [review] Patch v1 + if (color || 'null') The original point of this 'if' was to take out exactly the 'null' case. If you want it to work anyway, you should remove the 'if' entirely. I thought I put the 'if' in originally because getContrastingTextColor choked on 'null', but that seems to be working OK for me now. You might want to double-check this though.
Attachment #194097 -
Flags: first-review?(jminta) → first-review-
| Reporter | ||
Comment 3•19 years ago
|
||
Another attempt. I see no choke on 'null'.
Attachment #194097 -
Attachment is obsolete: true
Attachment #194100 -
Flags: first-review?(jminta)
Comment 4•19 years ago
|
||
Comment on attachment 194100 [details] [diff] [review] patch v2 r=jminta
Attachment #194100 -
Flags: first-review?(jminta) → first-review+
Comment 5•19 years ago
|
||
Patch checked in.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Comment 6•19 years ago
|
||
Are you sure getContrastingTextColor doesn't die on null? It might not die on 'null', but that's something different. That's a string. getContrastingTextColor does bgColor.replace(), and that dies if bgColor is null. (Also, again, how can a calendar have no color? The boxes always have some color)
Comment 7•19 years ago
|
||
(In reply to comment #6) > Are you sure getContrastingTextColor doesn't die on null? It might not die on > 'null', but that's something different. That's a string. getContrastingTextColor > does bgColor.replace(), and that dies if bgColor is null. I tested this by creating calendar with no color. This should set the pref to null (I think) and everything worked fine there. In short, I found no way for a user to perform and action that kills getContrastingTextColor. If you can find one, it's easy enough to fix with "if (!bgColor) return 'black';" > (Also, again, how can a calendar have no color? The boxes always have some color) The point is (especially if a different theme is being used), that style.backgroundColor shouldn't be required to be set. Setting white seems like they have no color, but 'transparent'/'none' should be an option, which right now it isn't.
Comment 8•19 years ago
|
||
OK, I did manage to finally kill getContrastingTextColor this morning. Status:Re-open
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 9•19 years ago
|
||
sigh...I knew there had to be a reason that 'if' was there.
Attachment #194186 -
Flags: first-review?(mvl)
Comment 10•19 years ago
|
||
Comment on attachment 194186 [details] [diff] [review] handle null bad idea
Attachment #194186 -
Attachment is obsolete: true
Attachment #194186 -
Flags: first-review?(mvl)
Comment 11•19 years ago
|
||
(Apologies for all this bugspam.) I only made getContrastingTextColor die this morning using my own custom colorpicker. Normal colorpickers assign "" if no color is chosen, which can be handled. Mine assigned null, which died. So, this bug is actually fixed.
Status: REOPENED → RESOLVED
Closed: 19 years ago → 19 years ago
Resolution: --- → FIXED
Comment 12•19 years ago
|
||
Comment on attachment 194100 [details] [diff] [review] patch v2 getCalendarPref can return null, so getContrastingTextColor can get called with null. Please back this patch out. It is wrong.
Attachment #194100 -
Flags: second-review-
You need to log in
before you can comment on or make changes to this bug.
Description
•