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

Issue 23983002: Expose InlineTextBoxes in the accessibility tree. (Closed)

Created:
7 years, 3 months ago by dmazzoni
Modified:
7 years, 2 months ago
CC:
blink-reviews, jamesr, aboxhall, eae+blinkwatch, leviw+renderwatch, abarth-chromium, dglazkov+blink, jchaffraix+rendering
Visibility:
Public.

Description

Expose InlineTextBoxes in the accessibility tree. The goal here is for the serialized accessibility tree exposed by Blink to have enough information that the embedder can compute the bounding rectangle for an arbitrary text range, and determine the word that any given character offset belongs to. Supporting text with rotations or 3-D transforms is a non-goal. This will enable us to complete the implementation of native accessibility APIs that request the bounding box of text ranges, and make it possible to enable software like ZoomText to highlight individual words on a webpage as they're spoken. Previously, accessibility objects with a role of StaticText would be leaf nodes. Now we expose all of the InlineTextBoxes within that object using a new type, AccessibilityInlineTextBox, and furthermore we expose the pixel offset of each character within the inline text box, and the start and end position of all words within each inline text box. Every InlineTextBox has a single direction - right, left, up, or down. This change also makes it more efficient to update the accessibility tree when the user is editing a large textarea or contenteditable. Previously, the entire contents had to be updated every time. Now typically only the InlineTextBoxes corresponding to the current paragraph need to change. Making this change would break some Chromium tests, so we add a new flag to enable this new functionality. Once Chromium has been updated to depend on having inline text boxes in the accessibility tree, we can remove the flag. BUG=98977 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=160020

Patch Set 1 #

Patch Set 2 : git --no-find-copies #

Patch Set 3 : Fix typo #

Patch Set 4 : Added platform-specific expectations #

Total comments: 5

Patch Set 5 : Remove platform differences from inline-text-textarea output #

Total comments: 26

Patch Set 6 : Fix bug found in review, make one test more robust #

Total comments: 4

Patch Set 7 : Address review feedback #

Total comments: 1

Patch Set 8 : Rebase #

Patch Set 9 : Fix compile errors after rebase #

Patch Set 10 : Fix win compile and linux test expectation #

Patch Set 11 : Support vertical text, explicitly test for use-after-free #

Patch Set 12 : How about calling the abstraction AbstractInlineTextBox #

Patch Set 13 : Remove unused include #

Total comments: 2

Patch Set 14 : Get rid of isRTL, update text expectations on Linux and Win #

Patch Set 15 : Rebase #

Patch Set 16 : Fix include path #

Total comments: 6

Patch Set 17 : Decouple AbstractInlineTextBox #

Patch Set 18 : Fix asan-caught error #

Patch Set 19 : Rebase #

Total comments: 22

Patch Set 20 : Address feedback #

Total comments: 24

Patch Set 21 : Address last feedback #

