| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 class Node; | 45 class Node; |
| 46 class VisibleSelection; | 46 class VisibleSelection; |
| 47 class Widget; | 47 class Widget; |
| 48 | 48 |
| 49 class MODULES_EXPORT AXLayoutObject : public AXNodeObject { | 49 class MODULES_EXPORT AXLayoutObject : public AXNodeObject { |
| 50 protected: | 50 protected: |
| 51 AXLayoutObject(LayoutObject*, AXObjectCacheImpl&); | 51 AXLayoutObject(LayoutObject*, AXObjectCacheImpl&); |
| 52 | 52 |
| 53 public: | 53 public: |
| 54 static PassRefPtrWillBeRawPtr<AXLayoutObject> create(LayoutObject*, AXObject
CacheImpl&); | 54 static PassRefPtrWillBeRawPtr<AXLayoutObject> create(LayoutObject*, AXObject
CacheImpl&); |
| 55 virtual ~AXLayoutObject(); | 55 ~AXLayoutObject() override; |
| 56 | 56 |
| 57 // Public, overridden from AXObject. | 57 // Public, overridden from AXObject. |
| 58 virtual LayoutObject* layoutObject() const override final { return m_layoutO
bject; } | 58 LayoutObject* layoutObject() const final { return m_layoutObject; } |
| 59 virtual LayoutRect elementRect() const override; | 59 LayoutRect elementRect() const override; |
| 60 | 60 |
| 61 void setLayoutObject(LayoutObject*); | 61 void setLayoutObject(LayoutObject*); |
| 62 LayoutBoxModelObject* layoutBoxModelObject() const; | 62 LayoutBoxModelObject* layoutBoxModelObject() const; |
| 63 Document* topDocument() const; | 63 Document* topDocument() const; |
| 64 bool shouldNotifyActiveDescendant() const; | 64 bool shouldNotifyActiveDescendant() const; |
| 65 virtual ScrollableArea* getScrollableAreaIfScrollable() const override final
; | 65 ScrollableArea* getScrollableAreaIfScrollable() const final; |
| 66 virtual AccessibilityRole determineAccessibilityRole() override; | 66 AccessibilityRole determineAccessibilityRole() override; |
| 67 void checkCachedElementRect() const; | 67 void checkCachedElementRect() const; |
| 68 void updateCachedElementRect() const; | 68 void updateCachedElementRect() const; |
| 69 | 69 |
| 70 protected: | 70 protected: |
| 71 LayoutObject* m_layoutObject; | 71 LayoutObject* m_layoutObject; |
| 72 mutable LayoutRect m_cachedElementRect; | 72 mutable LayoutRect m_cachedElementRect; |
| 73 mutable LayoutRect m_cachedFrameRect; | 73 mutable LayoutRect m_cachedFrameRect; |
| 74 mutable IntPoint m_cachedScrollPosition; | 74 mutable IntPoint m_cachedScrollPosition; |
| 75 mutable bool m_cachedElementRectDirty; | 75 mutable bool m_cachedElementRectDirty; |
| 76 | 76 |
| 77 // | 77 // |
| 78 // Overridden from AXObject. | 78 // Overridden from AXObject. |
| 79 // | 79 // |
| 80 | 80 |
| 81 virtual void init() override; | 81 void init() override; |
| 82 virtual void detach() override; | 82 void detach() override; |
| 83 virtual bool isDetached() const override { return !m_layoutObject; } | 83 bool isDetached() const override { return !m_layoutObject; } |
| 84 virtual bool isAXLayoutObject() const override { return true; } | 84 bool isAXLayoutObject() const override { return true; } |
| 85 | 85 |
| 86 // Check object role or purpose. | 86 // Check object role or purpose. |
| 87 virtual bool isAttachment() const override; | 87 bool isAttachment() const override; |
| 88 virtual bool isRichlyEditable() const override; | 88 bool isRichlyEditable() const override; |
| 89 virtual bool isLinked() const override; | 89 bool isLinked() const override; |
| 90 virtual bool isLoaded() const override; | 90 bool isLoaded() const override; |
| 91 virtual bool isOffScreen() const override; | 91 bool isOffScreen() const override; |
| 92 virtual bool isReadOnly() const override; | 92 bool isReadOnly() const override; |
| 93 virtual bool isVisited() const override; | 93 bool isVisited() const override; |
| 94 | 94 |
| 95 // Check object state. | 95 // Check object state. |
| 96 virtual bool isFocused() const override; | 96 bool isFocused() const override; |
| 97 virtual bool isSelected() const override; | 97 bool isSelected() const override; |
| 98 | 98 |
| 99 // Whether objects are ignored, i.e. not included in the tree. | 99 // Whether objects are ignored, i.e. not included in the tree. |
| 100 virtual AXObjectInclusion defaultObjectInclusion(IgnoredReasons* = nullptr)
const override; | 100 AXObjectInclusion defaultObjectInclusion(IgnoredReasons* = nullptr) const ov
erride; |
| 101 virtual bool computeAccessibilityIsIgnored(IgnoredReasons* = nullptr) const
override; | 101 bool computeAccessibilityIsIgnored(IgnoredReasons* = nullptr) const override
; |
| 102 | 102 |
| 103 // Properties of static elements. | 103 // Properties of static elements. |
| 104 virtual const AtomicString& accessKey() const override; | 104 const AtomicString& accessKey() const override; |
| 105 virtual RGBA32 backgroundColor() const override final; | 105 RGBA32 backgroundColor() const final; |
| 106 virtual RGBA32 color() const override final; | 106 RGBA32 color() const final; |
| 107 // Font size is in pixels. | 107 // Font size is in pixels. |
| 108 virtual float fontSize() const override final; | 108 float fontSize() const final; |
| 109 virtual AccessibilityOrientation orientation() const override; | 109 AccessibilityOrientation orientation() const override; |
| 110 virtual String text() const override; | 110 String text() const override; |
| 111 virtual AccessibilityTextDirection textDirection() const override final; | 111 AccessibilityTextDirection textDirection() const final; |
| 112 virtual int textLength() const override; | 112 int textLength() const override; |
| 113 virtual TextStyle textStyle() const override final; | 113 TextStyle textStyle() const final; |
| 114 virtual KURL url() const override; | 114 KURL url() const override; |
| 115 | 115 |
| 116 // Inline text boxes. | 116 // Inline text boxes. |
| 117 virtual void loadInlineTextBoxes() override; | 117 void loadInlineTextBoxes() override; |
| 118 virtual AXObject* nextOnLine() const override; | 118 AXObject* nextOnLine() const override; |
| 119 virtual AXObject* previousOnLine() const override; | 119 AXObject* previousOnLine() const override; |
| 120 | 120 |
| 121 // Properties of interactive elements. | 121 // Properties of interactive elements. |
| 122 virtual String actionVerb() const override; | 122 String actionVerb() const override; |
| 123 virtual String stringValue() const override; | 123 String stringValue() const override; |
| 124 | 124 |
| 125 // ARIA attributes. | 125 // ARIA attributes. |
| 126 virtual AXObject* activeDescendant() const override; | 126 AXObject* activeDescendant() const override; |
| 127 virtual void ariaFlowToElements(AccessibilityChildrenVector&) const override
; | 127 void ariaFlowToElements(AccessibilityChildrenVector&) const override; |
| 128 virtual void ariaControlsElements(AccessibilityChildrenVector&) const overri
de; | 128 void ariaControlsElements(AccessibilityChildrenVector&) const override; |
| 129 virtual void deprecatedAriaDescribedbyElements(AccessibilityChildrenVector&)
const override; | 129 void deprecatedAriaDescribedbyElements(AccessibilityChildrenVector&) const o
verride; |
| 130 virtual void deprecatedAriaLabelledbyElements(AccessibilityChildrenVector&)
const override; | 130 void deprecatedAriaLabelledbyElements(AccessibilityChildrenVector&) const ov
erride; |
| 131 virtual void ariaOwnsElements(AccessibilityChildrenVector&) const override; | 131 void ariaOwnsElements(AccessibilityChildrenVector&) const override; |
| 132 | 132 |
| 133 virtual bool ariaHasPopup() const override; | 133 bool ariaHasPopup() const override; |
| 134 virtual bool ariaRoleHasPresentationalChildren() const override; | 134 bool ariaRoleHasPresentationalChildren() const override; |
| 135 virtual AXObject* ancestorForWhichThisIsAPresentationalChild() const overrid
e; | 135 AXObject* ancestorForWhichThisIsAPresentationalChild() const override; |
| 136 virtual bool shouldFocusActiveDescendant() const override; | 136 bool shouldFocusActiveDescendant() const override; |
| 137 virtual bool supportsARIADragging() const override; | 137 bool supportsARIADragging() const override; |
| 138 virtual bool supportsARIADropping() const override; | 138 bool supportsARIADropping() const override; |
| 139 virtual bool supportsARIAFlowTo() const override; | 139 bool supportsARIAFlowTo() const override; |
| 140 virtual bool supportsARIAOwns() const override; | 140 bool supportsARIAOwns() const override; |
| 141 | 141 |
| 142 // ARIA live-region features. | 142 // ARIA live-region features. |
| 143 virtual const AtomicString& liveRegionStatus() const override; | 143 const AtomicString& liveRegionStatus() const override; |
| 144 virtual const AtomicString& liveRegionRelevant() const override; | 144 const AtomicString& liveRegionRelevant() const override; |
| 145 virtual bool liveRegionAtomic() const override; | 145 bool liveRegionAtomic() const override; |
| 146 virtual bool liveRegionBusy() const override; | 146 bool liveRegionBusy() const override; |
| 147 | 147 |
| 148 // Accessibility Text. | 148 // Accessibility Text. |
| 149 virtual String deprecatedTextUnderElement(TextUnderElementMode) const overri
de; | 149 String deprecatedTextUnderElement(TextUnderElementMode) const override; |
| 150 | 150 |
| 151 // Accessibility Text - (To be deprecated). | 151 // Accessibility Text - (To be deprecated). |
| 152 virtual String deprecatedHelpText() const override; | 152 String deprecatedHelpText() const override; |
| 153 | 153 |
| 154 // Location and click point in frame-relative coordinates. | 154 // Location and click point in frame-relative coordinates. |
| 155 virtual void markCachedElementRectDirty() const override; | 155 void markCachedElementRectDirty() const override; |
| 156 virtual IntPoint clickPoint() override; | 156 IntPoint clickPoint() override; |
| 157 | 157 |
| 158 // Hit testing. | 158 // Hit testing. |
| 159 virtual AXObject* accessibilityHitTest(const IntPoint&) const override; | 159 AXObject* accessibilityHitTest(const IntPoint&) const override; |
| 160 virtual AXObject* elementAccessibilityHitTest(const IntPoint&) const overrid
e; | 160 AXObject* elementAccessibilityHitTest(const IntPoint&) const override; |
| 161 | 161 |
| 162 // High-level accessibility tree access. Other modules should only use these
functions. | 162 // High-level accessibility tree access. Other modules should only use these
functions. |
| 163 virtual AXObject* computeParent() const override; | 163 AXObject* computeParent() const override; |
| 164 virtual AXObject* computeParentIfExists() const override; | 164 AXObject* computeParentIfExists() const override; |
| 165 | 165 |
| 166 // Low-level accessibility tree exploration, only for use within the accessi
bility module. | 166 // Low-level accessibility tree exploration, only for use within the accessi
bility module. |
| 167 virtual AXObject* firstChild() const override; | 167 AXObject* firstChild() const override; |
| 168 virtual AXObject* nextSibling() const override; | 168 AXObject* nextSibling() const override; |
| 169 virtual void addChildren() override; | 169 void addChildren() override; |
| 170 virtual bool canHaveChildren() const override; | 170 bool canHaveChildren() const override; |
| 171 virtual void updateChildrenIfNecessary() override; | 171 void updateChildrenIfNecessary() override; |
| 172 virtual bool needsToUpdateChildren() const override { return m_childrenDirty
; } | 172 bool needsToUpdateChildren() const override { return m_childrenDirty; } |
| 173 virtual void setNeedsToUpdateChildren() override { m_childrenDirty = true; } | 173 void setNeedsToUpdateChildren() override { m_childrenDirty = true; } |
| 174 virtual void clearChildren() override; | 174 void clearChildren() override; |
| 175 | 175 |
| 176 // Properties of the object's owning document or page. | 176 // Properties of the object's owning document or page. |
| 177 virtual double estimatedLoadingProgress() const override; | 177 double estimatedLoadingProgress() const override; |
| 178 | 178 |
| 179 // DOM and layout tree access. | 179 // DOM and layout tree access. |
| 180 virtual Node* node() const override; | 180 Node* node() const override; |
| 181 virtual Document* document() const override; | 181 Document* document() const override; |
| 182 virtual FrameView* documentFrameView() const override; | 182 FrameView* documentFrameView() const override; |
| 183 virtual Element* anchorElement() const override; | 183 Element* anchorElement() const override; |
| 184 virtual Widget* widgetForAttachmentView() const override; | 184 Widget* widgetForAttachmentView() const override; |
| 185 | 185 |
| 186 // Selected text. | 186 // Selected text. |
| 187 virtual PlainTextRange selectedTextRange() const override; | 187 PlainTextRange selectedTextRange() const override; |
| 188 | 188 |
| 189 // Modify or take an action on an object. | 189 // Modify or take an action on an object. |
| 190 virtual void setSelectedTextRange(const PlainTextRange&) override; | 190 void setSelectedTextRange(const PlainTextRange&) override; |
| 191 virtual void setValue(const String&) override; | 191 void setValue(const String&) override; |
| 192 | 192 |
| 193 // Notifications that this object may have changed. | 193 // Notifications that this object may have changed. |
| 194 virtual void handleActiveDescendantChanged() override; | 194 void handleActiveDescendantChanged() override; |
| 195 virtual void handleAriaExpandedChanged() override; | 195 void handleAriaExpandedChanged() override; |
| 196 virtual void textChanged() override; | 196 void textChanged() override; |
| 197 | 197 |
| 198 // Text metrics. Most of these should be deprecated, needs major cleanup. | 198 // Text metrics. Most of these should be deprecated, needs major cleanup. |
| 199 virtual int index(const VisiblePosition&) const override; | 199 int index(const VisiblePosition&) const override; |
| 200 virtual VisiblePosition visiblePositionForIndex(int) const override; | 200 VisiblePosition visiblePositionForIndex(int) const override; |
| 201 virtual void lineBreaks(Vector<int>&) const override; | 201 void lineBreaks(Vector<int>&) const override; |
| 202 | 202 |
| 203 private: | 203 private: |
| 204 AXObject* treeAncestorDisallowingChild() const; | 204 AXObject* treeAncestorDisallowingChild() const; |
| 205 void ariaListboxSelectedChildren(AccessibilityChildrenVector&); | 205 void ariaListboxSelectedChildren(AccessibilityChildrenVector&); |
| 206 PlainTextRange visibleSelectionUnderObject() const; | 206 PlainTextRange visibleSelectionUnderObject() const; |
| 207 bool nodeIsTextControl(const Node*) const; | 207 bool nodeIsTextControl(const Node*) const; |
| 208 bool isTabItemSelected() const; | 208 bool isTabItemSelected() const; |
| 209 AXObject* accessibilityImageMapHitTest(HTMLAreaElement*, const IntPoint&) co
nst; | 209 AXObject* accessibilityImageMapHitTest(HTMLAreaElement*, const IntPoint&) co
nst; |
| 210 LayoutObject* layoutParentObject() const; | 210 LayoutObject* layoutParentObject() const; |
| 211 bool isSVGImage() const; | 211 bool isSVGImage() const; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 227 LayoutRect computeElementRect() const; | 227 LayoutRect computeElementRect() const; |
| 228 VisibleSelection selection() const; | 228 VisibleSelection selection() const; |
| 229 int indexForVisiblePosition(const VisiblePosition&) const; | 229 int indexForVisiblePosition(const VisiblePosition&) const; |
| 230 }; | 230 }; |
| 231 | 231 |
| 232 DEFINE_AX_OBJECT_TYPE_CASTS(AXLayoutObject, isAXLayoutObject()); | 232 DEFINE_AX_OBJECT_TYPE_CASTS(AXLayoutObject, isAXLayoutObject()); |
| 233 | 233 |
| 234 } // namespace blink | 234 } // namespace blink |
| 235 | 235 |
| 236 #endif // AXLayoutObject_h | 236 #endif // AXLayoutObject_h |
| OLD | NEW |