• Victor Fei's avatar
    Reland "A11y:Expose labels of radio & checkbox when focused." · 03ed812f
    Victor Fei authored
    This is a reland of 9612f58a
    
    The change was reverted because of failure on linux-trusty-rel due to
    a mismatch in dump test result for "checkable" state.
    In this reland, I added a filter @AURALINUX-DENY:checkable to fix this
    test mismatch. This filter seems to accompany all other radio button dump
    tests for linux platform.
    
    Original change's description:
    > A11y:Expose labels of radio & checkbox when focused.
    >
    > Currently, when a label is referenced by a control of type radio or
    > checkbox, we set the label as ignored in the AXTree thereby excluding
    > it from being perceived by ATs.
    > However, for the case when the control (radio/checkbox) is a
    > descendant of the label and label is focusable (tabindex="0") but
    > control is to be omitted from focus (tabindex="-1"), ATs perceive
    > neither the label nor the control when tabbing through the content:
    >
    >     <label style="display:block" tabindex="0">
    >       radio button 1
    >       <input type="radio" id="radio1" tabindex="-1">
    >     </label>
    >
    >     <label style="display:block" for="radio2" tabindex="0">
    >       radio button 2
    >       <input type="radio" id="radio2" tabindex="-1">
    >     </label>
    >
    >     <label style="display:block" for="checkbox1" tabindex="0">
    >       checkbox 1
    >       <input type="checkbox" id="checkbox1" tabindex="-1">
    >     </label>
    >
    >     <label style="display:block" for="checkbox2" tabindex="0">
    >       checkbox 2
    >       <input type="checkbox" id="checkbox2" tabindex="-1">
    >     </label>
    >
    > This change fixes the above scenario by exposing labels (referenced by
    > radio or checkbox) when they are focusable. For all other cases when
    > labels are referenced by radio or checkbox, we keep the existing
    > behavior of ignoring the label.
    >
    > Note: Neither Firefox nor Edge legacy hides a label from AT when the
    > label is referenced by a control. On Firefox and Edge legacy, label
    > content will be read twice (focus on label and focus on control
    > respectively).
    > WAI-ARIA spec does not specify label should be ignored when associated
    > with a radio/checkbox control.
    >
    > Bug: 1040210
    > Change-Id: Ie7df5144dd2f0d285d97e6556adb46dcf2338f25
    > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1992017
    > Commit-Queue: Victor Fei <vicfei@microsoft.com>
    > Reviewed-by: Dominic Mazzoni <dmazzoni@chromium.org>
    > Cr-Commit-Position: refs/heads/master@{#731820}
    
    Bug: 1040210
    Change-Id: I09243796ec3affe648d46ec64d7dd20e20c5893f
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2002892Reviewed-by: default avatarKurt Catti-Schmidt <kschmi@microsoft.com>
    Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
    Commit-Queue: Victor Fei <vicfei@microsoft.com>
    Cr-Commit-Position: refs/heads/master@{#732931}
    03ed812f
input-radio-checkbox-label-expected-uia-win.txt 616 Bytes