Patch Set 22 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1732 lines, -16 lines) Patch
M LayoutTests/accessibility/adjacent-continuations-cause-assertion-failure-expected.txt View 1 chunk +3 lines, -0 lines 0 comments Download
M LayoutTests/accessibility/inline-continuations.html View 1 chunk +1 line, -1 line 0 comments Download
A LayoutTests/accessibility/inline-text-bidi-bounds-for-range.html View 1 2 3 4 5 6 7 8 9 10 1 chunk +73 lines, -0 lines 0 comments Download
A LayoutTests/accessibility/inline-text-bounds-for-range.html View 1 chunk +75 lines, -0 lines 0 comments Download
A LayoutTests/accessibility/inline-text-changes.html View 1 2 3 4 5 6 7 8 9 10 1 chunk +49 lines, -0 lines 0 comments Download
A LayoutTests/accessibility/inline-text-changes-expected.txt View 1 2 3 4 5 6 7 8 9 10 1 chunk +19 lines, -0 lines 0 comments Download
A LayoutTests/accessibility/inline-text-textarea.html View 1 2 3 4 5 1 chunk +54 lines, -0 lines 0 comments Download
A LayoutTests/accessibility/inline-text-textarea-expected.txt View 1 2 3 4 5 1 chunk +12 lines, -0 lines 0 comments Download
A LayoutTests/accessibility/inline-text-word-boundaries.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +44 lines, -0 lines 0 comments Download
M LayoutTests/accessibility/legend-expected.txt View 1 chunk +2 lines, -0 lines 0 comments Download
A LayoutTests/platform/linux/accessibility/inline-text-bidi-bounds-for-range-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +85 lines, -0 lines 0 comments Download
A LayoutTests/platform/linux/accessibility/inline-text-bounds-for-range-expected.txt View 1 2 3 1 chunk +38 lines, -0 lines 0 comments Download
A LayoutTests/platform/linux/accessibility/inline-text-word-boundaries-expected.txt View 1 2 3 4 5 6 7 8 9 1 chunk +63 lines, -0 lines 0 comments Download
A LayoutTests/platform/mac/accessibility/inline-text-bidi-bounds-for-range-expected.txt View 1 2 3 4 5 6 7 8 9 10 1 chunk +85 lines, -0 lines 0 comments Download
A LayoutTests/platform/mac/accessibility/inline-text-bounds-for-range-expected.txt View 1 2 3 1 chunk +38 lines, -0 lines 0 comments Download
A LayoutTests/platform/mac/accessibility/inline-text-word-boundaries-expected.txt View 1 2 3 4 5 6 1 chunk +63 lines, -0 lines 0 comments Download
A LayoutTests/platform/win/accessibility/inline-text-bidi-bounds-for-range-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +85 lines, -0 lines 0 comments Download
A LayoutTests/platform/win/accessibility/inline-text-bounds-for-range-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +38 lines, -0 lines 0 comments Download
A LayoutTests/platform/win/accessibility/inline-text-word-boundaries-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +63 lines, -0 lines 0 comments Download
A + Source/core/accessibility/AXInlineTextBox.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 chunks +22 lines, -13 lines 0 comments Download
A Source/core/accessibility/AXInlineTextBox.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +154 lines, -0 lines 0 comments Download
M Source/core/accessibility/AXNodeObject.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +3 lines, -1 line 0 comments Download
M Source/core/accessibility/AXObject.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 3 chunks +15 lines, -0 lines 0 comments Download
M Source/core/accessibility/AXObjectCache.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 8 chunks +14 lines, -0 lines 0 comments Download
M Source/core/accessibility/AXObjectCache.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 7 chunks +54 lines, -0 lines 0 comments Download
M Source/core/accessibility/AXRenderObject.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 chunks +3 lines, -0 lines 0 comments Download
M Source/core/accessibility/AXRenderObject.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 5 chunks +35 lines, -0 lines 0 comments Download
M Source/core/core.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 chunks +4 lines, -0 lines 0 comments Download
A Source/core/rendering/AbstractInlineTextBox.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +98 lines, -0 lines 0 comments Download
A Source/core/rendering/AbstractInlineTextBox.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +163 lines, -0 lines 0 comments Download
M Source/core/rendering/InlineTextBox.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +3 lines, -0 lines 0 comments Download
M Source/core/rendering/InlineTextBox.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 3 chunks +25 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderText.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 chunks +4 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderText.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 chunks +6 lines, -0 lines 0 comments Download
M Source/testing/runner/AccessibilityController.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +1 line, -0 lines 0 comments Download
M Source/testing/runner/WebAXObjectProxy.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +2 lines, -0 lines 0 comments Download
M Source/testing/runner/WebAXObjectProxy.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 5 chunks +166 lines, -1 line 0 comments Download
M Source/web/AssertMatchingEnums.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 chunks +6 lines, -0 lines 0 comments Download
M Source/web/WebAXObject.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 chunks +47 lines, -0 lines 0 comments Download
M public/web/WebAXEnums.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +9 lines, -0 lines 0 comments Download
M public/web/WebAXObject.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 chunks +8 lines, -0 lines 0 comments Download

Messages

