Changeset 127368 in webkit


Ignore:
Timestamp:
Sep 1, 2012 1:53:50 AM (12 years ago)
Author:
zandobersek@gmail.com
Message:

[Gtk] No accessible caret-moved events found in certain content
https://bugs.webkit.org/show_bug.cgi?id=72811

Part of the bug was due to extraneous accessible objects resulting
from unignored inline and block spans.

Patch by Joanmarie Diggs <jdiggs@igalia.com> on 2012-09-01
Reviewed by Chris Fleizach.

Source/WebCore:

Test: platform/gtk/accessibility/spans.html

  • accessibility/AccessibilityRenderObject.cpp:

(WebCore::AccessibilityRenderObject::accessibilityIsIgnored): Ignore objects that have spanTag tag name.

  • accessibility/gtk/AccessibilityObjectAtk.cpp:

(WebCore::AccessibilityObject::accessibilityPlatformIncludesObject): Ignore most anonymous blocks.

  • accessibility/gtk/WebKitAccessibleWrapperAtk.cpp:

(roleIsTextType): Add ListItem to the roles which should implement AtkText.

LayoutTests:

Added new test, updated the results of one test to reflect the fix,
corrected a test with a mismatched element tag.

  • platform/gtk/accessibility/aria-roles-unignored-expected.txt: Corrected results having fixed tag.
  • platform/gtk/accessibility/aria-roles-unignored.html: Fixed mismatched element tag.
  • platform/gtk/accessibility/media-element-expected.txt: Updated to reflect removal of extraneous object.
  • platform/gtk/accessibility/spans-expected.txt: Added.
  • platform/gtk/accessibility/spans.html: Added.
