Changeset 127370 in webkit


Ignore:
Timestamp:
Sep 1, 2012 3:51:25 AM (12 years ago)
Author:
commit-queue@webkit.org
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 expected accessible objects of DivRole
and ParagraphRole being ignored, in favor of including child blocks.

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

Source/WebCore:

Test: platform/gtk/accessibility/spans-paragraphs-and-divs.html

  • accessibility/AccessibilityObject.cpp:

(WebCore::AccessibilityObject::firstAnonymousBlockChild):
(WebCore):

  • accessibility/AccessibilityObject.h:

(AccessibilityObject):
New method to return the first child which is an anonymous block.

  • accessibility/gtk/AccessibilityObjectAtk.cpp:

(WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
Include paragraphs and divs which contain a non-nested anonymous block.

LayoutTests:

Added new test to verify that paragraphs and divs which contain anonymous
blocks are included in the accessible object hierarchy and have the correct
number of children with the expected role.

  • platform/gtk/accessibility/spans-paragraphs-and-divs-expected.txt: Added.
  • platform/gtk/accessibility/spans-paragraphs-and-divs.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r127369 r127370  
     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 expected accessible objects of DivRole
     7        and ParagraphRole being ignored, in favor of including child blocks.
     8
     9        Reviewed by Chris Fleizach.
     10
     11        Added new test to verify that paragraphs and divs which contain anonymous
     12        blocks are included in the accessible object hierarchy and have the correct
     13        number of children with the expected role.
     14
     15        * platform/gtk/accessibility/spans-paragraphs-and-divs-expected.txt: Added.
     16        * platform/gtk/accessibility/spans-paragraphs-and-divs.html: Added.
     17
    1182012-09-01  Zan Dobersek  <zandobersek@gmail.com>
    219
  • trunk/Source/WebCore/ChangeLog

    r127368 r127370  
     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 expected accessible objects of DivRole
     7        and ParagraphRole being ignored, in favor of including child blocks.
     8
     9        Reviewed by Chris Fleizach.
     10
     11        Test: platform/gtk/accessibility/spans-paragraphs-and-divs.html
     12
     13        * accessibility/AccessibilityObject.cpp:
     14        (WebCore::AccessibilityObject::firstAnonymousBlockChild):
     15        (WebCore):
     16        * accessibility/AccessibilityObject.h:
     17        (AccessibilityObject):
     18        New method to return the first child which is an anonymous block.
     19        * accessibility/gtk/AccessibilityObjectAtk.cpp:
     20        (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
     21        Include paragraphs and divs which contain a non-nested anonymous block.
     22
    1232012-09-01  Joanmarie Diggs  <jdiggs@igalia.com>
    224
  • trunk/Source/WebCore/accessibility/AccessibilityObject.cpp

    r126970 r127370  
    13521352
    13531353    return this == axObject || axObject->isDescendantOfObject(this);
     1354}
     1355
     1356AccessibilityObject* AccessibilityObject::firstAnonymousBlockChild() const
     1357{
     1358    for (AccessibilityObject* child = firstChild(); child; child = child->nextSibling()) {
     1359        if (child->renderer() && child->renderer()->isAnonymousBlock())
     1360            return child;
     1361    }
     1362    return 0;
    13541363}
    13551364
  • trunk/Source/WebCore/accessibility/AccessibilityObject.h

    r127084 r127370  
    587587    bool isDescendantOfObject(const AccessibilityObject*) const;
    588588    bool isAncestorOfObject(const AccessibilityObject*) const;
     589    AccessibilityObject* firstAnonymousBlockChild() const;
    589590   
    590591    static AccessibilityRole ariaRoleToWebCoreRole(const String&);
  • trunk/Source/WebCore/accessibility/gtk/AccessibilityObjectAtk.cpp

    r127368 r127370  
    7979        return IgnoreObject;
    8080
     81    // Given a paragraph or div containing a non-nested anonymous block, WebCore
     82    // ignores the paragraph or div and includes the block. We want the opposite:
     83    // ATs are expecting accessible objects associated with textual elements. They
     84    // usually have no need for the anonymous block. And when the wrong objects
     85    // get included or ignored, needed accessibility signals do not get emitted.
     86    if (role == ParagraphRole || role == DivRole) {
     87        AccessibilityObject* child = firstAnonymousBlockChild();
     88        if (!child)
     89            return DefaultBehavior;
     90
     91        child = child->firstChild();
     92        if (child->isLink() || !child->firstAnonymousBlockChild())
     93            return IncludeObject;
     94    }
     95
    8196    // Block spans result in objects of ATK_ROLE_PANEL which are almost always unwanted.
    8297    // However, if we ignore block spans whose parent is the body, the child controls
Note: See TracChangeset for help on using the changeset viewer.