Chromium Code Reviews| Index: Source/core/html/HTMLDialogElement.cpp |
| diff --git a/Source/core/html/HTMLDialogElement.cpp b/Source/core/html/HTMLDialogElement.cpp |
| index b264572319d7a1f09e51040bdb1d235e4718543a..58c0bf4c82afca1e70f90b6227bca9db5e1e14af 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->updateCacheAfterInertSubtreesChanged(); |
| +} |
| + |
| 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()); |
|
dmazzoni
2013/11/07 16:35:59
Might be nice to do this at the end - after settin
falken
2013/11/07 23:54:58
Yeah I actually had tried that but somehow the AX
|
| setBooleanAttribute(openAttr, true); |
| runAutofocus(this); |