Closed
Bug 131651
Opened 24 years ago
Closed 24 years ago
Popup window is blurred on open if opened from a mousedown handler for a link
Categories
(Core :: DOM: UI Events & Focus Handling, defect)
Tracking
()
RESOLVED
FIXED
mozilla1.0.1
People
(Reporter: bryner, Assigned: bryner)
References
()
Details
(Keywords: regression, topembed+, Whiteboard: [need info])
Attachments
(1 file, 1 obsolete file)
|
3.76 KB,
patch
|
bryner
:
review+
hewitt
:
superreview+
|
Details | Diff | Splinter Review |
Spun off from bug 120209, as I believe this is a different issue and looks like
it's cross-platform.
If you have an anchor element with a mousedown handler which opens and focuses a
popup window, that popup window will receive a blur as soon as it is opened.
The reason for this is that we fire the script event handler first, then we
focus the link in our mousedown handling (see
nsGenericHTMLElement::HandleDOMEventForAnchors), which refocuses the parent
window. This can cause the popup window to close immediately if it has an
onblur handler that closes the window.
Comment 1•24 years ago
|
||
I tried the obvious approach of checking if the window was active before
focusing from nsGenericHTMLElement::HandleDOMEventForAnchors but that didn't
work. At the time the check was made via asking the focus controller if it was
active, the controller still thought it was since we didn't yet get back to the
OS event to deactivate it.
So we raced the pop up window's deactivate, and we beat it *but* the global
gLastFocusedDocument was correctly set to the new window... so we sent it a blur
from SendFocusBlur.
It looks like the focus globals are out of synch with the focus controller, and
this case gets in the gap.
Comment 2•24 years ago
|
||
This fixes it. The part in nsGenericHTMLElement is right, but the part in
nsEventStateManager is to deal with this issue of the globals and focus
controllers getting out of synch until other events in the event queue are
dealt with. It is an interesting case that I handn't really considered before.
This probably needs some thought about possible places where keeping these in
synch would cause problems. Keeping them in synch also feels like a hack, and
I'd like to get rid of the globals entirely, but the focus controllers don't
have the right semantics to take over the globals' functionality right now
(probably ever), so I'm guessing the right thing will have to wait for post
1.0.
Comment 3•24 years ago
|
||
taking on for mozilla 1.0 as I have a patch and it exposes a problem that could
be causing other focus issues.
Assignee: joki → saari
OS: Linux → All
Target Milestone: --- → mozilla1.0
Updated•24 years ago
|
Comment 4•24 years ago
|
||
embed triage: topembed+, very visible defect
Updated•24 years ago
|
QA Contact: madhur → rakeshmishra
Comment 5•24 years ago
|
||
-> bryner. Is there any chance you can run with Saari's patch here?
Assignee: saari → bryner
Status: ASSIGNED → NEW
Comment 6•24 years ago
|
||
Does this occur on any top sites?
Updated•24 years ago
|
Whiteboard: [need info]
| Assignee | ||
Comment 7•24 years ago
|
||
Yeah, I'll give saari's patch some testing (I've been meaning to do this,
haven't gotten around to it).
Status: NEW → ASSIGNED
Comment 8•24 years ago
|
||
Navtriage still has no feel for the impact of this bug. Is Parker a top site?
| Assignee | ||
Updated•24 years ago
|
Target Milestone: mozilla1.0 → mozilla1.0.1
| Assignee | ||
Comment 10•24 years ago
|
||
Comment on attachment 75145 [details] [diff] [review]
Patch that fixes this. Mildly scary part in nsEventStateManager.
r=bryner. This all seems correct to me, and I couldn't find any regressions
running with this patch.
Attachment #75145 -
Flags: review+
| Assignee | ||
Comment 11•24 years ago
|
||
Comment on attachment 75145 [details] [diff] [review]
Patch that fixes this. Mildly scary part in nsEventStateManager.
sigh, ok. The mildly scary part in EventStateManager has become more scary.
This patch causes a regression where if I activate a window right as a new page
is loading, focus will get wacked and you won't be able to focus anything until
you deactivate and reactivate the window. This is on Linux.
Attachment #75145 -
Flags: review+ → needs-work+
| Assignee | ||
Comment 12•24 years ago
|
||
So, in the case that was causing this regression, nextController was null. I
added a check for this so that we don't deactivate the previous controller in
this situation.
Chris, I'm not sure which platform you were testing on where the globals were
out of sync; can you retest and make sure this doesn't cause your fix not to
work correctly?
Attachment #75145 -
Attachment is obsolete: true
| Assignee | ||
Updated•24 years ago
|
Attachment #86986 -
Flags: review+
| Assignee | ||
Comment 13•24 years ago
|
||
Comment on attachment 86986 [details] [diff] [review]
more spackle
r=saari from bryner's machine
Comment 14•24 years ago
|
||
Comment on attachment 86986 [details] [diff] [review]
more spackle
sr=hewitt
Attachment #86986 -
Flags: superreview+
| Assignee | ||
Comment 15•24 years ago
|
||
Checked in on the trunk. Will let this bake for a couple of days before
checking in on the branch.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Comment 16•24 years ago
|
||
Causing topcrash in the yesterday's Trunk builds. Look at the topcrash bug 151568.
| Assignee | ||
Comment 17•24 years ago
|
||
Nominating for branch approval.
Status: REOPENED → RESOLVED
Closed: 24 years ago → 24 years ago
Keywords: adt1.0.1,
mozilla1.0.1
Resolution: --- → FIXED
Comment 18•24 years ago
|
||
namachi - are you saying this resolved a topcrash, or caused one? the bug you
refer to seems to be resolved fixed.
Kevin - you marked this one as a very visible defect. is this because the URl
referenced is a top site, or that this defect is seen quite often out in the wild?
Comment 19•24 years ago
|
||
I don't think this is seen often on real sites. The original bug that this was
spawned from bug 120209 was causing problems on a number of sites and is now
fixed I'm not sure if the fix needs to go on the branch.
Comment 20•24 years ago
|
||
Adding adt1.0.1- based on comment 19.
Updated•23 years ago
|
QA Contact: rakeshmishra → trix
Comment 21•22 years ago
|
||
This caused bug 227741, looks like...
Updated•7 years ago
|
Component: Event Handling → User events and focus handling
You need to log in
before you can comment on or make changes to this bug.
Description
•