This is a reland of 41e56b19e9
Dealt with crashes a6705f429d
An occasional infinite loop was identified and fixed in AXPosition, between CreateParentPosition and AtStartOfLine methods.
Original change's description:
> Consolidated some text helper methods in AXNode
>
> This patch is a second precursor to a more substantial change that
> would move hypertext computation to AXNode from AXPlatformNodeBase which will
> in turn open the way for AXNodePosition to be merged with AXPosition and
> for Views to be exposed as a tree of AXNodes.
> See https://chromium-review.googlesource.com/2150294
>
> Currently, we have multiple methods that compute inner text, IsLeaf and IsChildOfLeaf
> one set in BrowserAccessibility and another in AXPlatformNodeBase.
> We want to centralize all platform independent utility methods in AXNode and AXNodeData.
>
> There was some confusion in the existing codebase regarding what should be included in inner text.
> Some code assumed that the name attribute of a leaf node could not be included, unless it was derived from its contents,
> or its placeholder in the case of a text field.
> Other parts of the codebase were more relaxed about this requirement.
>
> This patch adopts this requirement for the whole codebase, because the definition of inner text should only include visible
> text that is present inside the node itself, but not text derived from an attribute, e.g. an ARIA label.
> This is apparent from the name "inner text" itself, but it also stems out of the need
> to support computing bounding boxes for character ranges in inner text.
> If the name of an element is derived from an attribute such as an ARIA label, that attribute won't expose any bounding box information.
> If the name of an element is derived from a related element, e.g. a figcaption or an HTML label,
> the bounding box of that element is unrelated to the original element's inner text.
>
> APIs to compute bounding boxes are exposed in IAccessibleText, ATKText and ITextRangeProvider.
>
> See also the definition of IAccessibleText in the IAccessible2 Specification,
> the definition of ATKText in the ATK Specification, or
> the definition of ITextProvider in the UIA Specification.
> 1. https://accessibility.linuxfoundation.org/a11yspecs/ia2/docs/html/interface_i_accessible_text.html
> "The IAccessibleText interface should be implemented by all components that present textual information on the display like
> buttons, text entry fields, or text portions of the document window."
> 2. https://developer.gnome.org/pygtk/stable/class-atktext.html
> "... if the text is editable, multi-line, typically longer than three or four words, attributed, selectable,
> or if the object already uses the 'name' ATK property for other information, the atk.Text interface should be used"
> 3. https://docs.microsoft.com/en-us/windows/win32/api/uiautomationcore/nn-uiautomationcore-itextprovider
> "Provides access to controls that contain text."
> 4. https://docs.microsoft.com/en-us/windows/win32/winauto/uiauto-implementingtextandtextrange
> "If an embedded object spans a range of text, the plain text should include the inner text of the object, but not the alternative text (the name property of the embedded object)
> because it might be inconsistent with the descriptive inner text."
>
> RELNOTES: N/A
>
> R=dmazzoni@chromium.org, aleventhal@chromium.org
> TBR=rsesek@chromium.org
>
> Bug: 1049261
> Change-Id: Ic39687eb98c3ef7575214de2c659eb28d6633466
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2171436
> Commit-Queue: Nektarios Paisios <nektar@chromium.org>
> Reviewed-by: Dominic Mazzoni <dmazzoni@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#771809}
TBR=dmazzoni@chromium.org, rsesek@chromium.org
Bug: 1049261
Change-Id: Iebe5f00e5119ce4020dedcee176ecf9fc8a40310
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2224224
Reviewed-by: Nektarios Paisios <nektar@chromium.org>
Commit-Queue: Nektarios Paisios <nektar@chromium.org>
Auto-Submit: Nektarios Paisios <nektar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#780246}