• Nektarios Paisios's avatar
    Add more signals when computing document language · 6920d0af
    Nektarios Paisios authored
    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: default avatarDominic Mazzoni <dmazzoni@chromium.org>
    Reviewed-by: default avatarNektarios Paisios <nektar@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#551416}
    6920d0af
language-expected-win.txt 404 Bytes