Total messages: 28 (0 generated)
dmazzoni
aboxhall: primary review esprehn: could you please help review this and make sure my use ...
7 years, 3 months ago (2013-09-05 07:08:45 UTC) #1
dglazkov
lgtm public/ stuff.
7 years, 3 months ago (2013-09-05 17:23:26 UTC) #2
aboxhall
This is great! https://codereview.chromium.org/23983002/diff/10001/LayoutTests/platform/linux/accessibility/inline-text-word-boundaries-expected.txt File LayoutTests/platform/linux/accessibility/inline-text-word-boundaries-expected.txt (right): https://codereview.chromium.org/23983002/diff/10001/LayoutTests/platform/linux/accessibility/inline-text-word-boundaries-expected.txt#newcode47 LayoutTests/platform/linux/accessibility/inline-text-word-boundaries-expected.txt:47: Character 38: 'x' word=(38, 39): 'x' ...
7 years, 3 months ago (2013-09-06 17:19:20 UTC) #3
dmazzoni
https://codereview.chromium.org/23983002/diff/10001/LayoutTests/platform/linux/accessibility/inline-text-word-boundaries-expected.txt File LayoutTests/platform/linux/accessibility/inline-text-word-boundaries-expected.txt (right): https://codereview.chromium.org/23983002/diff/10001/LayoutTests/platform/linux/accessibility/inline-text-word-boundaries-expected.txt#newcode47 LayoutTests/platform/linux/accessibility/inline-text-word-boundaries-expected.txt:47: Character 38: 'x' word=(38, 39): 'x' On 2013/09/06 17:19:21, ...
7 years, 3 months ago (2013-09-06 20:25:26 UTC) #4
aboxhall
lgtm https://codereview.chromium.org/23983002/diff/10001/LayoutTests/platform/linux/accessibility/inline-text-word-boundaries-expected.txt File LayoutTests/platform/linux/accessibility/inline-text-word-boundaries-expected.txt (right): https://codereview.chromium.org/23983002/diff/10001/LayoutTests/platform/linux/accessibility/inline-text-word-boundaries-expected.txt#newcode47 LayoutTests/platform/linux/accessibility/inline-text-word-boundaries-expected.txt:47: Character 38: 'x' word=(38, 39): 'x' On 2013/09/06 ...
7 years, 3 months ago (2013-09-06 20:51:12 UTC) #5
esprehn
Is this code so hot that you can't use a Vector<float> ? :) https://codereview.chromium.org/23983002/diff/24001/Source/core/rendering/InlineTextBox.cpp File ...
7 years, 3 months ago (2013-09-08 19:05:14 UTC) #6
dmazzoni
On 2013/09/08 19:05:14, esprehn wrote: > Is this code so hot that you can't use ...
7 years, 3 months ago (2013-09-09 07:03:13 UTC) #7
eseidel
https://codereview.chromium.org/23983002/diff/31001/Source/core/rendering/InlineTextBox.cpp File Source/core/rendering/InlineTextBox.cpp (right): https://codereview.chromium.org/23983002/diff/31001/Source/core/rendering/InlineTextBox.cpp#newcode1489 Source/core/rendering/InlineTextBox.cpp:1489: void InlineTextBox::characterWidths(Vector<float>& widths) const This function seems OK to ...
7 years, 3 months ago (2013-09-10 22:22:22 UTC) #8
dmazzoni
On 2013/09/10 22:22:22, eseidel wrote: > https://codereview.chromium.org/23983002/diff/31001/Source/core/rendering/InlineTextBox.cpp > File Source/core/rendering/InlineTextBox.cpp (right): > > https://codereview.chromium.org/23983002/diff/31001/Source/core/rendering/InlineTextBox.cpp#newcode1489 > ...
7 years, 3 months ago (2013-09-10 22:26:38 UTC) #9
eseidel
You mentioned offline that this was for highilghting word bounds via AX software. Would knowing ...
7 years, 3 months ago (2013-09-10 22:53:13 UTC) #10
eseidel
Another oddity here is that AX will have to be text-direction aware with this setup. ...
7 years, 3 months ago (2013-09-10 22:54:19 UTC) #11
dmazzoni
On 2013/09/10 22:53:13, eseidel wrote: > You mentioned offline that this was for highilghting word ...
7 years, 3 months ago (2013-09-10 23:07:00 UTC) #12
dmazzoni
On 2013/09/10 22:54:19, eseidel wrote: > Another oddity here is that AX will have to ...
7 years, 3 months ago (2013-09-10 23:10:16 UTC) #13
eseidel
I also meant writing-direction, i.e. vertical text (which may itself be LTR or RTL in ...
7 years, 3 months ago (2013-09-11 15:00:25 UTC) #14
dmazzoni
Eric and I just had an offline conversation. To summarize, let's have the renderer module ...
7 years, 3 months ago (2013-09-11 16:39:08 UTC) #15
dmazzoni
@leviw, @eseidel: Ready for another look. 1. I've abstracted InlineTextBox so that the accessibility module ...
7 years, 2 months ago (2013-10-01 07:44:57 UTC) #16
igoroliveira
https://codereview.chromium.org/23983002/diff/63001/Source/core/rendering/InlineTextBox.cpp File Source/core/rendering/InlineTextBox.cpp (right): https://codereview.chromium.org/23983002/diff/63001/Source/core/rendering/InlineTextBox.cpp#newcode1503 Source/core/rendering/InlineTextBox.cpp:1503: bool InlineTextBox::isRTL() const InlineBox::direction() is not enough here?
7 years, 2 months ago (2013-10-03 03:11:52 UTC) #17
dmazzoni
https://codereview.chromium.org/23983002/diff/63001/Source/core/rendering/InlineTextBox.cpp File Source/core/rendering/InlineTextBox.cpp (right): https://codereview.chromium.org/23983002/diff/63001/Source/core/rendering/InlineTextBox.cpp#newcode1503 Source/core/rendering/InlineTextBox.cpp:1503: bool InlineTextBox::isRTL() const On 2013/10/03 03:11:55, igoroliveira wrote: > ...
7 years, 2 months ago (2013-10-03 03:22:33 UTC) #18
eseidel
Thank you for taking the time to go over this patch again. Unfortunately I fear ...
7 years, 2 months ago (2013-10-03 20:36:54 UTC) #19
leviw_travelin_and_unemployed
https://codereview.chromium.org/23983002/diff/77001/Source/core/rendering/RenderText.h File Source/core/rendering/RenderText.h (right): https://codereview.chromium.org/23983002/diff/77001/Source/core/rendering/RenderText.h#newcode158 Source/core/rendering/RenderText.h:158: AbstractInlineTextBox* firstInlineTextBox() const; On 2013/10/03 20:36:55, eseidel wrote: > ...
7 years, 2 months ago (2013-10-03 20:42:06 UTC) #20
dmazzoni
OK, here's an approach that's a lot more decoupled. Is this moving in the right ...
7 years, 2 months ago (2013-10-04 07:56:09 UTC) #21
dmazzoni
Uploaded for real this time.
7 years, 2 months ago (2013-10-07 19:22:37 UTC) #22
eseidel
lgtm. I recommend getting alice or someone more familiar with the AX-Web bits to sign ...
7 years, 2 months ago (2013-10-17 18:43:26 UTC) #23
dmazzoni
Thanks! Eric, all of your feedback should be addressed. Any final comments from any other ...
7 years, 2 months ago (2013-10-17 20:39:19 UTC) #24
aboxhall
lgtm Basically looks good with some nits. https://codereview.chromium.org/23983002/diff/112001/LayoutTests/accessibility/inline-text-word-boundaries.html File LayoutTests/accessibility/inline-text-word-boundaries.html (right): https://codereview.chromium.org/23983002/diff/112001/LayoutTests/accessibility/inline-text-word-boundaries.html#newcode10 LayoutTests/accessibility/inline-text-word-boundaries.html:10: Ace ten ...
7 years, 2 months ago (2013-10-17 22:27:53 UTC) #25
dmazzoni
https://codereview.chromium.org/23983002/diff/112001/LayoutTests/accessibility/inline-text-word-boundaries.html File LayoutTests/accessibility/inline-text-word-boundaries.html (right): https://codereview.chromium.org/23983002/diff/112001/LayoutTests/accessibility/inline-text-word-boundaries.html#newcode10 LayoutTests/accessibility/inline-text-word-boundaries.html:10: Ace ten twenty-one thirty-five. xxxxxxxxxxxxxxxxxxx On 2013/10/17 22:27:55, aboxhall ...
7 years, 2 months ago (2013-10-19 06:48:06 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dmazzoni@chromium.org/23983002/153001
7 years, 2 months ago (2013-10-19 21:04:06 UTC) #27
commit-bot: I haz the power
7 years, 2 months ago (2013-10-19 22:55:44 UTC) #28
Message was sent while issue was closed.
Change committed as 160020

Powered by Google App Engine
This is Rietveld 408576698