Issue metadata
Sign in to add a comment
|
Blink accessible selection fails on simple example |
||||||||||||||||||||||||
Issue description
Snippet:
<p>this is a <a href="#test">test</a> of selection.</p>
Interactive output:
JS> a.role
"staticText"
a.name
" of selection."
JS> chrome.automation.setDocumentSelection({anchorObject: a, focusObject: a, anchorOffset: 0, focusOffset: 3})
undefined
a.root.anchorOffset
0
JS> a.root.anchorObject.name
"this is a "
JS> a.root.anchorObject.role
"staticText"
JS> a.root.focusOffset
3
JS> a.root.focusObject.name
"this is a "
expected:
a == a.root.focusObject == a.root.anchorObject
and
JS> a.root.anchorObject.name
"of selection"
JS> a.root.focusObject.name
"of selection"
,
Jul 19 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/d14eace0f228ce66113791ad781640e311d0e549 commit d14eace0f228ce66113791ad781640e311d0e549 Author: dtseng <dtseng@chromium.org> Date: Tue Jul 19 23:36:23 2016 Better work around for Blink selection issues. In the interest of getting something that works, conform to the way selections work in the Blink accessibility tree. For reference, the way it behaves is as follows: - on non-static text nodes, the index is a child index (0-based). - if the node is a static text node, the client must compute an offset as follows. Walk up to the parent of the static text, compute the length of all of the text descendants up to that static text, and finally add any remaining offsets into the static text in question. For example, the paragraph containing: child 1: static text name=this is a child 2: link child rstatic text name=test child 3: static text name=of selection exhibits this behavior. Furthermore, the link itself which contains a static text, starts with a 0-offset (following the same rules above). - after making a selection, the offsets behave sort of more like DOM indexes. For example, the above snippet when selecting offsets 13/14, gives back 'o' as expected but the anchor node is set to the static text for the link's static text at offset 4. The focus object is set to 1 for the last static text. This is surprising and probably has a lot of weird corner cases I haven't uncovered yet. BUG= 626385 TEST=chromevox_tests CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation Review-Url: https://codereview.chromium.org/2153213002 Cr-Commit-Position: refs/heads/master@{#406413} [modify] https://crrev.com/d14eace0f228ce66113791ad781640e311d0e549/chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_predicate.js [modify] https://crrev.com/d14eace0f228ce66113791ad781640e311d0e549/chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors.js [modify] https://crrev.com/d14eace0f228ce66113791ad781640e311d0e549/chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors_test.extjs
,
Jul 29 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/29605283e274ab1f520a07bce5507b691c117a55 commit 29605283e274ab1f520a07bce5507b691c117a55 Author: dmazzoni <dmazzoni@chromium.org> Date: Fri Jul 29 00:02:29 2016 Fix visible position calculation in accessible setSelection The accessible setSelection function is similar to the equivalent APIs to create a range and set the selection in the DOM, except that offsets are all visible positions, since the accessibility tree uses visible text (with whitespace collapsed, for example). The code that created a VisiblePosition from a text node and offset was incorrect if the text node had a previous sibling. Fix it so that the offset of the text node within its container is taken into account. BUG= 626385 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation Review-Url: https://codereview.chromium.org/2164813003 Cr-Commit-Position: refs/heads/master@{#408520} [modify] https://crrev.com/29605283e274ab1f520a07bce5507b691c117a55/chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_predicate.js [modify] https://crrev.com/29605283e274ab1f520a07bce5507b691c117a55/chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors.js [modify] https://crrev.com/29605283e274ab1f520a07bce5507b691c117a55/chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors_test.extjs [add] https://crrev.com/29605283e274ab1f520a07bce5507b691c117a55/third_party/WebKit/LayoutTests/accessibility/set-selection-link.html [modify] https://crrev.com/29605283e274ab1f520a07bce5507b691c117a55/third_party/WebKit/Source/core/editing/EditingUtilities.h [modify] https://crrev.com/29605283e274ab1f520a07bce5507b691c117a55/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
,
Sep 9 2016
|
|||||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||||
Comment 1 by dtseng@chromium.org
, Jul 7 2016