Closed
Bug 238987
Opened 20 years ago
Closed 17 years ago
Focus and blur events bubble from some form input controls
Categories
(Core :: DOM: Events, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: bugzilla, Assigned: smaug)
References
Details
Attachments
(3 files, 1 obsolete file)
4.32 KB,
text/html
|
Details | |
4.35 KB,
text/html
|
Details | |
9.37 KB,
patch
|
bzbarsky
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
When a <select> or input type="reset" receive a focus or blur event, such events bubble when the specs clearly indicate they should not. MSIE 6 and Opera 7.5 do not do that. This bugfile spins off from bug 230356. Bug 190557 refers to the same issue but for checkbox. Cross-browser testcase coming.
Reporter | ||
Comment 1•20 years ago
|
||
Comment 2•20 years ago
|
||
I believe we do this on purpose and I know we have code that relies on these events bubbling.... in fact, the fact that they don't bubble from text inputs leads to focus event bugs with <input type="file">
Comment 3•19 years ago
|
||
Note that the resolution of this somewhat depends on what we decide to do with text controls (and that depends on the file input stuff in bug 4033).
Depends on: 4033
Assignee | ||
Comment 4•17 years ago
|
||
focus doesn't work on type="input" when clicking inputfield. It does work when clicking the button. Though, the inputfield bug has nothing to do with this bug and it doesn't work in 1.8 either.
Assignee: events → Olli.Pettay
Status: NEW → ASSIGNED
Assignee | ||
Comment 5•17 years ago
|
||
Because of bug 334216, non-bubbling events get handled at target also when dispatched somewhere in anonymous content, so type="file" works.
Attachment #270566 -
Flags: superreview?(bzbarsky)
Attachment #270566 -
Flags: review?(bzbarsky)
Assignee | ||
Updated•17 years ago
|
Attachment #270563 -
Attachment description: testcase with type="input" → testcase with type="file"
Assignee | ||
Comment 6•17 years ago
|
||
There is no need to call stopPropagation in editor code, if focus and blur events don't bubble. Listener is added there for bubble phase.
Attachment #270566 -
Attachment is obsolete: true
Attachment #270573 -
Flags: superreview?(bzbarsky)
Attachment #270573 -
Flags: review?(bzbarsky)
Attachment #270566 -
Flags: superreview?(bzbarsky)
Attachment #270566 -
Flags: review?(bzbarsky)
Comment 7•17 years ago
|
||
Comment on attachment 270573 [details] [diff] [review] Fixes also textfield in the file control This looks OK, I guess, but I wonder whether it'd make sense to move the bubble-prevention into the nsEvent constructor (basically use the message to index into something which would say whether the event bubbles). I'd really prefer a single data table somewhere to sprinkling this throught the code... Followup bug on that perhaps? r+sr=bzbarsky assuming you've tested accesskeys and such and will also check in tests for this.
Attachment #270573 -
Flags: superreview?(bzbarsky)
Attachment #270573 -
Flags: superreview+
Attachment #270573 -
Flags: review?(bzbarsky)
Attachment #270573 -
Flags: review+
Assignee | ||
Comment 8•17 years ago
|
||
(In reply to comment #7) > but I wonder whether it'd make sense to move the > bubble-prevention into the nsEvent constructor (basically use the message to > index into something which would say whether the event bubbles). yup, I was thinking that too. I'll post a followup (with a patch for focus, blur, error, load, unload, scroll, SVGLoad, SVGUnload). Everything in nsEvent is inline, I wonder how the change will affect codesize. Maybe the constructor should call something non-inline.
Comment 9•17 years ago
|
||
You could compile and strip to see how codesize is affected. ;) I do think that if it's just an index into a table to set default flags (as opposed to an if cascade or something) it shouldn't be that big.
Assignee | ||
Updated•17 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Whiteboard: Bug 238987 – Focus and blur events bubble from some form input controls
Updated•17 years ago
|
Flags: in-testsuite+
Updated•17 years ago
|
Assignee | ||
Updated•17 years ago
|
Whiteboard: Bug 238987 – Focus and blur events bubble from some form input controls
You need to log in
before you can comment on or make changes to this bug.
Description
•