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

Issue 1637018: Reimplement web content accessibility by caching in browser process (Closed)

Created:
10 years, 8 months ago by dmazzoni
Modified:
9 years, 7 months ago
CC:
chromium-reviews, jam+cc_chromium.org, Paweł Hajdan Jr., brettw-cc_chromium.org, darin-cc_chromium.org, ben+cc_chromium.org, tfarina (gmail-do not use), dtseng
Visibility:
Public.

Description

Reimplement accessibility of web content by caching the entire accessibility tree in the browser process. Adds new RPCs for a browser tab to request accessibility info from a renderer; the renderer responds with a complete tree of accessibility metadata for the entire DOM, which is then cached in the RenderWidgetHostView. This part is cross-platform and will help with accessibility on both Windows and Mac OS X. For Windows, MSAA support for web content has been rewritten to use this new cache. Tested in JAWS and NVDA screen readers. Using Chrome with a screen reader is now fast and stable, unlike the previous implementation. However, note that most advanced functionality is still not supported, and much work remains to make Chrome work well with a screen reader. This is a necessary step to improve stability first. BUG=25564 BUG=13291 TEST=See http://codereview.chromium.org/1806001 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=46916

Patch Set 1 #

Patch Set 2 : In progress: Implement accessibility of web content by caching the... #

Patch Set 3 : '' #

Patch Set 4 : '' #

Total comments: 49

Patch Set 5 : Reimplement accessibility of web content by caching the entire ... #

Total comments: 84

Patch Set 6 : '' #

Patch Set 7 : '' #

Patch Set 8 : '' #

Patch Set 9 : '' #

Patch Set 10 : '' #

Total comments: 36

Patch Set 11 : Reimplement accessibility of web content by caching the entire ... #

Patch Set 12 : Reimplement accessibility of web content by caching the entire ... #

Patch Set 13 : '' #

Patch Set 14 : Reimplement accessibility of web content by caching the entire ... #

Patch Set 15 : '' #

Patch Set 16 : '' #

Patch Set 17 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+5484 lines, -1150 lines) Patch
chrome/browser/browser_accessibility.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 5 chunks +170 lines, -71 lines 0 comments Download
chrome/browser/browser_accessibility.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 9 chunks +341 lines, -314 lines 0 comments Download
chrome/browser/browser_accessibility_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +69 lines, -71 lines 0 comments Download
chrome/browser/browser_accessibility_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +97 lines, -128 lines 0 comments Download
chrome/browser/browser_accessibility_unittest.cc View 6 7 8 9 10 1 chunk +109 lines, -0 lines 0 comments Download
chrome/browser/renderer_host/render_view_host.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +5 lines, -0 lines 0 comments Download
chrome/browser/renderer_host/render_view_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +12 lines, -12 lines 0 comments Download
chrome/browser/renderer_host/render_widget_host_view.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +6 lines, -0 lines 0 comments Download
chrome/browser/renderer_host/render_widget_host_view_win.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 5 chunks +17 lines, -2 lines 0 comments Download
chrome/browser/renderer_host/render_widget_host_view_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +57 lines, -28 lines 0 comments Download
chrome/browser/tab_contents/tab_contents.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +9 lines, -0 lines 0 comments Download
chrome/browser/tab_contents/tab_contents.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +12 lines, -1 line 0 comments Download
chrome/chrome_browser.gypi View 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -0 lines 0 comments Download
chrome/chrome_tests.gypi View 6 7 8 9 10 11 12 13 14 15 16 4 chunks +4 lines, -0 lines 0 comments Download
chrome/common/render_messages.h View 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +66 lines, -75 lines 0 comments Download
chrome/common/render_messages_internal.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +8 lines, -14 lines 0 comments Download
chrome/common/render_messages_unittest.cc View 8 9 1 chunk +96 lines, -0 lines 0 comments Download
chrome/renderer/render_thread.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +2 lines, -0 lines 0 comments Download
chrome/renderer/render_view.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +4 lines, -6 lines 0 comments Download
chrome/renderer/render_view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 5 chunks +9 lines, -46 lines 0 comments Download
third_party/iaccessible2/ia2_api_all.idl View 3 4 5 6 7 8 9 10 11 1 chunk +4263 lines, -0 lines 0 comments Download
third_party/iaccessible2/iaccessible2.gyp View 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +42 lines, -0 lines 0 comments Download
webkit/glue/webaccessibility.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +42 lines, -110 lines 0 comments Download
webkit/glue/webaccessibility.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +43 lines, -206 lines 0 comments Download
webkit/glue/webaccessibilitymanager.h View 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +0 lines, -62 lines 0 comments Download
webkit/glue/webkit_glue.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +0 lines, -4 lines 0 comments Download

