Changeset 257948 in webkit


Ignore:
Timestamp:
Mar 5, 2020 2:50:32 PM (4 years ago)
Author:
Andres Gonzalez
Message:

Fix for several failures of LayoutTests in isolated tree mode.
https://bugs.webkit.org/show_bug.cgi?id=208658

Reviewed by Chris Fleizach.

  • Exposes the scrollView method through the AXCoreObject interface so

that wrapper code can use it for both AXObjects and IsolatedObjects.

  • Fix for a crash/assert where InvalidAXID cannot be passed as key to

the HashMap methods.

  • accessibility/AccessibilityObject.h:
  • accessibility/AccessibilityObjectInterface.h:
  • accessibility/AccessibilityScrollView.h:
  • accessibility/isolatedtree/AXIsolatedObject.cpp:

(WebCore::AXIsolatedObject::scrollView const):

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

(WebCore::AXIsolatedTree::applyPendingChanges):

  • accessibility/mac/WebAccessibilityObjectWrapperMac.mm:

(-[WebAccessibilityObjectWrapper scrollViewParent]):
(-[WebAccessibilityObjectWrapper _accessibilityShowContextMenu]):

Location:
trunk/Source/WebCore
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r257947 r257948  
     12020-03-05  Andres Gonzalez  <andresg_22@apple.com>
     2
     3        Fix for several failures of LayoutTests in isolated tree mode.
     4        https://bugs.webkit.org/show_bug.cgi?id=208658
     5
     6        Reviewed by Chris Fleizach.
     7
     8        - Exposes the scrollView method through the AXCoreObject interface so
     9        that wrapper code can use it for both AXObjects and IsolatedObjects.
     10        - Fix for a crash/assert where InvalidAXID cannot be passed as key to
     11        the HashMap methods.
     12
     13        * accessibility/AccessibilityObject.h:
     14        * accessibility/AccessibilityObjectInterface.h:
     15        * accessibility/AccessibilityScrollView.h:
     16        * accessibility/isolatedtree/AXIsolatedObject.cpp:
     17        (WebCore::AXIsolatedObject::scrollView const):
     18        * accessibility/isolatedtree/AXIsolatedObject.h:
     19        * accessibility/isolatedtree/AXIsolatedTree.cpp:
     20        (WebCore::AXIsolatedTree::applyPendingChanges):
     21        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
     22        (-[WebAccessibilityObjectWrapper scrollViewParent]):
     23        (-[WebAccessibilityObjectWrapper _accessibilityShowContextMenu]):
     24
    1252020-03-05  Jacob Uphoff  <jacob_uphoff@apple.com>
    226
  • trunk/Source/WebCore/accessibility/AccessibilityObject.h

    r257760 r257948  
    467467    Frame* mainFrame() const override;
    468468    Document* topDocument() const override;
     469    ScrollView* scrollView() const override { return nullptr; }
    469470    ScrollView* scrollViewAncestor() const override;
    470471    String language() const override;
  • trunk/Source/WebCore/accessibility/AccessibilityObjectInterface.h

    r257760 r257948  
    876876    virtual Frame* mainFrame() const = 0;
    877877    virtual Document* topDocument() const = 0;
     878    virtual ScrollView* scrollView() const = 0;
    878879    virtual ScrollView* scrollViewAncestor() const = 0;
    879880    virtual String language() const = 0;
  • trunk/Source/WebCore/accessibility/AccessibilityScrollView.h

    r257760 r257948  
    3838    static Ref<AccessibilityScrollView> create(ScrollView*);
    3939    AccessibilityRole roleValue() const override { return AccessibilityRole::ScrollArea; }
    40     ScrollView* scrollView() const { return m_scrollView; }
     40    ScrollView* scrollView() const override { return m_scrollView; }
    4141
    4242    virtual ~AccessibilityScrollView();
  • trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp

    r257896 r257948  
    16121612}
    16131613
     1614ScrollView* AXIsolatedObject::scrollView() const
     1615{
     1616    if (auto* object = associatedAXObject())
     1617        return object->scrollView();
     1618    return nullptr;
     1619}
     1620
    16141621ScrollView* AXIsolatedObject::scrollViewAncestor() const
    16151622{
  • trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h

    r257760 r257948  
    828828    Frame* mainFrame() const override;
    829829    Document* topDocument() const override;
     830    ScrollView* scrollView() const override;
    830831    ScrollView* scrollViewAncestor() const override;
    831832    void childrenChanged() override;
  • trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp

    r257903 r257948  
    229229
    230230    for (const auto& axID : m_pendingRemovals) {
     231        if (axID == InvalidAXID)
     232            continue;
     233
    231234        if (auto object = nodeForID(axID))
    232235            object->detach(AccessibilityDetachmentType::ElementDestroyed);
     
    237240    for (const auto& item : m_pendingAppends) {
    238241        AXID axID = item.m_isolatedObject->objectID();
     242        if (axID == InvalidAXID)
     243            continue;
    239244
    240245        if (m_readerThreadNodeMap.get(axID) != &item.m_isolatedObject.get()) {
  • trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm

    r257760 r257948  
    22722272{
    22732273    return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([protectedSelf = RetainPtr<WebAccessibilityObjectWrapper>(self)] () -> RetainPtr<id> {
    2274         if (!is<AccessibilityScrollView>(protectedSelf.get().axBackingObject))
     2274        auto* backingObject = protectedSelf.get().axBackingObject;
     2275        if (!backingObject || !backingObject->isScrollView())
    22752276            return nil;
    22762277
    22772278        // If this scroll view provides it's parent object (because it's a sub-frame), then
    22782279        // we should not find the remoteAccessibilityParent.
    2279         if (protectedSelf.get().axBackingObject->parentObject())
     2280        if (backingObject->parentObject())
    22802281            return nil;
    22812282
    2282         ScrollView* scroll = downcast<AccessibilityScrollView>(*protectedSelf.get().axBackingObject).scrollView();
     2283        auto* scroll = backingObject->scrollView();
    22832284        if (!scroll)
    22842285            return nil;
     
    34223423        // Find the appropriate scroll view to use to convert the contents to the window.
    34233424        for (auto* parent = self.axBackingObject->parentObject(); parent; parent = parent->parentObject()) {
    3424             if (is<AccessibilityScrollView>(*parent)) {
    3425                 if (auto scrollView = downcast<AccessibilityScrollView>(*parent).scrollView()) {
     3425            if (parent->isScrollView()) {
     3426                if (auto* scrollView = parent->scrollView()) {
    34263427                    if (!frameView->platformWidget())
    34273428                        rect = scrollView->contentsToRootView(rect);
Note: See TracChangeset for help on using the changeset viewer.