Closed
Bug 354089
Opened 19 years ago
Closed 19 years ago
onfocus="alert(); this.blur();" causes infinite alerts
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
People
(Reporter: roc, Assigned: roc)
References
Details
Attachments
(2 files)
|
71 bytes,
text/html
|
Details | |
|
1.41 KB,
patch
|
MatsPalmgren_bugz
:
review+
MatsPalmgren_bugz
:
superreview+
|
Details | Diff | Splinter Review |
Calling "blur" after "alert" doesn't work; we actually refocus the element. See attached testcase and patch.
| Assignee | ||
Comment 1•19 years ago
|
||
Clicking in the input should pop up one alert and not give it focus. Instead it keeps popping up alerts ad infinitum.
What happens is that the blur() doesn't update the focus controller, so the focus controller still thinks that the element is focused. Then tearing down the alert()'s window sends a platform window activate event to the document window, and the ESM asks the focus controller which element should be focused, which returns the input, and the ESM focuses it.
| Assignee | ||
Comment 2•19 years ago
|
||
This fixes it by always calling EnsureFocusSynchronization in nsEventStateManager::SendFocusBlur after we've determined what will really be focused. In this case the focus controller is informed there is nothing to focus.
Attachment #239971 -
Flags: superreview?(mats.palmgren)
Attachment #239971 -
Flags: review?(mats.palmgren)
Comment 3•19 years ago
|
||
| Assignee | ||
Comment 4•19 years ago
|
||
Not really, no.
IMHO they should all be fixed by reimplementing JS alerts to make them modal only to the nearest chrome ancestor (i.e., tab).
Comment 5•19 years ago
|
||
Comment on attachment 239971 [details] [diff] [review]
fix
Seems reasonable. r+sr=mats
Attachment #239971 -
Flags: superreview?(mats.palmgren)
Attachment #239971 -
Flags: superreview+
Attachment #239971 -
Flags: review?(mats.palmgren)
Attachment #239971 -
Flags: review+
| Assignee | ||
Comment 6•19 years ago
|
||
checked in
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•