Messages

Total messages: 21 (0 generated)
Chris Guillory
Here are some comments after looking this over a bit. I'd like to play with ...
10 years, 8 months ago (2010-04-28 02:36:03 UTC) #1
dmazzoni
http://codereview.chromium.org/1637018/diff/44001/45001 File app/win/window_impl.cc (right): http://codereview.chromium.org/1637018/diff/44001/45001#newcode66 app/win/window_impl.cc:66: //name->assign(L"MozillaUIWindowClass"); On 2010/04/28 02:36:11, Chris Guillory wrote: > Perhaps ...
10 years, 8 months ago (2010-04-28 17:58:25 UTC) #2
Chris Guillory
Some follow up comments. http://codereview.chromium.org/1637018/diff/44001/45013 File chrome/browser/browser_accessibility.cc (right): http://codereview.chromium.org/1637018/diff/44001/45013#newcode162 chrome/browser/browser_accessibility.cc:162: BrowserAccessibility* target; For reference counting ...
10 years, 8 months ago (2010-04-28 18:46:50 UTC) #3
jam
Hi, because comments were sent before Dominic published this, it's not clear whether this change ...
10 years, 8 months ago (2010-04-28 22:45:11 UTC) #4
dmazzoni
Sorry for the confusion. Yes, this is ready for review, thanks! - Dominic On Wed, ...
10 years, 8 months ago (2010-04-28 23:31:23 UTC) #5
dmazzoni
http://codereview.chromium.org/1637018/diff/44001/45004 File webkit/glue/webaccessibility.h (left): http://codereview.chromium.org/1637018/diff/44001/45004#oldcode178 webkit/glue/webaccessibility.h:178: }; On 2010/04/28 02:36:11, Chris Guillory wrote: > DISALLOW_COPY_AND_ASSIGN(WebAccessibility); ...
10 years, 7 months ago (2010-04-29 15:32:58 UTC) #6
jam
very cool! mostly nits below in the comments. some questions: -what's the plan for when ...
10 years, 7 months ago (2010-04-29 16:48:04 UTC) #7
tfarina (gmail-do not use)
Hi Dominic, Just minor comments, in complement of Chris and John's comments. Thanks! http://codereview.chromium.org/1637018/diff/63001/23028 File ...
10 years, 7 months ago (2010-04-29 20:33:55 UTC) #8
dmazzoni
On 2010/04/29 16:48:04, John Abd-El-Malek wrote: > very cool! > > mostly nits below in ...
10 years, 7 months ago (2010-04-29 21:39:16 UTC) #9
tfarina (gmail-do not use)
On 2010/04/29 21:39:16, Dominic Mazzoni wrote: > What if this was a struct? Per style ...
10 years, 7 months ago (2010-04-29 21:42:59 UTC) #10
jam
On Thu, Apr 29, 2010 at 2:39 PM, <dmazzoni@chromium.org> wrote: > On 2010/04/29 16:48:04, John ...
10 years, 7 months ago (2010-04-29 21:49:09 UTC) #11
dmazzoni
On 2010/04/29 21:49:09, John Abd-El-Malek wrote: > > -I see that the tree is requested ...
10 years, 7 months ago (2010-04-30 18:21:19 UTC) #12
dmazzoni
Most issues addressed below. I added a unittest to make sure that we're not leaking ...
10 years, 7 months ago (2010-04-30 18:28:20 UTC) #13
jam
On Fri, Apr 30, 2010 at 11:21 AM, <dmazzoni@chromium.org> wrote: > On 2010/04/29 21:49:09, John ...
10 years, 7 months ago (2010-04-30 19:15:10 UTC) #14
dmazzoni
On Fri, Apr 30, 2010 at 12:14 PM, John Abd-El-Malek <jam@chromium.org>wrote: > I see, thanks ...
10 years, 7 months ago (2010-04-30 19:22:44 UTC) #15
jam
On Fri, Apr 30, 2010 at 12:22 PM, Dominic Mazzoni <dmazzoni@chromium.org>wrote: > On Fri, Apr ...
10 years, 7 months ago (2010-04-30 21:45:49 UTC) #16
jam
lgtm with at least the second comment taken care of http://codereview.chromium.org/1637018/diff/63001/23028 File chrome/browser/browser_accessibility.cc (right): http://codereview.chromium.org/1637018/diff/63001/23028#newcode185 ...
10 years, 7 months ago (2010-04-30 21:50:50 UTC) #17
dmazzoni
On 2010/04/30 21:50:50, John Abd-El-Malek wrote: > lgtm with at least the second comment taken ...
10 years, 7 months ago (2010-05-03 23:45:26 UTC) #18
Jonas Klink (Google)
http://codereview.chromium.org/1637018/diff/138001/108013 File chrome/browser/browser_accessibility.cc (right): http://codereview.chromium.org/1637018/diff/138001/108013#newcode118 chrome/browser/browser_accessibility.cc:118: Just out of curiosity: why did we remove the ...
10 years, 7 months ago (2010-05-04 17:51:16 UTC) #19
Chris Guillory
LGTM. Some nits. http://codereview.chromium.org/1637018/diff/138001/108013 File chrome/browser/browser_accessibility.cc (right): http://codereview.chromium.org/1637018/diff/138001/108013#newcode31 chrome/browser/browser_accessibility.cc:31: manager_ = manager; Nit: Use constructor ...
10 years, 7 months ago (2010-05-04 19:58:36 UTC) #20
dmazzoni
10 years, 7 months ago (2010-05-04 21:04:20 UTC) #21
Thanks for the comments! I made the changes and accessibility_win_browsertest
now passes.

