[webkit-dev] focusin/focusout events

Ojan Vafai ojan at chromium.org
Thu Jul 29 16:29:28 PDT 2010


On Tue, Jul 27, 2010 at 10:37 AM, Darin Adler <darin at apple.com> wrote:

>  This sequence doesn’t sound too terrible to me. But I don’t fully
>> understand the proposal. At the time the focusin event fires we won’t yet
>> know what item is getting focus?
>>
>
> I think we do know this and it wouldn't be too hard to implement. It's just
> a question of what we think the best behavior is. Specifically,
> in Document::setFocusedNode, we know both the new focused node and the old
> focused node when firing these events.
>
> The “we” I meant is the JavaScript code on the webpage.
>

I see. I hadn't thought about this part. As per the current state of the DOM
3 spec for the target/relatedTarget event object:
  target relatedTarget blur/DOMFocusOut element losing focus element losing
focus focus/DOMFocusIn element receiving focus element receiving focus
focusin element receiving focus element losing focus focusout element losing
focus element receiving focus
The spec looks reasonable to me and I think we could implement it without
worry about web compatibility since we would only be modifying the
focusin/focusout events, which we just added recently. The only thing I'd
like to change in the spec is that focusin/focusout are not cancelable, but
that's a whole separate issue and something that should be addressed on
www-dom first.

Anyone object to that? Specifically, the proposal is to change our event
order to match the spec:
http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-focusevent-event-orderand
to change the focusin/focusout events to have target/relatedTarget
values as above.

Ojan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20100729/b1810e2a/attachment.html>


More information about the webkit-dev mailing list