⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 275664 in webkit


Ignore:
Timestamp:
Apr 8, 2021, 11:23:02 AM (6 years ago)
Author:
Andres Gonzalez
Message:

VoiceOver does not echo text insertions and deletions when a contenteditable div has a non editable descendant element with a content editable child
​https://bugs.webkit.org/show_bug.cgi?id=223818

Reviewed by Chris Fleizach.

Source/WebCore:

Test: accessibility/nested-textareas-value-changed-notifications.html

AXObjectCache::textChanged now only notifies the closest non-native text
control of value changes. This avoid the problem of multiple value
changed notifications in a row when there are nested text areas.
Removed AccessibilityRenderObject::textChanged and moved that
functionality to AXObjectCache::textChanged, where it belongs.

  • accessibility/AXObjectCache.cpp:

(WebCore::AXObjectCache::textChanged):

  • accessibility/AccessibilityObject.h:
  • accessibility/AccessibilityObjectInterface.h:
  • accessibility/AccessibilityRenderObject.cpp:

(WebCore::AccessibilityRenderObject::textChanged): Deleted.

  • accessibility/AccessibilityRenderObject.h:
  • accessibility/isolatedtree/AXIsolatedObject.cpp:

(WebCore::AXIsolatedObject::textChanged): Deleted.

  • accessibility/isolatedtree/AXIsolatedObject.h:

LayoutTests:

  • accessibility/nested-textareas-value-changed-notifications-expected.txt: Added.
  • accessibility/nested-textareas-value-changed-notifications.html: Added.
