• Dominic Mazzoni's avatar
    Fix accessible name for input type=file · 21c89bbc
    Dominic Mazzoni authored
    A file picker control (<input type=file>) is exposed as
    a button in the accessibility tree. Previously the
    filename chosen was only exposed in the accessible value,
    like with other input elements - but most screen readers
    were not reading the value, since it's not normal to
    read the value of a button. So users couldn't tell what
    file was chosen, or whether a file was chosen at all.
    
    Fix this by making the accessible name include both the
    filename (as already exposed in the value) and the
    text of the "Choose File" button.
    
    Add a test to confirm this is working correctly when a
    file is selected.
    
    Bug: 903655
    
    Change-Id: Iaa22ee66e21079014999e8af3d762ee481c85c54
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2340163
    Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
    Reviewed-by: default avatarAaron Leventhal <aleventhal@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#795655}
    21c89bbc
file-upload-button-name.html 1.68 KB