OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "modules/accessibility/InspectorAccessibilityAgent.h" | 5 #include "modules/accessibility/InspectorAccessibilityAgent.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include "core/HTMLNames.h" | 8 #include "core/HTMLNames.h" |
9 #include "core/dom/AXObjectCache.h" | 9 #include "core/dom/AXObjectCache.h" |
10 #include "core/dom/DOMNodeIds.h" | 10 #include "core/dom/DOMNodeIds.h" |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 | 158 |
159 void FillWidgetProperties(AXObject& ax_object, | 159 void FillWidgetProperties(AXObject& ax_object, |
160 protocol::Array<AXProperty>& properties) { | 160 protocol::Array<AXProperty>& properties) { |
161 AccessibilityRole role = ax_object.RoleValue(); | 161 AccessibilityRole role = ax_object.RoleValue(); |
162 String autocomplete = ax_object.AriaAutoComplete(); | 162 String autocomplete = ax_object.AriaAutoComplete(); |
163 if (!autocomplete.IsEmpty()) | 163 if (!autocomplete.IsEmpty()) |
164 properties.addItem( | 164 properties.addItem( |
165 CreateProperty(AXWidgetAttributesEnum::Autocomplete, | 165 CreateProperty(AXWidgetAttributesEnum::Autocomplete, |
166 CreateValue(autocomplete, AXValueTypeEnum::Token))); | 166 CreateValue(autocomplete, AXValueTypeEnum::Token))); |
167 | 167 |
168 if (ax_object.HasAttribute(HTMLNames::aria_haspopupAttr)) { | 168 bool has_popup = ax_object.AriaHasPopup(); |
169 bool has_popup = ax_object.AriaHasPopup(); | 169 if (has_popup || ax_object.HasAttribute(HTMLNames::aria_haspopupAttr)) { |
170 properties.addItem(CreateProperty(AXWidgetAttributesEnum::Haspopup, | 170 properties.addItem(CreateProperty(AXWidgetAttributesEnum::Haspopup, |
171 CreateBooleanValue(has_popup))); | 171 CreateBooleanValue(has_popup))); |
172 } | 172 } |
173 | 173 |
174 int heading_level = ax_object.HeadingLevel(); | 174 int heading_level = ax_object.HeadingLevel(); |
175 if (heading_level > 0) { | 175 if (heading_level > 0) { |
176 properties.addItem(CreateProperty(AXWidgetAttributesEnum::Level, | 176 properties.addItem(CreateProperty(AXWidgetAttributesEnum::Level, |
177 CreateValue(heading_level))); | 177 CreateValue(heading_level))); |
178 } | 178 } |
179 int hierarchical_level = ax_object.HierarchicalLevel(); | 179 int hierarchical_level = ax_object.HierarchicalLevel(); |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 } | 714 } |
715 } | 715 } |
716 | 716 |
717 DEFINE_TRACE(InspectorAccessibilityAgent) { | 717 DEFINE_TRACE(InspectorAccessibilityAgent) { |
718 visitor->Trace(page_); | 718 visitor->Trace(page_); |
719 visitor->Trace(dom_agent_); | 719 visitor->Trace(dom_agent_); |
720 InspectorBaseAgent::Trace(visitor); | 720 InspectorBaseAgent::Trace(visitor); |
721 } | 721 } |
722 | 722 |
723 } // namespace blink | 723 } // namespace blink |
OLD | NEW |