Location:
trunk
Files:
2 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r275659 r275664  
     12021-04-08  Andres Gonzalez  <andresg_22@apple.com>
     2
     3        VoiceOver does not echo text insertions and deletions when a contenteditable div has a non editable descendant element with a content editable child
     4        https://bugs.webkit.org/show_bug.cgi?id=223818
     5
     6        Reviewed by Chris Fleizach.
     7
     8        * accessibility/nested-textareas-value-changed-notifications-expected.txt: Added.
     9        * accessibility/nested-textareas-value-changed-notifications.html: Added.
     10
    1112021-04-08  Sihui Liu  <sihui_liu@apple.com>
    212
  • trunk/LayoutTests/platform/mac-wk1/TestExpectations

    r275580 r275664  
    981981accessibility/mac/aria-details.html [ Skip ]
    982982accessibility/mac/aria-errormessage.html [ Skip ]
     983accessibility/nested-textareas-value-changed-notifications.html [ Skip ]
    983984
    984985# <rdar://problem/61066929> [ Stress GC ] flaky JSC::ExceptionScope::assertNoException crash under WebCore::ReadableStreamDefaultController
  • trunk/LayoutTests/platform/win/TestExpectations

    r275508 r275664  
    34513451accessibility/inline-continuations.html [ Skip ]
    34523452accessibility/list-detection.html [ Skip ]
     3453accessibility/nested-textareas-value-changed-notifications.html [ Skip ]
    34533454accessibility/minimal-table-with-aria-is-data-table.html [ Failure ]
    34543455accessibility/presentation-role-iframe.html [ Failure ]
  • trunk/Source/WebCore/ChangeLog

    r275662 r275664  
     12021-04-08  Andres Gonzalez  <andresg_22@apple.com>
     2
     3        VoiceOver does not echo text insertions and deletions when a contenteditable div has a non editable descendant element with a content editable child
     4        https://bugs.webkit.org/show_bug.cgi?id=223818
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Test: accessibility/nested-textareas-value-changed-notifications.html
     9
     10        AXObjectCache::textChanged now only notifies the closest non-native text
     11        control of value changes. This avoid the problem of multiple value
     12        changed notifications in a row when there are nested text areas.
     13        Removed AccessibilityRenderObject::textChanged and moved that
     14        functionality to AXObjectCache::textChanged, where it belongs.
     15
     16        * accessibility/AXObjectCache.cpp:
     17        (WebCore::AXObjectCache::textChanged):
     18        * accessibility/AccessibilityObject.h:
     19        * accessibility/AccessibilityObjectInterface.h:
     20        * accessibility/AccessibilityRenderObject.cpp:
     21        (WebCore::AccessibilityRenderObject::textChanged): Deleted.
     22        * accessibility/AccessibilityRenderObject.h:
     23        * accessibility/isolatedtree/AXIsolatedObject.cpp:
     24        (WebCore::AXIsolatedObject::textChanged): Deleted.
     25        * accessibility/isolatedtree/AXIsolatedObject.h:
     26
    1272021-04-08  Youenn Fablet  <youenn@apple.com>
    228
  • trunk/Source/WebCore/accessibility/AXObjectCache.cpp

    r275425 r275664  
    980980}
    981981
    982 void AXObjectCache::textChanged(AccessibilityObject* obj)
    983 {
    984     if (!obj)
    985         return;
    986 
    987     bool parentAlreadyExists = obj->parentObjectIfExists();
    988     obj->textChanged();
    989     postNotification(obj, obj->document(), AXObjectCache::AXTextChanged);
    990     if (parentAlreadyExists)
    991         obj->notifyIfIgnoredValueChanged();
     982void AXObjectCache::textChanged(AccessibilityObject* object)
     983{
     984    AXTRACE("AXObjectCache::textChanged");
     985    AXLOG(object);
     986
     987    if (!object)
     988        return;
     989
     990    // If this element supports ARIA live regions, or is part of a region with an ARIA editable role,
     991    // then notify the AT of changes.
     992    bool notifiedNonNativeTextControl = false;
     993    for (auto* parent = object; parent; parent = parent->parentObject()) {
     994        if (parent->supportsLiveRegion())
     995            postLiveRegionChangeNotification(parent);
     996
     997        if (!notifiedNonNativeTextControl && parent->isNonNativeTextControl()) {
     998            postNotification(parent, parent->document(), AXValueChanged);
     999            notifiedNonNativeTextControl = true;
     1000        }
     1001    }
     1002
     1003    postNotification(object, object->document(), AXTextChanged);
     1004
     1005    if (object->parentObjectIfExists())
     1006        object->notifyIfIgnoredValueChanged();
    9921007}
    9931008
  • trunk/Source/WebCore/accessibility/AccessibilityObject.h

    r275217 r275664  
    483483
    484484    void childrenChanged() override { }
    485     void textChanged() override { }
    486485    void updateAccessibilityRole() override { }
    487486    const AccessibilityChildrenVector& children(bool updateChildrenIfNeeded = true) override;
    … …  
    792791    bool allowsTextRanges() const;
    793792    unsigned getLengthForTextRange() const;
    794 
    795793    String innerHTML() const override;
    796794    String outerHTML() const override;
  • trunk/Source/WebCore/accessibility/AccessibilityObjectInterface.h

    r275217 r275664  
    12231223
    12241224    virtual void childrenChanged() = 0;
    1225     virtual void textChanged() = 0;
    12261225    virtual void updateAccessibilityRole() = 0;
    12271226
  • trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp

    r275217 r275664  
    31583158}
    31593159
    3160 void AccessibilityRenderObject::textChanged()
    3161 {
    3162     // If this element supports ARIA live regions, or is part of a region with an ARIA editable role,
    3163     // then notify the AT of changes.
    3164     AXObjectCache* cache = axObjectCache();
    3165     if (!cache)
    3166         return;
    3167    
    3168     for (RenderObject* renderParent = renderer(); renderParent; renderParent = renderParent->parent()) {
    3169         AccessibilityObject* parent = cache->get(renderParent);
    3170         if (!parent)
    3171             continue;
    3172        
    3173         if (parent->supportsLiveRegion())
    3174             cache->postLiveRegionChangeNotification(parent);
    3175 
    3176         if (parent->isNonNativeTextControl())
    3177             cache->postNotification(renderParent, AXObjectCache::AXValueChanged);
    3178     }
    3179 }
    3180 
    31813160void AccessibilityRenderObject::clearChildren()
    31823161{
  • trunk/Source/WebCore/accessibility/AccessibilityRenderObject.h

    r275217 r275664  
    152152    AccessibilityOrientation orientation() const override;
    153153
    154     void textChanged() override;
    155154    void addChildren() override;
    156155    bool canHaveChildren() const override;
  • trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp

    r275217 r275664  
    21182118}
    21192119
    2120 void AXIsolatedObject::textChanged()
    2121 {
    2122     ASSERT_NOT_REACHED();
    2123 }
    2124 
    21252120void AXIsolatedObject::updateAccessibilityRole()
    21262121{
  • trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h

    r275217 r275664  
    588588    ScrollView* scrollViewAncestor() const override;
    589589    void childrenChanged() override;
    590     void textChanged() override;
    591590    void updateAccessibilityRole() override;
    592591    void addChildren() override;
Note: See TracChangeset for help on using the changeset viewer.