Currently we're creating a FocusEvent in Node.cpp in this way: RefPtr<FocusEvent> event = FocusEvent::create(eventNames().focusEvent, false, false, document()->defaultView(), 0, 0); EventDispatcher::dispatchEvent(this, FocusEventDispatchMediator::create(event.release(), oldFocusedNode)); Ideally we should create a FocusEvent in this way: RefPtr<FocusEvent> event = FocusEvent::create(eventNames().focusEvent, false, false, document()->defaultView(), 0, oldFocusedNode); EventDispatcher::dispatchEvent(this, FocusEventDispatchMediator::create(event.release())); However, if we do so, fast/dom/shadow/shadow-boundary-events.html fails. It looks like that FocusEvent.relatedTarget has to be set not in the FocusEvent constructor but in EventContext::handleLocalEvents(). The same issue exists in BlurEvent, FocusInEvent and FocusOutEvent. We should fix them.
Marking INVALID since I cannot reproduce the issue. See bug 109650.