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

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

Issue 2750533006: Initial skeleton of Accessibility Object Model Phase 1 (Closed)
Patch Set: Address feedback Created 3 years, 9 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef AccessibleNode_h
6 #define AccessibleNode_h
7
8 #include "bindings/core/v8/ScriptWrappable.h"
9 #include "core/CoreExport.h"
10 #include "wtf/HashMap.h"
11 #include "wtf/text/AtomicString.h"
12 #include "wtf/text/AtomicStringHash.h"
13
14 namespace blink {
15
16 class Element;
17
18 // All of the properties of AccessibleNode that have type "string".
19 // TODO(dmazzoni): Add similar enums for all of the properties with
20 // type bool, float, reference, and reference list.
21 enum class AOMStringProperty { kFirst, kRole = kFirst, kLabel, kCount };
22
23 const unsigned kAOMStringPropertyCount =
24 static_cast<unsigned>(AOMStringProperty::kCount);
25
26 // Accessibility Object Model node
27 // Explainer: https://github.com/WICG/aom/blob/master/explainer.md
28 // Spec: https://wicg.github.io/aom/spec/
29 class CORE_EXPORT AccessibleNode
30 : public GarbageCollectedFinalized<AccessibleNode>,
31 public ScriptWrappable {
32 DEFINE_WRAPPERTYPEINFO();
33
34 public:
35 explicit AccessibleNode(Element*);
36 virtual ~AccessibleNode();
37
38 // Returns the given string property if the Element has an AccessibleNode,
39 // otherwise returns the equivalent ARIA attribute.
40 static const AtomicString& getProperty(Element*, AOMStringProperty);
41
42 AtomicString role() const;
43 void setRole(const AtomicString&);
44
45 AtomicString label() const;
46 void setLabel(const AtomicString&);
47
48 DECLARE_VIRTUAL_TRACE();
49
50 private:
51 AtomicString m_stringProperties[kAOMStringPropertyCount];
esprehn 2017/03/24 01:59:39 fwiw I was actually suggesting using a Vector of p
dmazzoni 2017/03/24 17:51:12 Oh good, I like that better. Do you see anyone el
52 bool m_stringPropertyDirty[kAOMStringPropertyCount] = {false};
esprehn 2017/03/24 01:59:39 I think you want a std::bitset ? I don't think yo
aboxhall 2017/03/24 02:17:51 We want this to work equivalently to value, where
dmazzoni 2017/03/24 17:51:12 Now that I'm using a vector of pairs, we can simpl
53
54 // This object's owner Element.
55 WeakMember<Element> m_element;
56 };
57
58 } // namespace blink
59
60 #endif // AccessibleNode_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698