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

Unified Diff: third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp

Issue 2666873005: Implement aria-modal (Closed)
Patch Set: Created 3 years, 11 months 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
Index: third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
diff --git a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
index eb78cb10a5099650fd185e81be9c8c5553912d57..0aef97762c39958dba8bec31e74e345339f66cbf 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
@@ -1152,6 +1152,24 @@ AccessibilityExpanded AXNodeObject::isExpanded() const {
return ExpandedUndefined;
}
+bool AXNodeObject::isModal() const {
+ if (roleValue() != DialogRole && roleValue() != AlertDialogRole)
+ return false;
+
+ if (hasAttribute(aria_modalAttr)) {
+ const AtomicString& modal = getAttribute(aria_modalAttr);
+ if (equalIgnoringCase(modal, "true"))
+ return true;
+ if (equalIgnoringCase(modal, "false"))
+ return false;
+ }
+
+ if (getNode() && isHTMLDialogElement(*getNode()))
+ return toElement(getNode())->isInTopLayer();
+
+ return false;
+}
+
bool AXNodeObject::isPressed() const {
if (!isButton())
return false;

Powered by Google App Engine
This is Rietveld 408576698