Closed Bug 354065 Opened 20 years ago Closed 20 years ago

Colorpicker button should evaluate 'color' attribute on construction

Categories

(Toolkit :: UI Widgets, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: mnyromyr, Assigned: neil)

References

Details

Attachments

(2 files)

When you create a colorpicker button dynamically and set the 'color' attribute, it gets ignored. Only setting the color property after appending the colorpicker button to the document works. Current behaviour: Setting attribute before appending: doesn't work Setting attribute after appending: doesn't work Setting property before appending: doesn't work Setting property after appending: works Expected behaviour: All four methods should work. (See also attached testcase.) The same problem exists for XPFE's colorpicker.
Attached file Testcase —
(In reply to comment #0) >All four methods should work. Well, a) should work, b) may work, c) can't work, d) always works
Attached patch Proposed patch — — Splinter Review
Much to my surprise, this does fix case c) - any idea why?
Assignee: nobody → neil
Status: NEW → ASSIGNED
Attachment #240378 - Flags: first-review?(enndeakin)
(In reply to comment #3) > Created an attachment (id=240378) [edit] > Proposed patch > > Much to my surprise, this does fix case c) - any idea why? > Because the following code adds a 'color' property on the element, although not the one through XBL which hasn't been attached yet. When appending, the XBL constructor is called which reads this property instead. if (asAttribute) cp.setAttribute('color', color); else cp.color = color; document.getElementById('content').appendChild(cp);
Comment on attachment 240378 [details] [diff] [review] Proposed patch But the patch is still good for fixing case A though
Attachment #240378 - Flags: first-review?(enndeakin) → first-review+
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: