OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 class MODULES_EXPORT AXLayoutObject : public AXNodeObject { | 47 class MODULES_EXPORT AXLayoutObject : public AXNodeObject { |
48 WTF_MAKE_NONCOPYABLE(AXLayoutObject); | 48 WTF_MAKE_NONCOPYABLE(AXLayoutObject); |
49 | 49 |
50 protected: | 50 protected: |
51 AXLayoutObject(LayoutObject*, AXObjectCacheImpl&); | 51 AXLayoutObject(LayoutObject*, AXObjectCacheImpl&); |
52 | 52 |
53 public: | 53 public: |
54 static AXLayoutObject* Create(LayoutObject*, AXObjectCacheImpl&); | 54 static AXLayoutObject* Create(LayoutObject*, AXObjectCacheImpl&); |
55 ~AXLayoutObject() override; | 55 ~AXLayoutObject() override; |
56 | 56 |
57 // Public, overridden from AXObject. | 57 // Public, overridden from AXObjectImpl. |
58 LayoutObject* GetLayoutObject() const final { return layout_object_; } | 58 LayoutObject* GetLayoutObject() const final { return layout_object_; } |
59 LayoutBoxModelObject* GetLayoutBoxModelObject() const; | 59 LayoutBoxModelObject* GetLayoutBoxModelObject() const; |
60 ScrollableArea* GetScrollableAreaIfScrollable() const final; | 60 ScrollableArea* GetScrollableAreaIfScrollable() const final; |
61 AccessibilityRole DetermineAccessibilityRole() override; | 61 AccessibilityRole DetermineAccessibilityRole() override; |
62 AccessibilityRole NativeAccessibilityRoleIgnoringAria() const override; | 62 AccessibilityRole NativeAccessibilityRoleIgnoringAria() const override; |
63 | 63 |
64 protected: | 64 protected: |
65 LayoutObject* layout_object_; | 65 LayoutObject* layout_object_; |
66 | 66 |
67 LayoutObject* LayoutObjectForRelativeBounds() const override { | 67 LayoutObject* LayoutObjectForRelativeBounds() const override { |
68 return layout_object_; | 68 return layout_object_; |
69 } | 69 } |
70 | 70 |
71 // | 71 // |
72 // Overridden from AXObject. | 72 // Overridden from AXObjectImpl. |
73 // | 73 // |
74 | 74 |
75 void Init() override; | 75 void Init() override; |
76 void Detach() override; | 76 void Detach() override; |
77 bool IsDetached() const override { return !layout_object_; } | 77 bool IsDetached() const override { return !layout_object_; } |
78 bool IsAXLayoutObject() const override { return true; } | 78 bool IsAXLayoutObject() const override { return true; } |
79 | 79 |
80 // Check object role or purpose. | 80 // Check object role or purpose. |
81 bool IsEditable() const override; | 81 bool IsEditable() const override; |
82 bool IsRichlyEditable() const override; | 82 bool IsRichlyEditable() const override; |
(...skipping 21 matching lines...) Expand all Loading... |
104 float FontSize() const final; | 104 float FontSize() const final; |
105 String ImageDataUrl(const IntSize& max_size) const final; | 105 String ImageDataUrl(const IntSize& max_size) const final; |
106 String GetText() const override; | 106 String GetText() const override; |
107 AccessibilityTextDirection GetTextDirection() const final; | 107 AccessibilityTextDirection GetTextDirection() const final; |
108 int TextLength() const override; | 108 int TextLength() const override; |
109 TextStyle GetTextStyle() const final; | 109 TextStyle GetTextStyle() const final; |
110 KURL Url() const override; | 110 KURL Url() const override; |
111 | 111 |
112 // Inline text boxes. | 112 // Inline text boxes. |
113 void LoadInlineTextBoxes() override; | 113 void LoadInlineTextBoxes() override; |
114 AXObject* NextOnLine() const override; | 114 AXObjectImpl* NextOnLine() const override; |
115 AXObject* PreviousOnLine() const override; | 115 AXObjectImpl* PreviousOnLine() const override; |
116 | 116 |
117 // Properties of interactive elements. | 117 // Properties of interactive elements. |
118 String StringValue() const override; | 118 String StringValue() const override; |
119 | 119 |
120 // ARIA attributes. | 120 // ARIA attributes. |
121 void AriaDescribedbyElements(AXObjectVector&) const override; | 121 void AriaDescribedbyElements(AXObjectVector&) const override; |
122 void AriaLabelledbyElements(AXObjectVector&) const override; | 122 void AriaLabelledbyElements(AXObjectVector&) const override; |
123 void AriaOwnsElements(AXObjectVector&) const override; | 123 void AriaOwnsElements(AXObjectVector&) const override; |
124 | 124 |
125 bool AriaHasPopup() const override; | 125 bool AriaHasPopup() const override; |
126 bool AriaRoleHasPresentationalChildren() const override; | 126 bool AriaRoleHasPresentationalChildren() const override; |
127 AXObject* AncestorForWhichThisIsAPresentationalChild() const override; | 127 AXObjectImpl* AncestorForWhichThisIsAPresentationalChild() const override; |
128 bool SupportsARIADragging() const override; | 128 bool SupportsARIADragging() const override; |
129 bool SupportsARIADropping() const override; | 129 bool SupportsARIADropping() const override; |
130 bool SupportsARIAFlowTo() const override; | 130 bool SupportsARIAFlowTo() const override; |
131 bool SupportsARIAOwns() const override; | 131 bool SupportsARIAOwns() const override; |
132 | 132 |
133 // ARIA live-region features. | 133 // ARIA live-region features. |
134 const AtomicString& LiveRegionStatus() const override; | 134 const AtomicString& LiveRegionStatus() const override; |
135 const AtomicString& LiveRegionRelevant() const override; | 135 const AtomicString& LiveRegionRelevant() const override; |
136 bool LiveRegionAtomic() const override; | 136 bool LiveRegionAtomic() const override; |
137 bool LiveRegionBusy() const override; | 137 bool LiveRegionBusy() const override; |
138 | 138 |
139 // AX name calc. | 139 // AX name calc. |
140 String TextAlternative(bool recursive, | 140 String TextAlternative(bool recursive, |
141 bool in_aria_labelled_by_traversal, | 141 bool in_aria_labelled_by_traversal, |
142 AXObjectSet& visited, | 142 AXObjectSet& visited, |
143 AXNameFrom&, | 143 AXNameFrom&, |
144 AXRelatedObjectVector*, | 144 AXRelatedObjectVector*, |
145 NameSources*) const override; | 145 NameSources*) const override; |
146 | 146 |
147 // Methods that retrieve or manipulate the current selection. | 147 // Methods that retrieve or manipulate the current selection. |
148 | 148 |
149 AXRange Selection() const override; | 149 AXRange Selection() const override; |
150 AXRange SelectionUnderObject() const override; | 150 AXRange SelectionUnderObject() const override; |
151 void SetSelection(const AXRange&) override; | 151 void SetSelection(const AXRange&) override; |
152 | 152 |
153 // Hit testing. | 153 // Hit testing. |
154 AXObject* AccessibilityHitTest(const IntPoint&) const override; | 154 AXObjectImpl* AccessibilityHitTest(const IntPoint&) const override; |
155 AXObject* ElementAccessibilityHitTest(const IntPoint&) const override; | 155 AXObjectImpl* ElementAccessibilityHitTest(const IntPoint&) const override; |
156 | 156 |
157 // High-level accessibility tree access. Other modules should only use these | 157 // High-level accessibility tree access. Other modules should only use these |
158 // functions. | 158 // functions. |
159 AXObject* ComputeParent() const override; | 159 AXObjectImpl* ComputeParent() const override; |
160 AXObject* ComputeParentIfExists() const override; | 160 AXObjectImpl* ComputeParentIfExists() const override; |
161 | 161 |
162 // Low-level accessibility tree exploration, only for use within the | 162 // Low-level accessibility tree exploration, only for use within the |
163 // accessibility module. | 163 // accessibility module. |
164 AXObject* RawFirstChild() const override; | 164 AXObjectImpl* RawFirstChild() const override; |
165 AXObject* RawNextSibling() const override; | 165 AXObjectImpl* RawNextSibling() const override; |
166 void AddChildren() override; | 166 void AddChildren() override; |
167 bool CanHaveChildren() const override; | 167 bool CanHaveChildren() const override; |
168 void UpdateChildrenIfNecessary() override; | 168 void UpdateChildrenIfNecessary() override; |
169 bool NeedsToUpdateChildren() const override { return children_dirty_; } | 169 bool NeedsToUpdateChildren() const override { return children_dirty_; } |
170 void SetNeedsToUpdateChildren() override { children_dirty_ = true; } | 170 void SetNeedsToUpdateChildren() override { children_dirty_ = true; } |
171 void ClearChildren() override; | 171 void ClearChildren() override; |
172 | 172 |
173 // Properties of the object's owning document or page. | 173 // Properties of the object's owning document or page. |
174 double EstimatedLoadingProgress() const override; | 174 double EstimatedLoadingProgress() const override; |
175 | 175 |
176 // DOM and layout tree access. | 176 // DOM and layout tree access. |
177 Node* GetNode() const override; | 177 Node* GetNode() const override; |
178 Document* GetDocument() const override; | 178 Document* GetDocument() const override; |
179 FrameView* DocumentFrameView() const override; | 179 FrameView* DocumentFrameView() const override; |
180 Element* AnchorElement() const override; | 180 Element* AnchorElement() const override; |
181 | 181 |
182 void SetValue(const String&) override; | 182 void SetValue(const String&) override; |
183 | 183 |
184 // Notifications that this object may have changed. | 184 // Notifications that this object may have changed. |
185 void HandleActiveDescendantChanged() override; | 185 void HandleActiveDescendantChanged() override; |
186 void HandleAriaExpandedChanged() override; | 186 void HandleAriaExpandedChanged() override; |
187 void TextChanged() override; | 187 void TextChanged() override; |
188 | 188 |
189 // Text metrics. Most of these should be deprecated, needs major cleanup. | 189 // Text metrics. Most of these should be deprecated, needs major cleanup. |
190 int Index(const VisiblePosition&) const override; | 190 int Index(const VisiblePosition&) const override; |
191 VisiblePosition VisiblePositionForIndex(int) const override; | 191 VisiblePosition VisiblePositionForIndex(int) const override; |
192 void LineBreaks(Vector<int>&) const final; | 192 void LineBreaks(Vector<int>&) const final; |
193 | 193 |
194 private: | 194 private: |
195 AXObject* TreeAncestorDisallowingChild() const; | 195 AXObjectImpl* TreeAncestorDisallowingChild() const; |
196 bool IsTabItemSelected() const; | 196 bool IsTabItemSelected() const; |
197 bool IsValidSelectionBound(const AXObject*) const; | 197 bool IsValidSelectionBound(const AXObjectImpl*) const; |
198 AXObject* AccessibilityImageMapHitTest(HTMLAreaElement*, | 198 AXObjectImpl* AccessibilityImageMapHitTest(HTMLAreaElement*, |
199 const IntPoint&) const; | 199 const IntPoint&) const; |
200 LayoutObject* LayoutParentObject() const; | 200 LayoutObject* LayoutParentObject() const; |
201 bool IsSVGImage() const; | 201 bool IsSVGImage() const; |
202 void DetachRemoteSVGRoot(); | 202 void DetachRemoteSVGRoot(); |
203 AXSVGRoot* RemoteSVGRootElement() const; | 203 AXSVGRoot* RemoteSVGRootElement() const; |
204 AXObject* RemoteSVGElementHitTest(const IntPoint&) const; | 204 AXObjectImpl* RemoteSVGElementHitTest(const IntPoint&) const; |
205 void OffsetBoundingBoxForRemoteSVGElement(LayoutRect&) const; | 205 void OffsetBoundingBoxForRemoteSVGElement(LayoutRect&) const; |
206 void AddHiddenChildren(); | 206 void AddHiddenChildren(); |
207 void AddTextFieldChildren(); | 207 void AddTextFieldChildren(); |
208 void AddImageMapChildren(); | 208 void AddImageMapChildren(); |
209 void AddCanvasChildren(); | 209 void AddCanvasChildren(); |
210 void AddPopupChildren(); | 210 void AddPopupChildren(); |
211 void AddRemoteSVGChildren(); | 211 void AddRemoteSVGChildren(); |
212 void AddInlineTextBoxChildren(bool force); | 212 void AddInlineTextBoxChildren(bool force); |
213 | 213 |
214 bool ElementAttributeValue(const QualifiedName&) const; | 214 bool ElementAttributeValue(const QualifiedName&) const; |
215 LayoutRect ComputeElementRect() const; | 215 LayoutRect ComputeElementRect() const; |
216 AXRange TextControlSelection() const; | 216 AXRange TextControlSelection() const; |
217 int IndexForVisiblePosition(const VisiblePosition&) const; | 217 int IndexForVisiblePosition(const VisiblePosition&) const; |
218 AXLayoutObject* GetUnignoredObjectFromNode(Node&) const; | 218 AXLayoutObject* GetUnignoredObjectFromNode(Node&) const; |
219 }; | 219 }; |
220 | 220 |
221 DEFINE_AX_OBJECT_TYPE_CASTS(AXLayoutObject, IsAXLayoutObject()); | 221 DEFINE_AX_OBJECT_TYPE_CASTS(AXLayoutObject, IsAXLayoutObject()); |
222 | 222 |
223 } // namespace blink | 223 } // namespace blink |
224 | 224 |
225 #endif // AXLayoutObject_h | 225 #endif // AXLayoutObject_h |
OLD | NEW |