Bug 109261 - Events wrongly propagated over shadow boundaries when we set a relatedTarget in FocusEvent constructor
Summary: Events wrongly propagated over shadow boundaries when we set a relatedTarget ...
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kentaro Hara
URL:
Keywords:
Depends on: 109561
Blocks:
  Show dependency treegraph
 
Reported: 2013-02-07 22:20 PST by Kentaro Hara
Modified: 2013-02-12 20:28 PST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.