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

Issue 2301833005: Get rid of AX_LINE_BREAKS attribute to improve performance. (Closed)

Created:
4 years, 3 months ago by nektarios
Modified:
4 years, 2 months ago
Reviewers:
dmazzoni, David Tseng
CC:
aboxhall+watch_chromium.org, chromium-reviews, darin-cc_chromium.org, dmazzoni+watch_chromium.org, dtseng+watch_chromium.org, jam, je_julie, mlamouri+watch-content_chromium.org, nektar+watch_chromium.org, yuzo+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Get rid of AX_LINE_BREAKS attribute to improve performance and clarity. 1. Attribute renamed to line_start_offsets. 2. Now computed on browser side and cached. 3. Attribute should not be used directly but line start offsets should be retrieved via |AXNode::GetOrComputeLineStartOffsets|. 4. Should work on all kinds of text fields and both in automation and other platforms. TESTED=Manually with Voiceover ChromeVox Jaws and NVDA, existing Windows browser tests, new Automation API tests, existing ChromeVox tests R=dmazzoni@chromium.org, dtseng@chromium.org BUG=642337 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation Committed: https://crrev.com/91926613c70561f2ddeb86896496e7306518c747 Cr-Commit-Position: refs/heads/master@{#420807}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Fixed line length issue. #

Total comments: 7

Patch Set 3 : Fixed some more errors. #

Patch Set 4 : Addressed all comments. #

Patch Set 5 : Fixed Mac compilation. #

Patch Set 6 : Fixed another small syntax error. #

Patch Set 7 : Fixed a variable initialization error. #

Patch Set 8 : Fixed Mac compilation issue. #

Patch Set 9 : Fixed API test. #

Patch Set 10 : More automation fixes. #

Total comments: 2

Patch Set 11 : Changed length() to length. #

Patch Set 12 : Fixed spelling error. #

Patch Set 13 : Fixed test. #

