Spec: http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-FocusEvent-relatedTarget. IE9+ supports it. I think we should support these on focus/blur as well. See http://lists.w3.org/Archives/Public/www-dom/2012OctDec/0061.html for the www-dom discussion.
I think this should be easy to add. All the logic is already in Document::setFocusedNode. The only tricky thing is that we need to add a FocusEvent.idl and fire FocusEvents instead of generic Events since they now need a relatedTarget property. FWIW, this also matches the way the events are specced.
Created attachment 185329 [details] Patch Does this look reasonable? There's clearly work to be done (testing, more build systems, focus/blur events in addition to focusin/focusout), but does this look good otherwise?
*** This bug has been marked as a duplicate of bug 76216 ***