| Index: WebCore/page/FocusController.cpp
|
| ===================================================================
|
| --- WebCore/page/FocusController.cpp (revision 32733)
|
| +++ WebCore/page/FocusController.cpp (working copy)
|
| @@ -56,18 +56,6 @@
|
|
|
| using namespace HTMLNames;
|
|
|
| -static inline void dispatchEventsOnWindowAndFocusedNode(Document* document, bool focused)
|
| -{
|
| - // If we have a focused node we should dispatch blur on it before we blur the window.
|
| - // If we have a focused node we should dispatch focus on it after we focus the window.
|
| - // https://bugs.webkit.org/show_bug.cgi?id=27105
|
| - if (!focused && document->focusedNode())
|
| - document->focusedNode()->dispatchBlurEvent();
|
| - document->dispatchWindowEvent(Event::create(focused ? eventNames().focusEvent : eventNames().blurEvent, false, false));
|
| - if (focused && document->focusedNode())
|
| - document->focusedNode()->dispatchFocusEvent();
|
| -}
|
| -
|
| FocusController::FocusController(Page* page)
|
| : m_page(page)
|
| , m_isActive(false)
|
| @@ -113,7 +101,7 @@
|
|
|
| if (m_focusedFrame && m_focusedFrame->view()) {
|
| m_focusedFrame->selection()->setFocused(focused);
|
| - dispatchEventsOnWindowAndFocusedNode(m_focusedFrame->document(), focused);
|
| + m_focusedFrame->document()->dispatchWindowEvent(focused ? eventNames().focusEvent : eventNames().blurEvent, false, false);
|
| }
|
| }
|
|
|
| @@ -356,7 +344,7 @@
|
| focusedOrMainFrame()->selection()->pageActivationChanged();
|
|
|
| if (m_focusedFrame && isFocused())
|
| - dispatchEventsOnWindowAndFocusedNode(m_focusedFrame->document(), active);
|
| + m_focusedFrame->document()->dispatchWindowEvent(active ? eventNames().focusEvent : eventNames().blurEvent, false, false);
|
| }
|
|
|
| } // namespace WebCore
|
|
|