RESOLVED DUPLICATE of bug 110172 Bug 33512
blur event not fired on <input> when programmatically focusing on an <input> within an <iframe> then focusing the window
https://bugs.webkit.org/show_bug.cgi?id=33512
Summary blur event not fired on <input> when programmatically focusing on an <input> ...
Daniel Bates
Reported 2010-01-11 21:28:56 PST
The blur event is not fired on an <input> within an <iframe> when the input loses focus by programmatically focusing the window. In particular, suppose there is an <input> within an <iframe> and perform the following actions programmatically (in order): 1) Call focus() on <input>. 2) Call focus() on the current window. Then the following sequence of events are fired, where an event := (event target element, event type): (window, blur), (<iframe>, focus), (<input>, focus), (<iframe>, blur), (window, focus). Notice, the event (<input>, blur) is missing from this sequence. The expected result is: window, blur), (<iframe>, focus), (<input>, focus), (<input>, blur), (<iframe>, blur), (window, focus). By the unfocusing steps listed in section 6.4.2 of the HTML 5 spec. <http://dev.w3.org/html5/spec/Overview.html#focus-management>, we should fire a blur event at <input>.
Attachments
Layout test (5.21 KB, patch)
2010-01-11 21:32 PST, Daniel Bates
no flags
Self-contained test (3.86 KB, text/html)
2010-01-11 21:37 PST, Daniel Bates
no flags
Patch with test case (17.89 KB, patch)
2010-08-02 23:38 PDT, Daniel Bates
no flags
Daniel Bates
Comment 1 2010-01-11 21:32:19 PST
Created attachment 46332 [details] Layout test Note, you can use the test case <https://bugs.webkit.org/attachment.cgi?id=12423> on bug #12262 to verify that the non-programmatic case works.
Daniel Bates
Comment 2 2010-01-11 21:37:18 PST
Created attachment 46333 [details] Self-contained test For your convenience, here is a self-contained version of the layout test.
Daniel Bates
Comment 3 2010-08-02 23:38:41 PDT
Created attachment 63303 [details] Patch with test case
Joseph Pecoraro
Comment 4 2010-08-26 16:20:07 PDT
Hey Dan. Any reason this patch is not up for review? Did you find a problem in it?
Daniel Bates
Comment 5 2010-08-27 09:49:47 PDT
(In reply to comment #4) > Hey Dan. Any reason this patch is not up for review? Did you find a problem in it? I have not put this up for review as I am still investigating this issue. I've had intermittent discussions with Ian Hicksons about this change. Part of these discussions are with respect to the behavior of window.focus() and window.blur(). Section 7.4.3 of the HTML 5 spec. (which describes these methods) is not explicit with regards to whether these methods result in the execution of the focusing and unfocusing steps outlined in section 7.4.2 (or some similar algorithm), respectively. Further reading of the spec., and possible discussions are needed. I hope to look at this some more this weekend.
Andy Estes
Comment 6 2013-02-18 22:46:24 PST
Apologies for the forward dup, but I ran into this issue independently and filed it as <https://bugs.webkit.org/show_bug.cgi?id=110172>. I verified that my change fixes the test attached here (as well as another issue having to do with document.activeElement). *** This bug has been marked as a duplicate of bug 110172 ***
Note You need to log in before you can comment on or make changes to this bug.