Commit 208cdbc7 authored by David Tseng's avatar David Tseng Committed by Commit Bot

Use nextOnline for the line break predicate

R=akihiroota@chromium.org

AX-Relnotes: ChromeVox will combine inline elements such as <strong>, <b> when navigating by line (Search+up/down).
Fixed: 1116646
Change-Id: Ide1afd67dc4492847968f42b81e4d7251f4cc95c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2372927
Commit-Queue: David Tseng <dtseng@chromium.org>
Reviewed-by: default avatarAkihiro Ota <akihiroota@chromium.org>
Cr-Commit-Position: refs/heads/master@{#801204}
parent b35365b7
......@@ -2892,3 +2892,17 @@ TEST_F('ChromeVoxBackgroundTest', 'SortDirection', function() {
.replay();
});
});
TEST_F('ChromeVoxBackgroundTest', 'InlineLineNavigation', function() {
const mockFeedback = this.createMockFeedback();
this.runWithLoadedTree(
`
<p>start</p>
<p><strong>This</strong><b>is</b>a <em>test</em></p>
`,
function(root) {
mockFeedback.call(doCmd('nextLine'))
.expectSpeech('This', 'is', 'a ', 'test')
.replay();
});
});
......@@ -293,7 +293,10 @@ AutomationPredicate = class {
* @return {boolean}
*/
static linebreak(first, second) {
// TODO(dtseng): Use next/previousOnLine once available.
if (first.nextOnLine == second) {
return false;
}
const fl = first.unclippedLocation;
const sl = second.unclippedLocation;
return fl.top != sl.top || (fl.top + fl.height != sl.top + sl.height);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment