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

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

Issue 2088453002: Implement the inert attribute (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update generic test expectations Created 3 years, 7 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/AXMenuListOption.cpp
diff --git a/third_party/WebKit/Source/modules/accessibility/AXMenuListOption.cpp b/third_party/WebKit/Source/modules/accessibility/AXMenuListOption.cpp
index 9676ad9ddce2b7ee4894c6e2e4d40f6a32c96037..8b236d6e79f76916765b029c0c58fa3536aa20f8 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXMenuListOption.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXMenuListOption.cpp
@@ -27,6 +27,7 @@
#include "SkMatrix44.h"
#include "core/dom/AccessibleNode.h"
+#include "core/html/HTMLSelectElement.h"
#include "modules/accessibility/AXMenuListPopup.h"
#include "modules/accessibility/AXObjectCacheImpl.h"
@@ -63,6 +64,26 @@ Element* AXMenuListOption::ActionElement() const {
return element_;
}
+AXObject* AXMenuListOption::ComputeParent() const {
+ Node* node = GetNode();
+ if (!node)
+ return nullptr;
+ HTMLSelectElement* select = toHTMLOptionElement(node)->OwnerSelectElement();
+ if (!select)
+ return nullptr;
+ AXObject* select_ax_object = AxObjectCache().GetOrCreate(select);
+ if (select_ax_object->HasChildren()) {
+ const auto& child_objects = select_ax_object->Children();
+ DCHECK(!child_objects.IsEmpty());
+ DCHECK_EQ(child_objects.size(), 1UL);
+ DCHECK(child_objects[0]->IsMenuListPopup());
+ ToAXMenuListPopup(child_objects[0].Get())->UpdateChildrenIfNecessary();
+ } else {
+ select_ax_object->UpdateChildrenIfNecessary();
+ }
+ return parent_.Get();
+}
+
bool AXMenuListOption::IsEnabled() const {
// isDisabledFormControl() returns true if the parent <select> element is
// disabled, which we don't want.

Powered by Google App Engine
This is Rietveld 408576698