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

Side by Side Diff: third_party/WebKit/Source/core/dom/AccessibleNode.cpp

Issue 2973973002: Implement AccessibleNode.hasPopUp for Accessibility Object Model phase 1 (Closed)
Patch Set: Fix handling of aria-haspopup=false Created 3 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "core/dom/AccessibleNode.h" 5 #include "core/dom/AccessibleNode.h"
6 6
7 #include "core/dom/AXObjectCache.h" 7 #include "core/dom/AXObjectCache.h"
8 #include "core/dom/AccessibleNodeList.h" 8 #include "core/dom/AccessibleNodeList.h"
9 #include "core/dom/Element.h" 9 #include "core/dom/Element.h"
10 #include "core/dom/QualifiedName.h" 10 #include "core/dom/QualifiedName.h"
11 #include "core/frame/Settings.h" 11 #include "core/frame/Settings.h"
12 12
13 namespace blink { 13 namespace blink {
14 14
15 using namespace HTMLNames; 15 using namespace HTMLNames;
16 16
17 namespace { 17 namespace {
18 18
19 QualifiedName GetCorrespondingARIAAttribute(AOMStringProperty property) { 19 QualifiedName GetCorrespondingARIAAttribute(AOMStringProperty property) {
20 switch (property) { 20 switch (property) {
21 case AOMStringProperty::kAutocomplete: 21 case AOMStringProperty::kAutocomplete:
22 return aria_autocompleteAttr; 22 return aria_autocompleteAttr;
23 case AOMStringProperty::kChecked: 23 case AOMStringProperty::kChecked:
24 return aria_checkedAttr; 24 return aria_checkedAttr;
25 case AOMStringProperty::kCurrent: 25 case AOMStringProperty::kCurrent:
26 return aria_currentAttr; 26 return aria_currentAttr;
27 case AOMStringProperty::kHasPopUp:
28 return aria_haspopupAttr;
27 case AOMStringProperty::kInvalid: 29 case AOMStringProperty::kInvalid:
28 return aria_invalidAttr; 30 return aria_invalidAttr;
29 case AOMStringProperty::kKeyShortcuts: 31 case AOMStringProperty::kKeyShortcuts:
30 return aria_keyshortcutsAttr; 32 return aria_keyshortcutsAttr;
31 case AOMStringProperty::kLabel: 33 case AOMStringProperty::kLabel:
32 return aria_labelAttr; 34 return aria_labelAttr;
33 case AOMStringProperty::kLive: 35 case AOMStringProperty::kLive:
34 return aria_liveAttr; 36 return aria_liveAttr;
35 case AOMStringProperty::kOrientation: 37 case AOMStringProperty::kOrientation:
36 return aria_orientationAttr; 38 return aria_orientationAttr;
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 680
679 AccessibleNodeList* AccessibleNode::flowTo() const { 681 AccessibleNodeList* AccessibleNode::flowTo() const {
680 return GetProperty(element_, AOMRelationListProperty::kFlowTo); 682 return GetProperty(element_, AOMRelationListProperty::kFlowTo);
681 } 683 }
682 684
683 void AccessibleNode::setFlowTo(AccessibleNodeList* flow_to) { 685 void AccessibleNode::setFlowTo(AccessibleNodeList* flow_to) {
684 SetRelationListProperty(AOMRelationListProperty::kFlowTo, flow_to); 686 SetRelationListProperty(AOMRelationListProperty::kFlowTo, flow_to);
685 NotifyAttributeChanged(aria_flowtoAttr); 687 NotifyAttributeChanged(aria_flowtoAttr);
686 } 688 }
687 689
690 AtomicString AccessibleNode::hasPopUp() const {
691 return GetProperty(element_, AOMStringProperty::kHasPopUp);
692 }
693
694 void AccessibleNode::setHasPopUp(const AtomicString& has_popup) {
695 SetStringProperty(AOMStringProperty::kHasPopUp, has_popup);
696 NotifyAttributeChanged(aria_haspopupAttr);
697 }
698
688 bool AccessibleNode::hidden(bool& is_null) const { 699 bool AccessibleNode::hidden(bool& is_null) const {
689 return GetProperty(element_, AOMBooleanProperty::kHidden, is_null); 700 return GetProperty(element_, AOMBooleanProperty::kHidden, is_null);
690 } 701 }
691 702
692 void AccessibleNode::setHidden(bool hidden, bool is_null) { 703 void AccessibleNode::setHidden(bool hidden, bool is_null) {
693 SetBooleanProperty(AOMBooleanProperty::kHidden, hidden, is_null); 704 SetBooleanProperty(AOMBooleanProperty::kHidden, hidden, is_null);
694 NotifyAttributeChanged(aria_hiddenAttr); 705 NotifyAttributeChanged(aria_hiddenAttr);
695 } 706 }
696 707
697 AtomicString AccessibleNode::invalid() const { 708 AtomicString AccessibleNode::invalid() const {
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
1055 return element_->GetDocument().ExistingAXObjectCache(); 1066 return element_->GetDocument().ExistingAXObjectCache();
1056 } 1067 }
1057 1068
1058 DEFINE_TRACE(AccessibleNode) { 1069 DEFINE_TRACE(AccessibleNode) {
1059 visitor->Trace(element_); 1070 visitor->Trace(element_);
1060 visitor->Trace(relation_properties_); 1071 visitor->Trace(relation_properties_);
1061 visitor->Trace(relation_list_properties_); 1072 visitor->Trace(relation_list_properties_);
1062 } 1073 }
1063 1074
1064 } // namespace blink 1075 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/AccessibleNode.h ('k') | third_party/WebKit/Source/core/dom/AccessibleNode.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698