Use all language signals from renderer when setting the default language attribute on the root of the accessibility tree |
|||
Issue descriptionVoiceOver and IAccessible2 clients (Jaws and NVDA) have a way to specify the language of a particular part of an HTML page. When a page doesn't use the HTML lang attribute to mark in which language it is written, we default to English as the IAccessible2 Standard says, and we propagate this down from the root of the accessibility tree to all parts of the page. This creates problems for users whose default language is not the one used by the page. We should use the same signals used by the renderer and default the language to the one that the page declares it is using via HTTP headers and other information, and not only rely on the HTML lang attribute which is not consistently used by web authors.
,
Apr 17 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/6920d0af6b3a561b2768d11932a46d4e5e6ae5eb commit 6920d0af6b3a561b2768d11932a46d4e5e6ae5eb Author: Nektarios Paisios <nektar@chromium.org> Date: Tue Apr 17 19:02:45 2018 Add more signals when computing document language Browsers don't use only the HTML lang attribute to compute document language. We rely on the layout engine to compute language if a layout object is available, , otherwise we use our own logic. We also use our own logic if the layout engine cannot figure out the language. Our own logic first looks at the lang attribute on the current object, or any of its ancestors, followed by the "content-language" meta tag, the accept language header and the browsers default UI language. The latter two steps provide a mere guess, but are better than simply returning en-US, which is our current implementation for IAccessible2. This certainly is an improvement over the current situation, though not perfect by all means. R=dmazzoni@chromium.org Bug: 831186 Tested: Manually using foreign language sites without lang attributes and Chrome's the "--lang" command line flag, automatically using layout tests Change-Id: Ia80c31cc6dabdcea2aeec177aeda6b29d695019e Reviewed-on: https://chromium-review.googlesource.com/1011332 Commit-Queue: Nektarios Paisios <nektar@chromium.org> Reviewed-by: Dominic Mazzoni <dmazzoni@chromium.org> Reviewed-by: Nektarios Paisios <nektar@chromium.org> Cr-Commit-Position: refs/heads/master@{#551416} [modify] https://crrev.com/6920d0af6b3a561b2768d11932a46d4e5e6ae5eb/content/test/data/accessibility/css/language-expected-blink.txt [modify] https://crrev.com/6920d0af6b3a561b2768d11932a46d4e5e6ae5eb/content/test/data/accessibility/css/language-expected-mac.txt [modify] https://crrev.com/6920d0af6b3a561b2768d11932a46d4e5e6ae5eb/content/test/data/accessibility/css/language-expected-win.txt [modify] https://crrev.com/6920d0af6b3a561b2768d11932a46d4e5e6ae5eb/content/test/data/accessibility/css/language.html [add] https://crrev.com/6920d0af6b3a561b2768d11932a46d4e5e6ae5eb/third_party/WebKit/LayoutTests/accessibility/default-language.html [add] https://crrev.com/6920d0af6b3a561b2768d11932a46d4e5e6ae5eb/third_party/WebKit/LayoutTests/accessibility/language-attribute-and-meta-tag.html [delete] https://crrev.com/409283ee9ecb59de4ce542f1759b89b7c01ed309/third_party/WebKit/LayoutTests/accessibility/language-attribute-expected.txt [delete] https://crrev.com/409283ee9ecb59de4ce542f1759b89b7c01ed309/third_party/WebKit/LayoutTests/accessibility/language-attribute.html [add] https://crrev.com/6920d0af6b3a561b2768d11932a46d4e5e6ae5eb/third_party/WebKit/LayoutTests/accessibility/language-in-canvas.html [add] https://crrev.com/6920d0af6b3a561b2768d11932a46d4e5e6ae5eb/third_party/WebKit/LayoutTests/accessibility/language-meta-tag-dynamically-changing.html [modify] https://crrev.com/6920d0af6b3a561b2768d11932a46d4e5e6ae5eb/third_party/blink/renderer/modules/accessibility/ax_layout_object.cc [modify] https://crrev.com/6920d0af6b3a561b2768d11932a46d4e5e6ae5eb/third_party/blink/renderer/modules/accessibility/ax_layout_object.h [modify] https://crrev.com/6920d0af6b3a561b2768d11932a46d4e5e6ae5eb/third_party/blink/renderer/modules/accessibility/ax_object.cc [modify] https://crrev.com/6920d0af6b3a561b2768d11932a46d4e5e6ae5eb/third_party/blink/renderer/modules/accessibility/ax_object.h
,
Apr 17 2018
,
Apr 20 2018
|
|||
►
Sign in to add a comment |
|||
Comment 1 by leberly@chromium.org
, Apr 17 2018