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

Unified Diff: Source/core/page/FocusController.cpp

Issue 205033004: Dispatch change and blur event for input type=text when window focus is changed (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed toHTML conversion and added setFocus(true) for focus Created 6 years, 9 months 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/forms/text/text-window-lost-focus-change-event-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/FocusController.cpp
diff --git a/Source/core/page/FocusController.cpp b/Source/core/page/FocusController.cpp
index 8c0002e58fee5754ad3ce1e2135aa09b61563354..fd00e8fce7d0066872e9b96b6c3547f53dae39af 100644
--- a/Source/core/page/FocusController.cpp
+++ b/Source/core/page/FocusController.cpp
@@ -144,6 +144,7 @@ static inline void dispatchEventsOnWindowAndFocusedNode(Document* document, bool
if (!focused && document->focusedElement()) {
RefPtr<Element> focusedElement(document->focusedElement());
+ focusedElement->setFocus(false);
focusedElement->dispatchBlurEvent(0);
if (focusedElement == document->focusedElement()) {
focusedElement->dispatchFocusOutEvent(EventTypeNames::focusout, 0);
@@ -156,6 +157,7 @@ static inline void dispatchEventsOnWindowAndFocusedNode(Document* document, bool
window->dispatchEvent(Event::create(focused ? EventTypeNames::focus : EventTypeNames::blur));
if (focused && document->focusedElement()) {
RefPtr<Element> focusedElement(document->focusedElement());
+ focusedElement->setFocus(true);
focusedElement->dispatchFocusEvent(0, FocusTypePage);
if (focusedElement == document->focusedElement()) {
document->focusedElement()->dispatchFocusInEvent(EventTypeNames::focusin, 0);
« no previous file with comments | « LayoutTests/fast/forms/text/text-window-lost-focus-change-event-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698