[Webkit-unassigned] [Bug 31692] window.onblur() calling window.focus leaves focus in 2 places

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jan 19 17:53:42 PST 2010


--- Comment #4 from Victor Wang <victorw at chromium.org>  2010-01-19 17:53:42 PST ---
Hi Darin,

Good point.

This patch only affects focusing when switching focused frame, so I tested
calling iframe window focus from window.onfocus. Because of the new flag,
setFocusedFrame returns when FocusController is in the middle of changing
focused frame, therefore, in this case with the patch, the iframe window focus
request is ignored.

The code prior the patch calls dispatchWindowEvent(win1.focusEvent) inside
another dispatchWindowEvent(win2.focusEvent), the focus event is dispatched at
almost the last step of setFocusedFrame, so it changes the focus back to
iframe. In this case, webkit changes focus to one frame when it is in the
middle of setting focus to another one, I might miss something even though the
FocusController status looks fine to me.

I test this on IE and Firefox:
IE looks like ignore the iframe window focus call and behaves the same as
webkit with my patch.
FireFox messes up the focus status and leaves two fields both focused.

Personally I think we should add this flag so changing focused frame request is
ignored if FocusController is middle of processing another request. Same for
onblur calling focus and onfocus calling focus. What do you think?

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list