Index: third_party/WebKit/Source/core/html/HTMLDialogElement.cpp |
diff --git a/third_party/WebKit/Source/core/html/HTMLDialogElement.cpp b/third_party/WebKit/Source/core/html/HTMLDialogElement.cpp |
index aa1769ab31fa58c023e562c29bc4dce9aeb2d891..f878b1ce8b2e0b2f483cbbc4953c3a8715890350 100644 |
--- a/third_party/WebKit/Source/core/html/HTMLDialogElement.cpp |
+++ b/third_party/WebKit/Source/core/html/HTMLDialogElement.cpp |
@@ -34,6 +34,7 @@ |
#include "core/frame/LocalFrameView.h" |
#include "core/frame/UseCounter.h" |
#include "core/html/HTMLFormControlElement.h" |
+#include "core/html/HTMLFrameOwnerElement.h" |
#include "core/style/ComputedStyle.h" |
namespace blink { |
@@ -82,6 +83,13 @@ static void SetFocusForDialog(HTMLDialogElement* dialog) { |
} |
static void InertSubtreesChanged(Document& document) { |
+ if (document.GetFrame()) { |
+ // SetIsInert recurses through subframes to propagate the inert bit as |
+ // needed. |
+ document.GetFrame()->SetIsInert(document.LocalOwner() && |
+ document.LocalOwner()->IsInert()); |
+ } |
+ |
// When a modal dialog opens or closes, nodes all over the accessibility |
// tree can change inertness which means they must be added or removed from |
// the tree. The most foolproof way is to clear the entire tree and rebuild |
@@ -189,7 +197,7 @@ void HTMLDialogElement::showModal(ExceptionState& exception_state) { |
void HTMLDialogElement::RemovedFrom(ContainerNode* insertion_point) { |
HTMLElement::RemovedFrom(insertion_point); |
SetNotCentered(); |
- // FIXME: We should call inertSubtreesChanged() here. |
+ InertSubtreesChanged(GetDocument()); |
} |
void HTMLDialogElement::SetCentered(LayoutUnit centered_position) { |