Index: Source/core/html/HTMLDialogElement.cpp |
diff --git a/Source/core/html/HTMLDialogElement.cpp b/Source/core/html/HTMLDialogElement.cpp |
index b264572319d7a1f09e51040bdb1d235e4718543a..f93b4129afb7485f13ec29fd4f495f2493200f00 100644 |
--- a/Source/core/html/HTMLDialogElement.cpp |
+++ b/Source/core/html/HTMLDialogElement.cpp |
@@ -27,6 +27,7 @@ |
#include "core/html/HTMLDialogElement.h" |
#include "bindings/v8/ExceptionState.h" |
+#include "core/accessibility/AXObjectCache.h" |
#include "core/dom/ExceptionCode.h" |
#include "core/dom/NodeTraversal.h" |
#include "core/html/HTMLFormControlElement.h" |
@@ -57,6 +58,12 @@ static void runAutofocus(HTMLDialogElement* dialog) |
} |
} |
+static void inertSubtreesChanged(Document& document) |
+{ |
+ if (AXObjectCache* cache = document.existingAXObjectCache()) |
+ cache->handleInertSubtreesChanged(); |
+} |
+ |
HTMLDialogElement::HTMLDialogElement(const QualifiedName& tagName, Document& document) |
: HTMLElement(tagName, document) |
, m_centeringMode(Uninitialized) |
@@ -86,7 +93,11 @@ void HTMLDialogElement::closeDialog(const String& returnValue) |
if (!fastHasAttribute(openAttr)) |
return; |
setBooleanAttribute(openAttr, false); |
+ |
+ HTMLDialogElement* activeModalDialog = document().activeModalDialog(); |
document().removeFromTopLayer(this); |
+ if (activeModalDialog == this) |
+ inertSubtreesChanged(document()); |
if (!returnValue.isNull()) |
m_returnValue = returnValue; |
@@ -117,6 +128,7 @@ void HTMLDialogElement::showModal(ExceptionState& es) |
return; |
} |
document().addToTopLayer(this); |
+ inertSubtreesChanged(document()); |
setBooleanAttribute(openAttr, true); |
runAutofocus(this); |