Location:
trunk
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r127367 r127368  
     12012-09-01  Joanmarie Diggs  <jdiggs@igalia.com>
     2
     3        [Gtk] No accessible caret-moved events found in certain content
     4        https://bugs.webkit.org/show_bug.cgi?id=72811
     5
     6        Part of the bug was due to extraneous accessible objects resulting
     7        from unignored inline and block spans.
     8
     9        Reviewed by Chris Fleizach.
     10
     11        Added new test, updated the results of one test to reflect the fix,
     12        corrected a test with a mismatched element tag.
     13
     14        * platform/gtk/accessibility/aria-roles-unignored-expected.txt: Corrected results having fixed tag.
     15        * platform/gtk/accessibility/aria-roles-unignored.html: Fixed mismatched element tag.
     16        * platform/gtk/accessibility/media-element-expected.txt: Updated to reflect removal of extraneous object.
     17        * platform/gtk/accessibility/spans-expected.txt: Added.
     18        * platform/gtk/accessibility/spans.html: Added.
     19
    1202012-09-01  Joanmarie Diggs  <jdiggs@igalia.com>
    221
  • trunk/LayoutTests/platform/gtk/accessibility/aria-roles-unignored-expected.txt

    r82459 r127368  
    1919PASS element.role is 'AXRole: form'
    2020PASS element.role is 'AXRole: push button'
    21 PASS element.role is 'AXRole: panel'
     21PASS element.role is 'AXRole: section'
    2222PASS element.role is 'AXRole: entry'
    2323PASS successfullyParsed is true
  • trunk/LayoutTests/platform/gtk/accessibility/aria-roles-unignored.html

    r120111 r127368  
    1515<form role="button">Just a button <button name="button" value="Button">Click me!</button></form>
    1616
    17 <div>Just some text inside a div</form>
     17<div>Just some text inside a div</div>
    1818<div role="textbox">This div is contains a textbox (an entry)</div>
    1919
     
    5252    // Divs
    5353    element = webArea.childAtIndex(5);
    54     shouldBe("element.role", "'AXRole: panel'");
     54    shouldBe("element.role", "'AXRole: section'");
    5555    element = webArea.childAtIndex(6);
    5656    shouldBe("element.role", "'AXRole: entry'");
  • trunk/LayoutTests/platform/gtk/accessibility/media-element-expected.txt

    r111046 r127368  
    1111        description: AXDescription: play
    1212        role: AXRole: push button
    13 
    14 
    15         description: AXDescription:
    16         role: AXRole: panel
    1713
    1814
  • trunk/Source/WebCore/ChangeLog

    r127367 r127368  
     12012-09-01  Joanmarie Diggs  <jdiggs@igalia.com>
     2
     3        [Gtk] No accessible caret-moved events found in certain content
     4        https://bugs.webkit.org/show_bug.cgi?id=72811
     5
     6        Part of the bug was due to extraneous accessible objects resulting
     7        from unignored inline and block spans.
     8
     9        Reviewed by Chris Fleizach.
     10
     11        Test: platform/gtk/accessibility/spans.html
     12
     13        * accessibility/AccessibilityRenderObject.cpp:
     14        (WebCore::AccessibilityRenderObject::accessibilityIsIgnored): Ignore objects that have spanTag tag name.
     15        * accessibility/gtk/AccessibilityObjectAtk.cpp:
     16        (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject): Ignore most anonymous blocks.
     17        * accessibility/gtk/WebKitAccessibleWrapperAtk.cpp:
     18        (roleIsTextType): Add ListItem to the roles which should implement AtkText.
     19
    1202012-09-01  Joanmarie Diggs  <jdiggs@igalia.com>
    221
  • trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp

    r127084 r127368  
    19541954    if (supportsARIAAttributes())
    19551955        return false;
     1956
     1957    // <span> tags are inline tags and not meant to convey information if they have no other aria
     1958    // information on them. If we don't ignore them, they may emit signals expected to come from
     1959    // their parent. In addition, because included spans are GroupRole objects, and GroupRole
     1960    // objects are often containers with meaningful information, the inclusion of a span can have
     1961    // the side effect of causing the immediate parent accessible to be ignored. This is especially
     1962    // problematic for platforms which have distinct roles for textual block elements.
     1963    if (node && node->hasTagName(spanTag))
     1964        return true;
    19561965   
    19571966    if (m_renderer->isBlockFlow() && m_renderer->childrenInline() && !canSetFocusAttribute())
  • trunk/Source/WebCore/accessibility/gtk/AccessibilityObjectAtk.cpp

    r125692 r127368  
    7979        return IgnoreObject;
    8080
     81    // Block spans result in objects of ATK_ROLE_PANEL which are almost always unwanted.
     82    // However, if we ignore block spans whose parent is the body, the child controls
     83    // will become immediate children of the ATK_ROLE_DOCUMENT_FRAME and any text will
     84    // become text within the document frame itself. This ultimately may be what we want
     85    // and would largely be consistent with what we see from Gecko. However, ignoring
     86    // spans whose parent is the body changes the current behavior we see from WebCore.
     87    // Until we have sufficient time to properly analyze these cases, we will defer to
     88    // WebCore. We only check that the parent is not aria because we do not expect
     89    // anonymous blocks which are aria-related to themselves have an aria role, nor
     90    // have we encountered instances where the parent of an anonymous block also lacked
     91    // an aria role but the grandparent had one.
     92    if (renderer()->isAnonymousBlock() && !parent->renderer()->isBody()
     93        && parent->ariaRoleAttribute() == UnknownRole)
     94        return IgnoreObject;
     95
    8196    return DefaultBehavior;
    8297}
  • trunk/Source/WebCore/accessibility/gtk/WebKitAccessibleWrapperAtk.cpp

    r127084 r127368  
    821821static bool roleIsTextType(AccessibilityRole role)
    822822{
    823     return role == ParagraphRole || role == HeadingRole || role == DivRole || role == CellRole;
     823    return role == ParagraphRole || role == HeadingRole || role == DivRole || role == CellRole || role == ListItemRole;
    824824}
    825825
Note: See TracChangeset for help on using the changeset viewer.