Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Issue 2164813003: Fix visible position calculation in accessible setSelection (Closed)

Created:
4 years, 5 months ago by dmazzoni
Modified:
4 years, 4 months ago
CC:
aboxhall+watch_chromium.org, aboxhall, blink-reviews, chromium-reviews, dmazzoni+watch_chromium.org, dtseng+watch_chromium.org, haraken, je_julie, nektar+watch_chromium.org, yuzo+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

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 Committed: https://crrev.com/29605283e274ab1f520a07bce5507b691c117a55 Cr-Commit-Position: refs/heads/master@{#408520}

Patch Set 1 #

Total comments: 1

Patch Set 2 : Return null VisiblePosition #

Total comments: 11

Patch Set 3 : Address some feedback #

Total comments: 1

Patch Set 4 : Revert ChromeVox workaround and update test #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+90 lines, -60 lines) Patch
M chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_predicate.js View 1 2 3 1 chunk +0 lines, -10 lines 0 comments Download
M chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors.js View 1 2 3 2 chunks +22 lines, -25 lines 0 comments Download
M chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors_test.extjs View 1 2 3 1 chunk +2 lines, -2 lines 2 comments Download
A third_party/WebKit/LayoutTests/accessibility/set-selection-link.html View 1 2 1 chunk +28 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/editing/EditingUtilities.h View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp View 1 2 3 chunks +36 lines, -21 lines 0 comments Download

Messages

Total messages: 42 (19 generated)
dmazzoni
ojan: I need your owners review for EditingUtilities.h If you have time, there might be ...
4 years, 5 months ago (2016-07-20 18:34:14 UTC) #4
nektarios
We already have a function called int AXLayoutObject::indexForVisiblePosition(const VisiblePosition& position) const; Now that blink::indexForVisiblePosition has ...
4 years, 5 months ago (2016-07-20 18:58:44 UTC) #5
nektarios
Instead of returning bool from toVisiblePosition, could you return a null visible position?
4 years, 5 months ago (2016-07-20 19:04:06 UTC) #6
dmazzoni
On 2016/07/20 at 18:58:44, nektar wrote: > We already have a function called > int ...
4 years, 5 months ago (2016-07-20 20:36:29 UTC) #9
David Tseng
https://codereview.chromium.org/2164813003/diff/1/third_party/WebKit/LayoutTests/accessibility/set-selection-link.html File third_party/WebKit/LayoutTests/accessibility/set-selection-link.html (right): https://codereview.chromium.org/2164813003/diff/1/third_party/WebKit/LayoutTests/accessibility/set-selection-link.html#newcode22 third_party/WebKit/LayoutTests/accessibility/set-selection-link.html:22: var range = selection.getRangeAt(0); Can we verify the selection ...
4 years, 5 months ago (2016-07-20 20:39:15 UTC) #10
dmazzoni
On 2016/07/20 at 19:04:06, nektar wrote: > Instead of returning bool from toVisiblePosition, could you ...
4 years, 5 months ago (2016-07-20 20:40:25 UTC) #11
ojan
yosin or yoichio, mind doing this review?
4 years, 4 months ago (2016-07-27 00:43:27 UTC) #17
yosin_UTC9
https://codereview.chromium.org/2164813003/diff/20001/third_party/WebKit/LayoutTests/accessibility/set-selection-link.html File third_party/WebKit/LayoutTests/accessibility/set-selection-link.html (right): https://codereview.chromium.org/2164813003/diff/20001/third_party/WebKit/LayoutTests/accessibility/set-selection-link.html#newcode14 third_party/WebKit/LayoutTests/accessibility/set-selection-link.html:14: var axPara = accessibilityController.accessibleElementById("para"); It is better to have ...
4 years, 4 months ago (2016-07-27 01:31:14 UTC) #18
dmazzoni
Thanks for the review! I'm having trouble with the PlainTextRange suggestion, below. https://codereview.chromium.org/2164813003/diff/20001/third_party/WebKit/LayoutTests/accessibility/set-selection-link.html File third_party/WebKit/LayoutTests/accessibility/set-selection-link.html ...
4 years, 4 months ago (2016-07-27 06:45:17 UTC) #19
yosin_UTC9
https://codereview.chromium.org/2164813003/diff/20001/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp File third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp (right): https://codereview.chromium.org/2164813003/diff/20001/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp#newcode2007 third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp:2007: VisiblePosition nodePosition = blink::visiblePositionBeforeNode(*node); On 2016/07/27 at 06:45:17, dmazzoni ...
4 years, 4 months ago (2016-07-27 07:36:37 UTC) #20
dmazzoni
https://codereview.chromium.org/2164813003/diff/20001/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp File third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp (right): https://codereview.chromium.org/2164813003/diff/20001/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp#newcode2007 third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp:2007: VisiblePosition nodePosition = blink::visiblePositionBeforeNode(*node); > I thinkg following code ...
4 years, 4 months ago (2016-07-27 07:49:22 UTC) #21
yosin_UTC9
lgtm Sorry for confusion. It seems we should use indexForVisiblePosition() and visiblePositionForIndex(). Editing should provide ...
4 years, 4 months ago (2016-07-27 09:20:48 UTC) #22
dmazzoni
No problem, thanks. If you end up adding new editing APIs in the future that ...
4 years, 4 months ago (2016-07-27 16:37:15 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2164813003/40001
4 years, 4 months ago (2016-07-27 16:37:45 UTC) #25
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_ozone_rel_ng/builds/208404)
4 years, 4 months ago (2016-07-27 17:24:05 UTC) #27
ojan
lgtm
4 years, 4 months ago (2016-07-27 17:55:29 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2164813003/40001
4 years, 4 months ago (2016-07-27 17:55:51 UTC) #30
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_ozone_rel_ng/builds/208484)
4 years, 4 months ago (2016-07-27 18:34:27 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2164813003/60001
4 years, 4 months ago (2016-07-28 21:29:13 UTC) #36
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 4 months ago (2016-07-29 00:02:44 UTC) #37
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/29605283e274ab1f520a07bce5507b691c117a55 Cr-Commit-Position: refs/heads/master@{#408520}
4 years, 4 months ago (2016-07-29 00:04:17 UTC) #39
aboxhall
lgtm
4 years, 4 months ago (2016-08-01 21:34:03 UTC) #41
David Tseng
4 years, 4 months ago (2016-08-18 22:18:39 UTC) #42
Message was sent while issue was closed.
This cl helps, but it still doesn't fix some of the cases that work in the DOM.
I've marked two places in the ChromeVox test. Also, indexing into children e.g.
selecting a non-leaf text node, doesn't always work.

Can we get a mini-spec going? I can write one up if needed, but it should pull
directly from the DOM's specification of how selection works.

https://codereview.chromium.org/2164813003/diff/60001/chrome/browser/resource...
File
chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors_test.extjs
(right):

https://codereview.chromium.org/2164813003/diff/60001/chrome/browser/resource...
chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors_test.extjs:400:
assertEquals(testNode, root.anchorObject);
FYI; this is still wrong.

https://codereview.chromium.org/2164813003/diff/60001/chrome/browser/resource...
chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors_test.extjs:402:
assertEquals(4, root.anchorOffset);
As is this. The selection is on the ofSelection node.

Powered by Google App Engine
This is Rietveld 408576698