Chromium Code Reviews| Index: Source/core/page/FocusController.cpp |
| diff --git a/Source/core/page/FocusController.cpp b/Source/core/page/FocusController.cpp |
| index 8c0002e58fee5754ad3ce1e2135aa09b61563354..17a3fecab16cc261c4d2f5e624aba55c99ca4e22 100644 |
| --- a/Source/core/page/FocusController.cpp |
| +++ b/Source/core/page/FocusController.cpp |
| @@ -46,6 +46,7 @@ |
| #include "core/frame/LocalFrame.h" |
| #include "core/html/HTMLAreaElement.h" |
| #include "core/html/HTMLImageElement.h" |
| +#include "core/html/HTMLInputElement.h" |
|
tkent
2014/03/27 00:46:04
I don't think adding dependency to a specific elem
|
| #include "core/html/HTMLPlugInElement.h" |
| #include "core/html/HTMLShadowElement.h" |
| #include "core/page/Chrome.h" |
| @@ -144,7 +145,15 @@ static inline void dispatchEventsOnWindowAndFocusedNode(Document* document, bool |
| if (!focused && document->focusedElement()) { |
| RefPtr<Element> focusedElement(document->focusedElement()); |
| - focusedElement->dispatchBlurEvent(0); |
| + if (focusedElement && focusedElement->isHTMLElement()) { |
| + HTMLElement* element = toHTMLElement(focusedElement); |
| + if (element && element->isFormControlElement()) { |
| + if (toHTMLFormControlElement(element)->wasChangedSinceLastFormControlChangeEvent()) |
| + toHTMLFormControlElement(element)->dispatchFormControlChangeEvent(); |
| + } |
| + } |
| + if (focusedElement == document->focusedElement()) |
| + focusedElement->dispatchBlurEvent(0); |
| if (focusedElement == document->focusedElement()) { |
| focusedElement->dispatchFocusOutEvent(EventTypeNames::focusout, 0); |
| if (focusedElement == document->focusedElement()) |