Bug 109261

Summary: Events wrongly propagated over shadow boundaries when we set a relatedTarget in FocusEvent constructor
Product: WebKit Reporter: Kentaro Hara <haraken>
Component: DOMAssignee: Kentaro Hara <haraken>
Status: RESOLVED INVALID    
Severity: Normal CC: dglazkov, hayato, ojan, webcomponents-bugzilla
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 109561    
Bug Blocks:    

Description Kentaro Hara 2013-02-07 22:20:24 PST
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.
Comment 1 Hayato Ito 2013-02-12 20:28:17 PST
Marking INVALID since I cannot reproduce the issue.
See bug 109650.