Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1012)

Unified Diff: Source/core/html/HTMLDialogElement.cpp

Issue 53423003: WIP: Update AXObjects when a modal dialog is opened/closed (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: update tree Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/accessibility/AXObjectCache.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
setBooleanAttribute(openAttr, true);
runAutofocus(this);
« no previous file with comments | « Source/core/accessibility/AXObjectCache.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698