|
|
Use text affinity to return correct accessible line boundaries.
Our calculations of line boundaries for accessibility were wrong
in certain cases where the character offset is ambiguous. It's
possible for there to be a line break immediately between two
characters, such that one character is on the previous line and
one is on the next line. If the character index is between those
two characters, previously we had no way of knowing if the cursor
was on the first line or second line.
Fix this by passing through the text affinity of the selection
focus and anchor from Blink all the way into Chrome's accessibility
tree. If the affinity is upstream, it means the cursor is on the
previous line, and downstream means the next line.
I added a LayoutTest for Blink and a unit test for Chrome. I also
manually verified this fixes at least one broken case with VoiceOver,
see the bug for a very specific repro.
BUG= 632450
Committed: https://crrev.com/25a949f677564d5e7ee1e7379528fd9c79a6ed6e
Cr-Commit-Position: refs/heads/master@{#408989}
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+453 lines, -110 lines) |
Patch |
 |
M |
chrome/common/extensions/chrome_extension_messages.h
|
View
|
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
 |
M |
components/test_runner/web_ax_object_proxy.h
|
View
|
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
 |
M |
components/test_runner/web_ax_object_proxy.cc
|
View
|
|
4 chunks |
+50 lines, -8 lines |
0 comments
|
Download
|
 |
M |
content/browser/accessibility/browser_accessibility.h
|
View
|
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
content/browser/accessibility/browser_accessibility.cc
|
View
|
|
3 chunks |
+20 lines, -8 lines |
0 comments
|
Download
|
 |
M |
content/browser/accessibility/browser_accessibility_cocoa.mm
|
View
|
|
19 chunks |
+81 lines, -40 lines |
0 comments
|
Download
|
 |
M |
content/browser/accessibility/browser_accessibility_manager_unittest.cc
|
View
|
|
1 chunk |
+47 lines, -0 lines |
0 comments
|
Download
|
 |
M |
content/browser/accessibility/browser_accessibility_win.cc
|
View
|
1
2
|
1 chunk |
+12 lines, -3 lines |
0 comments
|
Download
|
 |
M |
content/common/accessibility_messages.h
|
View
|
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
 |
M |
content/public/common/common_param_traits_macros.h
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
M |
content/renderer/accessibility/blink_ax_enum_conversion.h
|
View
|
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
 |
M |
content/renderer/accessibility/blink_ax_enum_conversion.cc
|
View
|
|
1 chunk |
+11 lines, -0 lines |
0 comments
|
Download
|
 |
M |
content/renderer/accessibility/blink_ax_tree_source.cc
|
View
|
|
2 chunks |
+5 lines, -1 line |
0 comments
|
Download
|
 |
A |
third_party/WebKit/LayoutTests/accessibility/selection-affinity.html
|
View
|
|
1 chunk |
+87 lines, -0 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
|
View
|
|
4 chunks |
+17 lines, -13 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/modules/accessibility/AXObject.h
|
View
|
|
1 chunk |
+17 lines, -2 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/web/AssertMatchingEnums.cpp
|
View
|
|
1 chunk |
+3 lines, -0 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/web/WebAXObject.cpp
|
View
|
|
2 chunks |
+8 lines, -4 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/public/web/WebAXEnums.h
|
View
|
|
1 chunk |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/public/web/WebAXObject.h
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
ui/accessibility/ax_enums.idl
|
View
|
|
1 chunk |
+5 lines, -0 lines |
0 comments
|
Download
|
 |
M |
ui/accessibility/ax_text_utils.h
|
View
|
|
2 chunks |
+3 lines, -1 line |
0 comments
|
Download
|
 |
M |
ui/accessibility/ax_text_utils.cc
|
View
|
|
2 chunks |
+12 lines, -3 lines |
0 comments
|
Download
|
 |
M |
ui/accessibility/ax_text_utils_unittest.cc
|
View
|
|
3 chunks |
+41 lines, -20 lines |
0 comments
|
Download
|
 |
M |
ui/accessibility/ax_tree_data.h
|
View
|
|
1 chunk |
+5 lines, -1 line |
0 comments
|
Download
|
 |
M |
ui/accessibility/ax_tree_data.cc
|
View
|
|
3 chunks |
+8 lines, -2 lines |
0 comments
|
Download
|
 |
M |
ui/accessibility/platform/ax_platform_node_win.cc
|
View
|
1
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
Total messages: 28 (17 generated)
|