New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 813879 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug
STS
Team-Accessibility



Sign in to add a comment

Unexpected selection for text followed by <br> elements - tree ordering

Project Member Reported by katie@chromium.org, Feb 20 2018

Issue description

Simple repro case attached. This is simply a body with some text in it, followed by two <br> elements.

Mouse-based repro: triple-click on "some text" to select the whole line. Expected selection:
Start at staticText of "some text", offset 0. End at the end of that element.

Actual selection:
> anchorObject.role
"staticText"
> anchorObject.name
"Some text "

> focusObject.role
"genericContainer"
> focusOffset
11

Here the focusObject is the container holding the anchorObject.

I believe (after speaking with dtseng a few weeks ago) we don't expect the second part of the selection, the focusObject, to come earlier in the Automation tree than the first object. Please feel free to close this if that is expected behavior.
 
selection-brs.html
68 bytes View Download

Comment 1 by katie@chromium.org, Feb 20 2018

Summary: Unexpected selection for text followed by <br> elements - tree ordering (was: Unexpected selection for plain text followed by <br> elements - tree ordering)
Another example is attached. This is a paragraph of text, followed by a <br>, followed by another paragraph. When the first paragraph is selected by triple-clicking on it, the selection is:

> anchorObject.name
"Selected text"
> anchorOffset
0
> focusObject.name
undefined
> focusObject.role
"rootWebArea"
> focusOffset
15

The focusObject is not only before the anchorObject in the tree, but also the focusOffset is much further than the anchorObject's length.

"selected text" is only 13 characters long, but the focusOffset is 15. This seems like a true bug.

Note that if the <br> element is removed, selection seems to work as expected.

Javascript repro steps for this second example: 

var selection = window.getSelection()
selection.removeAllRanges()
var range = document.createRange()
var p = document.getElementsByTagName("p")[0]
range.setStart(p, 0)
var br = document.getElementsByTagName("br")[0]
range.setEnd(br, 0)
selection.removeAllRanges()
selection.addRange(range)
selection-brs2.html
101 bytes View Download

Comment 2 by katie@chromium.org, Mar 19 2018

Components: UI>Accessibility>SelectToSpeak

Comment 3 by katie@chromium.org, Mar 19 2018

Components: -UI>Accessibility
Labels: STS_selection
This bug requires improvements to selection and may automatically be fixed when relevant selection fixes are available through the automation API.

Sign in to add a comment