http://codereview.chromium.org/1637018/diff/138001/108013
File chrome/browser/browser_accessibility.cc (right):

http://codereview.chromium.org/1637018/diff/138001/108013#newcode31
chrome/browser/browser_accessibility.cc:31: manager_ = manager;
On 2010/05/04 19:58:37, Chris Guillory wrote:
> Nit: Use constructor initializer list?

Can't, because a COM object has to use an empty constructor.

http://codereview.chromium.org/1637018/diff/138001/108013#newcode118
chrome/browser/browser_accessibility.cc:118: 
On 2010/05/04 17:51:16, Jonas Klink (Google) wrote:
> Just out of curiosity: why did we remove the implementation of the HitTest?
> IIRC, WebKit has a pretty good implementation on it on the renderer side, and
> it's not a function I would call deprecated quite yet.

Unfortunately there's no way we could query WebKit for this without having all
of the same problems we had before, with either blocking the UI or crashing in a
nested message pump.

I think we'll have to decide whether it makes sense to implement an
approximation of this on the browser side, or make this method an exception to
our rule and query the renderer.

For now, I think it's better to leave it out rather than check in something
potentially wrong or unstable.

http://codereview.chromium.org/1637018/diff/138001/108013#newcode175
chrome/browser/browser_accessibility.cc:175: case NAVDIR_FIRSTCHILD:
On 2010/05/04 17:51:16, Jonas Klink (Google) wrote:
> Can we add back the check for navigating to first/last child only being done
> from self? It's an obscure rule from MSAA, I know, but I'd like to stick to
the
> spec where we can.

Done.

http://codereview.chromium.org/1637018/diff/138001/108013#newcode195
chrome/browser/browser_accessibility.cc:195: end->vt = VT_EMPTY;
On 2010/05/04 17:51:16, Jonas Klink (Google) wrote:
> return S_FALSE if an object is not found in the specified direction.

Done.

http://codereview.chromium.org/1637018/diff/138001/108013#newcode212
chrome/browser/browser_accessibility.cc:212: return E_INVALIDARG;
On 2010/05/04 17:51:16, Jonas Klink (Google) wrote:
> Should we also set *disp_child = NULL?

Done.

http://codereview.chromium.org/1637018/diff/138001/108013#newcode246
chrome/browser/browser_accessibility.cc:246: 
On 2010/05/04 17:51:16, Jonas Klink (Google) wrote:
> Add check for empty string, return S_FALSE if true.