Patch Set 14 : Re-worded comment. #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+170 lines, -37 lines) Patch
M chrome/browser/accessibility/accessibility_extension_api.cc View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/extensions/api/automation/automation_apitest.cc View 1 1 chunk +7 lines, -0 lines 0 comments Download
M chrome/browser/resources/chromeos/chromevox/common/chrome_extension_externs.js View 1 2 5 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/resources/chromeos/chromevox/cvox2/background/editing.js View 1 2 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/renderer/extensions/automation_internal_custom_bindings.cc View 1 2 5 1 chunk +14 lines, -0 lines 0 comments Download
M chrome/renderer/resources/extensions/automation/automation_node.js View 1 2 5 4 chunks +15 lines, -1 line 0 comments Download
A chrome/test/data/extensions/api_test/automation/sites/line_start_offsets.html View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +19 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/automation/tests/tabs/line_start_offsets.html View 1 2 3 5 13 1 chunk +7 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/automation/tests/tabs/line_start_offsets.js View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +33 lines, -0 lines 0 comments Download
M content/browser/accessibility/browser_accessibility.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M content/browser/accessibility/browser_accessibility.cc View 1 3 chunks +8 lines, -4 lines 0 comments Download
M content/browser/accessibility/browser_accessibility_cocoa.mm View 1 2 3 4 5 6 7 8 9 10 13 2 chunks +4 lines, -4 lines 0 comments Download
M content/browser/accessibility/browser_accessibility_win.cc View 1 2 3 4 5 6 7 8 9 10 13 1 chunk +2 lines, -4 lines 0 comments Download
M content/browser/accessibility/browser_accessibility_win_unittest.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M content/renderer/accessibility/blink_ax_tree_source.cc View 1 2 1 chunk +0 lines, -10 lines 0 comments Download
M ui/accessibility/ax_enums.idl View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +6 lines, -3 lines 0 comments Download
M ui/accessibility/ax_node.h View 1 1 chunk +9 lines, -0 lines 0 comments Download
M ui/accessibility/ax_node.cc View 1 2 3 4 5 6 2 chunks +33 lines, -0 lines 3 comments Download
M ui/accessibility/ax_node_data.cc View 1 2 2 chunks +3 lines, -3 lines 0 comments Download
M ui/accessibility/ax_tree_combiner.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 83 (48 generated)
nektarios
4 years, 3 months ago (2016-09-02 15:41:16 UTC) #1
dmazzoni
Overall looks great, thanks for doing this so fast! Is this covered by any existing ...
4 years, 3 months ago (2016-09-02 15:55:00 UTC) #2
chromium-reviews
Drive by. How was performance measured? Please run through try bots. ChromeVox uses line breaks ...
4 years, 3 months ago (2016-09-02 16:01:13 UTC) #4
David Tseng
On 2016/09/02 15:55:00, dmazzoni wrote: > Overall looks great, thanks for doing this so fast! ...
4 years, 3 months ago (2016-09-02 16:08:12 UTC) #5
chromium-reviews
On 9/2/2016 12:01 PM, David Tseng wrote: > Drive by. > > How was performance ...
4 years, 3 months ago (2016-09-02 17:52:06 UTC) #6
dmazzoni
I don't think ChromeVox uses the AX_LINE_BREAKS attribute, though, so I think we're fine.
4 years, 3 months ago (2016-09-07 16:22:48 UTC) #7
nektarios
I completely re-wrote this. Should work for all editable fields, including content editable. But only ...
4 years, 3 months ago (2016-09-13 01:00:16 UTC) #8
dmazzoni
Overall looks great, my only concern is the new test. If it's not working right ...
4 years, 3 months ago (2016-09-13 17:29:38 UTC) #11
David Tseng
Thanks for the re-write. You still need to get rid of lineBreaks under chrome/browser/resources/chromeos/chromevox/*. Also, ...
4 years, 3 months ago (2016-09-13 17:41:27 UTC) #12
dmazzoni
On Tue, Sep 13, 2016 at 10:41 AM <dtseng@chromium.org> wrote: > Thanks for the re-write. ...
4 years, 3 months ago (2016-09-13 17:50:44 UTC) #13
David Tseng
On Tue, Sep 13, 2016 at 10:50 AM, Dominic Mazzoni <dmazzoni@chromium.org> wrote: > On Tue, ...
4 years, 3 months ago (2016-09-13 18:09:59 UTC) #14
chromium-reviews
Okay, I'll try and do some performance measurements and also modify ChromeVox to use this ...
4 years, 3 months ago (2016-09-13 18:13:08 UTC) #15
chromium-reviews
> https://codereview.chromium.org/2301833005/diff/20001/chrome/browser/accessibility/accessibility_extension_api.cc > File chrome/browser/accessibility/accessibility_extension_api.cc (left): > > https://codereview.chromium.org/2301833005/diff/20001/chrome/browser/accessibility/accessibility_extension_api.cc#oldcode13 > chrome/browser/accessibility/accessibility_extension_api.cc:13: #include > "chrome/browser/accessibility/accessibility_extension_api.h" > ...
4 years, 3 months ago (2016-09-16 20:08:13 UTC) #16
dmazzoni
On Fri, Sep 16, 2016 at 1:08 PM 'Nektarios Paisios' via Chromium-reviews < chromium-reviews@chromium.org> wrote: ...
4 years, 3 months ago (2016-09-16 22:08:16 UTC) #17
nektarios
I did some rough measurements with DLOG statements. I logged the start and end times ...
4 years, 3 months ago (2016-09-19 21:02:26 UTC) #43
nektarios
Ready for another look.
4 years, 3 months ago (2016-09-19 21:14:47 UTC) #46
dmazzoni
lgtm https://codereview.chromium.org/2301833005/diff/180001/chrome/test/data/extensions/api_test/automation/sites/line_start_offsets.html File chrome/test/data/extensions/api_test/automation/sites/line_start_offsets.html (right): https://codereview.chromium.org/2301833005/diff/180001/chrome/test/data/extensions/api_test/automation/sites/line_start_offsets.html#newcode17 chrome/test/data/extensions/api_test/automation/sites/line_start_offsets.html:17: Line thre.</textarea> Nit: thre -> three https://codereview.chromium.org/2301833005/diff/180001/ui/accessibility/ax_enums.idl File ...
4 years, 3 months ago (2016-09-21 18:47:38 UTC) #53
chromium-reviews
https://codereview.chromium.org/2301833005/diff/180001/ui/accessibility/ax_enums.idl > File ui/accessibility/ax_enums.idl (right): > > https://codereview.chromium.org/2301833005/diff/180001/ui/accessibility/ax_enums.idl#newcode418 > ui/accessibility/ax_enums.idl:418: // For all objects with ...
4 years, 2 months ago (2016-09-22 15:54:03 UTC) #58
dmazzoni
On Thu, Sep 22, 2016 at 8:53 AM Nektarios Paisios <nektar@google.com> wrote: > In order ...
4 years, 2 months ago (2016-09-22 16:17:47 UTC) #59
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/2301833005/240001
4 years, 2 months ago (2016-09-22 21:56:19 UTC) #63
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/2301833005/260001
4 years, 2 months ago (2016-09-22 22:08:02 UTC) #66
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/265125)
4 years, 2 months ago (2016-09-22 22:18:23 UTC) #68
nektarios
David also needs to approve.
4 years, 2 months ago (2016-09-23 00:25:23 UTC) #69
David Tseng
lgtm Thanks for doing the measurements. I guess I'm still not seeing the referenced O(n^2) ...
4 years, 2 months ago (2016-09-23 01:43:58 UTC) #70
David Tseng
https://codereview.chromium.org/2301833005/diff/260001/ui/accessibility/ax_node.cc File ui/accessibility/ax_node.cc (right): https://codereview.chromium.org/2301833005/diff/260001/ui/accessibility/ax_node.cc#newcode76 ui/accessibility/ax_node.cc:76: child->ComputeLineStartOffsets(line_offsets, end_offset); Also, before I forget, if performance is ...
4 years, 2 months ago (2016-09-23 12:43:03 UTC) #71
chromium-reviews
ui/accessibility/ax_node.cc:76: > child->ComputeLineStartOffsets(line_offsets, end_offset); > Also, before I forget, if performance is a concern here, ...
4 years, 2 months ago (2016-09-23 16:14:16 UTC) #72
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/2301833005/260001
4 years, 2 months ago (2016-09-24 00:16:01 UTC) #74
commit-bot: I haz the power
Committed patchset #14 (id:260001)
4 years, 2 months ago (2016-09-24 01:25:18 UTC) #75
commit-bot: I haz the power
Patchset 14 (id:??) landed as https://crrev.com/91926613c70561f2ddeb86896496e7306518c747 Cr-Commit-Position: refs/heads/master@{#420807}
4 years, 2 months ago (2016-09-24 01:28:23 UTC) #77
David Tseng
Sorry guys; this cl regressed text area/content editable behaviors e.g. crbug.com/652059. We're now returning the ...
4 years, 2 months ago (2016-10-06 20:44:20 UTC) #78
David Tseng
I've worked around the issue commented on here in: https://codereview.chromium.org/2395293002/ but this will probably bite ...
4 years, 2 months ago (2016-10-06 21:28:03 UTC) #79
dmazzoni
Nektarios's change was a step in the right direction. AX_LINE_BREAKS was horrible from a performance ...
4 years, 2 months ago (2016-10-10 05:07:24 UTC) #80
chromium-reviews
I didn't handle the situation at the end of the object correctly. There might or ...
4 years, 2 months ago (2016-10-10 13:50:20 UTC) #81
chromium-reviews
Dominic, usually, when regressions occur, reverting is what I've seen happen to reduce confusion especially ...
4 years, 2 months ago (2016-10-10 15:43:15 UTC) #82
chromium-reviews
4 years, 2 months ago (2016-10-10 16:46:12 UTC) #83
Message was sent while issue was closed.
Please see bug and include me on the fix
https://bugs.chromium.org/p/chromium/issues/detail?id=652059

Assigning to nektar@ for underlying regression.

Line breaks should from at least ChromeVox's perspective and probably most
other screen readers work as follows:
- consider leaves that are *text* nodes. Text nodes are nodes who's
accessible name is text from the *DOM*. Thus, nodes with roles of static
text, line break should be included. However, nodes of other types who's
names from are not from contents, should not be considered like divs with
an raia label and that are also leaves.
- line breaks, as calculated by the AX module in ui/, should:
provide the index where a line break occurs. If it is a hard line break,
the index should contain a new line character. If it is a soft line break,
the index should fall on the start of the next line and the client should
use affinity to resolve where the caret actually is.


On Mon, Oct 10, 2016 at 8:43 AM, David Tseng <dtseng@google.com> wrote:

> Dominic,
> usually, when regressions occur, reverting is what I've seen happen to
> reduce confusion especially considering now that a merge is required making
> a bit more work for everyone. The particular failing case was discussed
> offline. We can enough to fix without introducing more bugs.
>
>
> Nektarios, if you are fine with fixing this as a beta block, then I guess
> we can leave the cl in.
>
> Also, can you rename line start offsets? It doesn't really fit since the
> first line is not covered.
>
>  Sorry for pushing on this, but as an api, it should be given more
> scrutiny and not rushed through for other reasons. Thanks!
>
> On Mon, Oct 10, 2016 at 6:50 AM, 'Nektarios Paisios' via Chromium-reviews
> <chromium-reviews@chromium.org> wrote:
>
>> I didn't handle the situation at the end of the object correctly. There
>> might or there might not be a line break at the end of an object. It would
>> have been better to never return anything.
>> Similarly, I should handle the possibility of a line break at the
>> beginning of an object. Now, if there is a start of a line at the
>> beginning, I don't return 0 as an offset.
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Chromium-reviews" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to chromium-reviews+unsubscribe@chromium.org.
>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups
"Chromium-reviews" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698