Closed Bug 732738 Opened 12 years ago Closed 12 years ago

textbox onfocus and onblur handlers execute twice

Categories

(Toolkit :: UI Widgets, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: neil, Assigned: neil)

References

Details

(Keywords: regression)

Attachments

(3 files)

Focus and blur events do not bubble, so XUL textboxes have historically had a workaround in that they used to inherit their onfocus and onblur event attributes on to the inner input element so that it would fire anyway. On the other hand error events weren't supposed to bubble but did for XUL elements before the great centralised event dispatch rewrite of bug 234455, thus this broke the tabbrowser binding which expected image error events to bubble up to the tab in which the image was an anonymous element. To fix this, bug 334216 made normally non-bubbling events dispatch to listeners on the binding parent chain. However this conflicts with the onfocus and onblur event attribute inheritance, which means those listeners now get invoked twice.
Attached file Test case (XUL)
Steps to reproduce problem:
1. Load the attached test case in Netscape 6/7, Mozilla 1.x, SeaMonkey 1.x, Firefox 1.x or Firefox 2.x
2. Focus and blur the textbox
3. Note that the counters increment once
4. Load the attached test case in SeaMonkey 2.x or Firefox 3 or later
5. Focus and blur the textbox
6. Note that the counters increment twice
Attached patch Proposed patchSplinter Review
Assignee: nobody → neil
Status: NEW → ASSIGNED
Attachment #602658 - Flags: review?(bugs)
Attached patch SeaMonkey patchSplinter Review
Attachment #602659 - Flags: review?(bugs)
Attachment #602658 - Flags: review?(bugs) → review+
Attachment #602659 - Flags: review?(bugs) → review+
Pushed changeset a64e9d89a279 to mozilla-central.
Pushed changeset 6a8d412018be to comm-central.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Pushed by frgrahl@gmx.net:
https://hg.mozilla.org/comm-central/rev/bf8a6c3f910f
textbox should only execute inline onfocus and onblur event handlers once r=smaug
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: