Index: third_party/WebKit/Source/core/page/FocusController.cpp |
diff --git a/third_party/WebKit/Source/core/page/FocusController.cpp b/third_party/WebKit/Source/core/page/FocusController.cpp |
index dcf0fbf94dfce46b854462bbdbbd8a16d6e0b1ff..8a535acb84055b56fb776688383a7d8cbb734b38 100644 |
--- a/third_party/WebKit/Source/core/page/FocusController.cpp |
+++ b/third_party/WebKit/Source/core/page/FocusController.cpp |
@@ -372,6 +372,7 @@ inline void DispatchEventsOnWindowAndFocusedElement(Document* document, |
Element* focused_element = document->FocusedElement(); |
// Use focus_type kWebFocusTypePage, same as used in DispatchBlurEvent. |
focused_element->SetFocused(false, kWebFocusTypePage); |
+ focused_element->SetHasFocusWithinUpToAncestor(false, nullptr); |
DispatchBlurEvent(*document, *focused_element); |
} |
@@ -382,6 +383,7 @@ inline void DispatchEventsOnWindowAndFocusedElement(Document* document, |
Element* focused_element(document->FocusedElement()); |
// Use focus_type kWebFocusTypePage, same as used in DispatchFocusEvent. |
focused_element->SetFocused(true, kWebFocusTypePage); |
+ focused_element->SetHasFocusWithinUpToAncestor(true, nullptr); |
DispatchFocusEvent(*document, *focused_element); |
} |
} |