Chromium Code Reviews| Index: Source/modules/accessibility/AXObject.h |
| diff --git a/Source/modules/accessibility/AXObject.h b/Source/modules/accessibility/AXObject.h |
| index 1fa46b3d1990e4d919b171cf63a6b0299dc030a8..e7b8b68e6aee319a5d2ebdc2722ce360aefdece1 100644 |
| --- a/Source/modules/accessibility/AXObject.h |
| +++ b/Source/modules/accessibility/AXObject.h |
| @@ -355,22 +355,44 @@ class MODULES_EXPORT AXObject : public RefCounted<AXObject> { |
| public: |
| typedef Vector<RefPtr<AXObject>> AccessibilityChildrenVector; |
| - struct PlainTextRange { |
| - |
| - unsigned start; |
| - unsigned length; |
| + struct AXSelection { |
| + // The ID of the deepest descendant in which the selection starts. |
| + // (A value of 0 means the current object.) |
| + AXID anchorId; |
| + // The number of characters and child objects in the anchor object |
| + // before the selection starts. |
| + unsigned anchorOffset; |
| + // The ID of the deepest descendant in which the selection ends. |
| + // (A value of 0 means the current object.) |
| + AXID focusId; |
| + // The number of characters and child objects in the focus object |
| + // before the selection ends. |
| + unsigned focusOffset; |
| + |
| + AXSelection() |
| + : anchorId(0) |
| + , anchorOffset(0) |
| + , focusId(0) |
| + , focusOffset(0) |
| + { } |
| - PlainTextRange() |
| - : start(0) |
| - , length(0) |
| + AXSelection(unsigned startOffset, unsigned endOffset) |
| + : anchorId(0) |
| + , anchorOffset(startOffset) |
| + , focusId(0) |
| + , focusOffset(endOffset) |
| { } |
| - PlainTextRange(unsigned s, unsigned l) |
| - : start(s) |
| - , length(l) |
| + AXSelection(AXID anchorId, unsigned anchorOffset, AXID focusId, unsigned focusOffset) |
| + : anchorId(anchorId) |
| + , anchorOffset(anchorOffset) |
| + , focusId(focusId) |
| + , focusOffset(focusOffset) |
| { } |
| - bool isNull() const { return !start && !length; } |
| + bool isNull() const { return !anchorOffset && !focusOffset; } |
| + bool hasAnchor() const { return !anchorId; } |
| + bool hasFocus() const { return !focusId; } |
| }; |
| protected: |
| @@ -583,7 +605,7 @@ public: |
| // The integer horizontal pixel offset of each character in the string; negative values for RTL. |
| virtual void textCharacterOffsets(Vector<int>&) const { } |
| // The start and end character offset of each word in the inline text box. |
| - virtual void wordBoundaries(Vector<PlainTextRange>& words) const { } |
| + virtual void wordBoundaries(Vector<AXSelection>& words) const { } |
| // Properties of interactive elements. |
| virtual String actionVerb() const; |
| @@ -699,9 +721,8 @@ public: |
| String language() const; |
| bool hasAttribute(const QualifiedName&) const; |
| const AtomicString& getAttribute(const QualifiedName&) const; |
| - |
| - // Selected text. |
| - virtual PlainTextRange selectedTextRange() const { return PlainTextRange(); } |
| + virtual AXSelection selection() const { return AXSelection(); } |
| + virtual AXSelection selectionUnderObject() const { return AXSelection(); } |
| // Scrollable containers. |
| bool isScrollableContainer() const; |
| @@ -727,7 +748,7 @@ public: |
| virtual void setFocused(bool) { } |
| virtual void setSelected(bool) { } |
| void setSelectedText(const String&) { } |
| - virtual void setSelectedTextRange(const PlainTextRange&) { } |
| + virtual void setSelection(const AXSelection&) { } |
|
dmazzoni
2015/06/16 17:24:04
Why is setSelection implemented here but not expos
|
| virtual void setValue(const String&) { } |
| virtual void setValue(float) { } |