Skip to content
  • cfleizach@apple.com's avatar
    AX: WebKit exposes AXTitleUIElement incorrectly on checkboxes and radio buttons · f157e081
    cfleizach@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=121039
    
    Reviewed by Sam Weinig.
    
    Source/WebCore: 
    
    Stop hiding <label> elements for radio buttons and checkboxes (and using the text inside them for the AXTitle).
    Instead, expose the <label> element as the titleUIElement if appropriate for the input.
    
    This implies:
       1) The web will no longer match MacOS behavior exactly (the text and the checkbox control are combined on MacOS into one element)
       2) But, the user will now be able to explore the <label> element which may include links or other important controls.
    I think sacrificing 1) here is a good tradeoff. The user will likely never know the difference in terms of output.
    
    Test: platform/mac/accessibility/label-elements-exposed-as-title-ui-elements.html
    
    * accessibility/AccessibilityNodeObject.cpp:
    (WebCore::AccessibilityNodeObject::titleElementText):
    (WebCore::AccessibilityNodeObject::title):
    * accessibility/AccessibilityRenderObject.cpp:
    (WebCore::AccessibilityRenderObject::hasTextAlternative):
    (WebCore::AccessibilityRenderObject::exposesTitleUIElement):
    
    LayoutTests: 
    
    * accessibility/label-for-control-hittest-expected.txt: Removed.
    * accessibility/label-for-control-hittest.html: Removed.
          We no longer need this test since we are not combining label + control into one element anymore.
    * accessibility/radio-button-group-members.html:
          Rewrite this test to be more modern (don't just dump attributes). 
          Instead test for what we want to know (whether radio button group members can identify their siblings)
    * accessibility/radio-button-title-label-expected.txt:
    * accessibility/radio-button-title-label.html:
          Rewrite this test so that it understands that controls won't hide their <label> elements.
    * platform/mac/accessibility/label-element-with-hidden-control-expected.txt:
    * platform/mac/accessibility/label-element-with-hidden-control.html:
          Update test to reflect that title UI elements are exposed for some controls.
    * platform/mac/accessibility/label-elements-exposed-as-title-ui-elements-expected.txt: Added.
    * platform/mac/accessibility/label-elements-exposed-as-title-ui-elements.html: Added.
          New test to explicitly confirm that <label> is exposed as a title UI element.
    * platform/mac/accessibility/radio-button-group-members-expected.txt:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155543 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    f157e081