Changeset 228390 in webkit


Ignore:
Timestamp:
Feb 12, 2018 12:40:23 PM (6 years ago)
Author:
Matt Lewis
Message:

Unreviewed, rolling out r228376.

This caused accessibility/mac/selection-notification-focus-
change.html to become flaky on macOS.

Reverted changeset:

"AX: defer focusedUIElement notifications"
https://bugs.webkit.org/show_bug.cgi?id=182643
https://trac.webkit.org/changeset/228376

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r228384 r228390  
     12018-02-12  Matt Lewis  <jlewis3@apple.com>
     2
     3        Unreviewed, rolling out r228376.
     4
     5        This caused accessibility/mac/selection-notification-focus-
     6        change.html to become flaky on macOS.
     7
     8        Reverted changeset:
     9
     10        "AX: defer focusedUIElement notifications"
     11        https://bugs.webkit.org/show_bug.cgi?id=182643
     12        https://trac.webkit.org/changeset/228376
     13
    1142018-02-12  Per Arne Vollan  <pvollan@apple.com>
    215
  • trunk/LayoutTests/accessibility/mac/aria-menu-item-selected-notification.html

    r228376 r228390  
    4747        document.getElementById("item1").focus();
    4848
    49         setTimeout(function() {
    50             // Trigger notification through aria-selected.
    51             document.getElementById("item2").setAttribute("aria-selected", "true");
     49        // Trigger notification through aria-selected.
     50        document.getElementById("item2").setAttribute("aria-selected", "true");
    5251
    53             setTimeout(function() {
    54                 // Ensure we don't get a notification when aria-selected is false.
    55                 document.getElementById("item2").setAttribute("aria-selected", "false");
     52        // Ensure we don't get a notification when aria-selected is false.
     53        document.getElementById("item2").setAttribute("aria-selected", "false");
    5654
    57                 setTimeout(function() {
    58                     // Trigger another notification through focus to ensure we don't
    59                     document.getElementById("item3").focus();
    60                 }, 1);
    61             }, 1);
    62         }, 1);
     55        // Trigger another notification through focus to ensure we don't
     56        document.getElementById("item3").focus();
    6357    }
    6458
  • trunk/LayoutTests/accessibility/mac/selection-notification-focus-change-expected.txt

    r228376 r228390  
    1717
    1818eventSender.keyDown(tabCharacter)
     19Received AXFocusChanged
    1920Received AXSelectedTextChanged
    2021PASS userInfo["AXTextSelectionChangedFocus"] is true
    21 Received AXFocusChanged
    2222Received AXSelectedTextChanged
    2323PASS userInfo["AXTextSelectionChangedFocus"] is true
  • trunk/Source/WebCore/ChangeLog

    r228389 r228390  
     12018-02-12  Matt Lewis  <jlewis3@apple.com>
     2
     3        Unreviewed, rolling out r228376.
     4
     5        This caused accessibility/mac/selection-notification-focus-
     6        change.html to become flaky on macOS.
     7
     8        Reverted changeset:
     9
     10        "AX: defer focusedUIElement notifications"
     11        https://bugs.webkit.org/show_bug.cgi?id=182643
     12        https://trac.webkit.org/changeset/228376
     13
    1142018-02-12  Ryan Haddad  <ryanhaddad@apple.com>
    215
  • trunk/Source/WebCore/accessibility/AXObjectCache.cpp

    r228376 r228390  
    10161016   
    10171017    postNotification(getOrCreate(node), &document(), AXMenuListItemSelected);
    1018 }
    1019    
    1020 void AXObjectCache::deferFocusedUIElementChangeIfNeeded(Node* oldNode, Node* newNode)
    1021 {
    1022     if (nodeAndRendererAreValid(newNode) && rendererNeedsDeferredUpdate(*newNode->renderer()))
    1023         m_deferredFocusedNodeChange.append({ oldNode, newNode });
    1024     else
    1025         handleFocusedUIElementChanged(oldNode, newNode);
    10261018}
    10271019   
     
    27862778}
    27872779
    2788 static void conditionallyAddNodeToFilterList(Node* node, const Document& document, HashSet<Node*>& nodesToRemove)
    2789 {
    2790     if (!node->isConnected() || &node->document() == &document)
    2791         nodesToRemove.add(node);
    2792 }
    2793    
    2794 template<typename T>
    2795 static void filterVectorPairForRemoval(const Vector<std::pair<T, T>>& list, const Document& document, HashSet<Node*>& nodesToRemove)
    2796 {
    2797     for (auto& entry : list) {
    2798         conditionallyAddNodeToFilterList(entry.first, document, nodesToRemove);
    2799         conditionallyAddNodeToFilterList(entry.second, document, nodesToRemove);
    2800     }
    2801 }
    2802    
    28032780template<typename T, typename U>
    28042781static void filterMapForRemoval(const HashMap<T, U>& list, const Document& document, HashSet<Node*>& nodesToRemove)
    28052782{
    2806     for (auto& entry : list)
    2807         conditionallyAddNodeToFilterList(entry.key, document, nodesToRemove);
     2783    for (auto& entry : list) {
     2784        auto* node = entry.key;
     2785        if (node->isConnected() && &node->document() != &document)
     2786            continue;
     2787        nodesToRemove.add(node);
     2788    }
    28082789}
    28092790
     
    28112792static void filterListForRemoval(const ListHashSet<T>& list, const Document& document, HashSet<Node*>& nodesToRemove)
    28122793{
    2813     for (auto* node : list)
    2814         conditionallyAddNodeToFilterList(node, document, nodesToRemove);
     2794    for (auto* node : list) {
     2795        if (node->isConnected() && &node->document() != &document)
     2796            continue;
     2797        nodesToRemove.add(node);
     2798    }
    28152799}
    28162800
     
    28252809    filterMapForRemoval(m_deferredTextFormControlValue, document, nodesToRemove);
    28262810    filterMapForRemoval(m_deferredAttributeChange, document, nodesToRemove);
    2827     filterVectorPairForRemoval(m_deferredFocusedNodeChange, document, nodesToRemove);
    28282811
    28292812    for (auto* node : nodesToRemove)
     
    28692852        handleAttributeChange(deferredAttributeChangeContext.value, deferredAttributeChangeContext.key);
    28702853    m_deferredAttributeChange.clear();
    2871    
    2872     for (auto& deferredFocusedChangeContext : m_deferredFocusedNodeChange)
    2873         handleFocusedUIElementChanged(deferredFocusedChangeContext.first, deferredFocusedChangeContext.second);
    2874     m_deferredFocusedNodeChange.clear();
    28752854}
    28762855   
  • trunk/Source/WebCore/accessibility/AXObjectCache.h

    r228376 r228390  
    169169    void childrenChanged(AccessibilityObject*);
    170170    void checkedStateChanged(Node*);
     171    void selectedChildrenChanged(Node*);
     172    void selectedChildrenChanged(RenderObject*);
     173    // Called by a node when text or a text equivalent (e.g. alt) attribute is changed.
     174    void textChanged(Node*);
    171175    // Called when a node has just been attached, so we can make sure we have the right subclass of AccessibilityObject.
    172176    void updateCacheAfterNodeIsAttached(Node*);
    173177
    174     void deferFocusedUIElementChangeIfNeeded(Node* oldFocusedNode, Node* newFocusedNode);
     178    void handleActiveDescendantChanged(Node*);
     179    void handleAriaRoleChanged(Node*);
     180    void handleFocusedUIElementChanged(Node* oldFocusedNode, Node* newFocusedNode);
    175181    void handleScrolledToAnchor(const Node* anchorNode);
     182    void handleAriaExpandedChange(Node*);
    176183    void handleScrollbarUpdate(ScrollView*);
    177184   
     185    void handleModalChange(Node*);
    178186    Node* modalNode();
    179187
     
    404412    void handleAttributeChange(const QualifiedName&, Element*);
    405413    bool shouldProcessAttributeChange(const QualifiedName&, Element*);
    406     void selectedChildrenChanged(Node*);
    407     void selectedChildrenChanged(RenderObject*);
    408     // Called by a node when text or a text equivalent (e.g. alt) attribute is changed.
    409     void textChanged(Node*);
    410     void handleActiveDescendantChanged(Node*);
    411     void handleAriaRoleChanged(Node*);
    412     void handleAriaExpandedChange(Node*);
    413     void handleFocusedUIElementChanged(Node* oldFocusedNode, Node* newFocusedNode);
    414 
     414   
    415415    // aria-modal related
    416416    void findModalNodes();
    417417    void updateCurrentModalNode();
    418418    bool isNodeVisible(Node*) const;
    419     void handleModalChange(Node*);
    420419
    421420    Document& m_document;
     
    451450    HashMap<Element*, String> m_deferredTextFormControlValue;
    452451    HashMap<Element*, QualifiedName> m_deferredAttributeChange;
    453     Vector<std::pair<Node*, Node*>> m_deferredFocusedNodeChange;
    454452    bool m_isSynchronizingSelection { false };
    455453    bool m_performingDeferredCacheUpdate { false };
  • trunk/Source/WebCore/dom/Document.cpp

    r228387 r228390  
    39693969        // Create the AXObject cache in a focus change because GTK relies on it.
    39703970        if (AXObjectCache* cache = axObjectCache())
    3971             cache->deferFocusedUIElementChangeIfNeeded(oldFocusedElement.get(), newFocusedElement.get());
     3971            cache->handleFocusedUIElementChanged(oldFocusedElement.get(), newFocusedElement.get());
    39723972    }
    39733973
Note: See TracChangeset for help on using the changeset viewer.