[webkit-reviews] review granted: [Bug 61421] Handle focus event in shadow content. : [Attachment 104166] patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Aug 17 08:31:42 PDT 2011


Dimitri Glazkov (Google) <dglazkov at chromium.org> has granted Hayato Ito
<hayato at chromium.org>'s request for review:
Bug 61421: Handle focus event in shadow content.
https://bugs.webkit.org/show_bug.cgi?id=61421

Attachment 104166: patch
https://bugs.webkit.org/attachment.cgi?id=104166&action=review

------- Additional Comments from Dimitri Glazkov (Google)
<dglazkov at chromium.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=104166&action=review


> Source/WebCore/dom/Event.cpp:343
> +PassRefPtr<FocusEventDispatchMediator>
FocusEventDispatchMediator::create(PassRefPtr<Node> oldFocusedNode)
> +{
> +    return adoptRef(new FocusEventDispatchMediator(oldFocusedNode));
> +}
> +
> +FocusEventDispatchMediator::FocusEventDispatchMediator(PassRefPtr<Node>
oldFocusedNode)
> +    : EventDispatchMediator(Event::create(eventNames().focusEvent, false,
false))
> +    , m_oldFocusedNode(oldFocusedNode)
> +{
> +}
> +
> +bool FocusEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher)
const
> +{
> +    dispatcher->adjustRelatedTarget(event(), m_oldFocusedNode);
> +    return EventDispatchMediator::dispatchEvent(dispatcher);
> +}
> +
> +PassRefPtr<BlurEventDispatchMediator>
BlurEventDispatchMediator::create(PassRefPtr<Node> newFocusedNode)
> +{
> +    return adoptRef(new BlurEventDispatchMediator(newFocusedNode));
> +}
> +
> +BlurEventDispatchMediator::BlurEventDispatchMediator(PassRefPtr<Node>
newFocusedNode)
> +    : EventDispatchMediator(Event::create(eventNames().blurEvent, false,
false))
> +    , m_newFocusedNode(newFocusedNode)
> +{
> +}
> +
> +bool BlurEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher)
const
> +{
> +    dispatcher->adjustRelatedTarget(event(), m_newFocusedNode);
> +    return EventDispatchMediator::dispatchEvent(dispatcher);
> +}

These should be in UIEvent, right?

> Source/WebCore/page/FocusController.cpp:80
> +	   document->focusedNode()->dispatchBlurEvent(0);

Ah. This is a nice improvement over my old patch! :)


More information about the webkit-reviews mailing list