Done.

http://codereview.chromium.org/1637018/diff/138001/108013#newcode266
chrome/browser/browser_accessibility.cc:266: 
On 2010/05/04 17:51:16, Jonas Klink (Google) wrote:
> Add check for empty string, return S_FALSE if true.

Done.

http://codereview.chromium.org/1637018/diff/138001/108013#newcode308
chrome/browser/browser_accessibility.cc:308: 
On 2010/05/04 17:51:16, Jonas Klink (Google) wrote:
> Add check for empty string, return S_FALSE if true.

Done.

http://codereview.chromium.org/1637018/diff/138001/108013#newcode328
chrome/browser/browser_accessibility.cc:328: 
On 2010/05/04 17:51:16, Jonas Klink (Google) wrote:
> Add check for empty string, return S_FALSE if true.

Done.

http://codereview.chromium.org/1637018/diff/138001/108013#newcode347
chrome/browser/browser_accessibility.cc:347: 
On 2010/05/04 17:51:16, Jonas Klink (Google) wrote:
> Add check for empty string, return S_FALSE if true.

Done.

http://codereview.chromium.org/1637018/diff/138001/108013#newcode439
chrome/browser/browser_accessibility.cc:439: 
On 2010/05/04 17:51:16, Jonas Klink (Google) wrote:
> Why do we need the checks below when we're returning E_NOTIMPL anyway?

Agreed, in this case we probably won't ever implement it.

http://codereview.chromium.org/1637018/diff/138001/108013#newcode458
chrome/browser/browser_accessibility.cc:458: 
On 2010/05/04 17:51:16, Jonas Klink (Google) wrote:
> Are we planning to add this in a separate CL? According to Serotek, it's
> critical for supporting the virtual buffer... Or have we found otherwise? Just
> curious...

You can browse NVDA's virtual buffer without this function. I think this is
already enough for this CL, but let's add it soon.

http://codereview.chromium.org/1637018/diff/138001/108015
File chrome/browser/browser_accessibility.h (right):

http://codereview.chromium.org/1637018/diff/138001/108015#newcode278
chrome/browser/browser_accessibility.h:278: // so that calls to any of this
objects' methods immediately return
On 2010/05/04 19:58:37, Chris Guillory wrote:
> Nit: object's not objects'

Done.

http://codereview.chromium.org/1637018/diff/138001/108005
File chrome/browser/browser_accessibility_manager.cc (right):

http://codereview.chromium.org/1637018/diff/138001/108005#newcode114
chrome/browser/browser_accessibility_manager.cc:114: BrowserAccessibility*
instance = factory_->Create();
On 2010/05/04 19:58:37, Chris Guillory wrote:
> For simplicity can we have BrowserAccessibilityFactory::Create AddRef and
remove
> the NewReference call at the end of this function. 

Done.

http://codereview.chromium.org/1637018/diff/138001/108012
File chrome/browser/renderer_host/render_widget_host_view_win.cc (right):

http://codereview.chromium.org/1637018/diff/138001/108012#newcode1505
chrome/browser/renderer_host/render_widget_host_view_win.cc:1505: // we have is
now stale.
On 2010/05/04 19:58:37, Chris Guillory wrote:
> Nit: Reword last sentence. "what we have is now stale"?

Done.

http://codereview.chromium.org/1637018/diff/138001/108022
File chrome/common/render_messages.h (right):

http://codereview.chromium.org/1637018/diff/138001/108022#newcode2616
chrome/common/render_messages.h:2616: if (role >=
webkit_glue::WebAccessibility::ROLE_NONE &&
On 2010/05/04 19:58:37, Chris Guillory wrote:
> Nit: Can we remove the bounds check for role?

I think the check does add some safety, it guarantees the role will always be
something from the enum when unserializing.

http://codereview.chromium.org/1637018/diff/138001/108004
File webkit/glue/webaccessibility.h (right):

http://codereview.chromium.org/1637018/diff/138001/108004#newcode82
webkit/glue/webaccessibility.h:82: NUM_STATES
On 2010/05/04 19:58:37, Chris Guillory wrote:
> NUM_STATES isn't needed anymore.

Done.

Powered by Google App Engine
This is Rietveld 408576698