OLD | NEW |
(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 AccessibleNodeList_h |
| 6 #define AccessibleNodeList_h |
| 7 |
| 8 #include "core/CoreExport.h" |
| 9 #include "platform/bindings/ScriptWrappable.h" |
| 10 |
| 11 namespace blink { |
| 12 |
| 13 class AccessibleNode; |
| 14 enum class AOMRelationListProperty; |
| 15 class ExceptionState; |
| 16 |
| 17 // Accessibility Object Model node list |
| 18 // Explainer: https://github.com/WICG/aom/blob/master/explainer.md |
| 19 // Spec: https://wicg.github.io/aom/spec/ |
| 20 class CORE_EXPORT AccessibleNodeList |
| 21 : public GarbageCollectedFinalized<AccessibleNodeList>, |
| 22 public ScriptWrappable { |
| 23 DEFINE_WRAPPERTYPEINFO(); |
| 24 |
| 25 public: |
| 26 static AccessibleNodeList* Create(const HeapVector<Member<AccessibleNode>>&); |
| 27 |
| 28 AccessibleNodeList(); |
| 29 virtual ~AccessibleNodeList(); |
| 30 |
| 31 void AddOwner(AOMRelationListProperty, AccessibleNode*); |
| 32 void RemoveOwner(AOMRelationListProperty, AccessibleNode*); |
| 33 |
| 34 AccessibleNode* item(unsigned offset) const; |
| 35 void add(AccessibleNode*, AccessibleNode* = nullptr); |
| 36 void remove(int index); |
| 37 bool AnonymousIndexedSetter(unsigned, AccessibleNode*, ExceptionState&); |
| 38 unsigned length() const; |
| 39 void setLength(unsigned); |
| 40 |
| 41 DECLARE_VIRTUAL_TRACE(); |
| 42 |
| 43 private: |
| 44 void NotifyChanged(); |
| 45 |
| 46 HeapVector<std::pair<AOMRelationListProperty, Member<AccessibleNode>>> |
| 47 owners_; |
| 48 HeapVector<Member<AccessibleNode>> nodes_; |
| 49 }; |
| 50 |
| 51 } // namespace blink |
| 52 |
| 53 #endif // AccessibleNodeList_h |
OLD | NEW |