Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(834)

Unified Diff: WebCore/page/FocusController.cpp

Issue 427011: Revert WebKit 48257 on the 249 branch.... (Closed) Base URL: svn://chrome-svn/chrome/branches/WebKit/249/
Patch Set: Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/events/tabindex-focus-blur-all-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « LayoutTests/fast/events/tabindex-focus-blur-all-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698