Title: [228390] trunk
Revision
228390
Author
jlew...@apple.com
Date
2018-02-12 12:40:23 -0800 (Mon, 12 Feb 2018)

Log 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

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (228389 => 228390)


--- trunk/LayoutTests/ChangeLog	2018-02-12 20:30:51 UTC (rev 228389)
+++ trunk/LayoutTests/ChangeLog	2018-02-12 20:40:23 UTC (rev 228390)
@@ -1,3 +1,16 @@
+2018-02-12  Matt Lewis  <jlew...@apple.com>
+
+        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
+
 2018-02-12  Per Arne Vollan  <pvol...@apple.com>
 
         Mark imported/mozilla/svg/conditions-07.svg as a flaky failure on Windows.

Modified: trunk/LayoutTests/accessibility/mac/aria-menu-item-selected-notification.html (228389 => 228390)


--- trunk/LayoutTests/accessibility/mac/aria-menu-item-selected-notification.html	2018-02-12 20:30:51 UTC (rev 228389)
+++ trunk/LayoutTests/accessibility/mac/aria-menu-item-selected-notification.html	2018-02-12 20:40:23 UTC (rev 228390)
@@ -46,20 +46,14 @@
         // Trigger notification through focus.
         document.getElementById("item1").focus();
 
-        setTimeout(function() {
-            // Trigger notification through aria-selected.
-            document.getElementById("item2").setAttribute("aria-selected", "true");
+        // Trigger notification through aria-selected.
+        document.getElementById("item2").setAttribute("aria-selected", "true");
 
-            setTimeout(function() {
-                // Ensure we don't get a notification when aria-selected is false.
-                document.getElementById("item2").setAttribute("aria-selected", "false");
+        // Ensure we don't get a notification when aria-selected is false.
+        document.getElementById("item2").setAttribute("aria-selected", "false");
 
-                setTimeout(function() {
-                    // Trigger another notification through focus to ensure we don't
-                    document.getElementById("item3").focus();
-                }, 1);
-            }, 1);
-        }, 1);
+        // Trigger another notification through focus to ensure we don't
+        document.getElementById("item3").focus();
     }
 
 </script>

Modified: trunk/LayoutTests/accessibility/mac/selection-notification-focus-change-expected.txt (228389 => 228390)


--- trunk/LayoutTests/accessibility/mac/selection-notification-focus-change-expected.txt	2018-02-12 20:30:51 UTC (rev 228389)
+++ trunk/LayoutTests/accessibility/mac/selection-notification-focus-change-expected.txt	2018-02-12 20:40:23 UTC (rev 228390)
@@ -16,9 +16,9 @@
 Received AXFocusChanged
 
 eventSender.keyDown(tabCharacter)
+Received AXFocusChanged
 Received AXSelectedTextChanged
 PASS userInfo["AXTextSelectionChangedFocus"] is true
-Received AXFocusChanged
 Received AXSelectedTextChanged
 PASS userInfo["AXTextSelectionChangedFocus"] is true
 PASS successfullyParsed is true

Modified: trunk/Source/WebCore/ChangeLog (228389 => 228390)


--- trunk/Source/WebCore/ChangeLog	2018-02-12 20:30:51 UTC (rev 228389)
+++ trunk/Source/WebCore/ChangeLog	2018-02-12 20:40:23 UTC (rev 228390)
@@ -1,3 +1,16 @@
+2018-02-12  Matt Lewis  <jlew...@apple.com>
+
+        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
+
 2018-02-12  Ryan Haddad  <ryanhad...@apple.com>
 
         [iOS] media tests failing ASSERT_NOT_REACHED() in WebCore::VideoFullscreenInterfaceAVKit::cleanupFullscreen()

Modified: trunk/Source/WebCore/accessibility/AXObjectCache.cpp (228389 => 228390)


--- trunk/Source/WebCore/accessibility/AXObjectCache.cpp	2018-02-12 20:30:51 UTC (rev 228389)
+++ trunk/Source/WebCore/accessibility/AXObjectCache.cpp	2018-02-12 20:40:23 UTC (rev 228390)
@@ -1017,14 +1017,6 @@
     postNotification(getOrCreate(node), &document(), AXMenuListItemSelected);
 }
     
-void AXObjectCache::deferFocusedUIElementChangeIfNeeded(Node* oldNode, Node* newNode)
-{
-    if (nodeAndRendererAreValid(newNode) && rendererNeedsDeferredUpdate(*newNode->renderer()))
-        m_deferredFocusedNodeChange.append({ oldNode, newNode });
-    else
-        handleFocusedUIElementChanged(oldNode, newNode);
-}
-    
 void AXObjectCache::handleFocusedUIElementChanged(Node* oldNode, Node* newNode)
 {
     handleMenuItemSelected(newNode);
@@ -2785,33 +2777,25 @@
     return result;
 }
 
-static void conditionallyAddNodeToFilterList(Node* node, const Document& document, HashSet<Node*>& nodesToRemove)
+template<typename T, typename U>
+static void filterMapForRemoval(const HashMap<T, U>& list, const Document& document, HashSet<Node*>& nodesToRemove)
 {
-    if (!node->isConnected() || &node->document() == &document)
+    for (auto& entry : list) {
+        auto* node = entry.key;
+        if (node->isConnected() && &node->document() != &document)
+            continue;
         nodesToRemove.add(node);
-}
-    
-template<typename T>
-static void filterVectorPairForRemoval(const Vector<std::pair<T, T>>& list, const Document& document, HashSet<Node*>& nodesToRemove)
-{
-    for (auto& entry : list) {
-        conditionallyAddNodeToFilterList(entry.first, document, nodesToRemove);
-        conditionallyAddNodeToFilterList(entry.second, document, nodesToRemove);
     }
 }
-    
-template<typename T, typename U>
-static void filterMapForRemoval(const HashMap<T, U>& list, const Document& document, HashSet<Node*>& nodesToRemove)
-{
-    for (auto& entry : list)
-        conditionallyAddNodeToFilterList(entry.key, document, nodesToRemove);
-}
 
 template<typename T>
 static void filterListForRemoval(const ListHashSet<T>& list, const Document& document, HashSet<Node*>& nodesToRemove)
 {
-    for (auto* node : list)
-        conditionallyAddNodeToFilterList(node, document, nodesToRemove);
+    for (auto* node : list) {
+        if (node->isConnected() && &node->document() != &document)
+            continue;
+        nodesToRemove.add(node);
+    }
 }
 
 void AXObjectCache::prepareForDocumentDestruction(const Document& document)
@@ -2824,7 +2808,6 @@
     filterListForRemoval(m_deferredSelectedChildredChangedList, document, nodesToRemove);
     filterMapForRemoval(m_deferredTextFormControlValue, document, nodesToRemove);
     filterMapForRemoval(m_deferredAttributeChange, document, nodesToRemove);
-    filterVectorPairForRemoval(m_deferredFocusedNodeChange, document, nodesToRemove);
 
     for (auto* node : nodesToRemove)
         remove(*node);
@@ -2868,10 +2851,6 @@
     for (auto& deferredAttributeChangeContext : m_deferredAttributeChange)
         handleAttributeChange(deferredAttributeChangeContext.value, deferredAttributeChangeContext.key);
     m_deferredAttributeChange.clear();
-    
-    for (auto& deferredFocusedChangeContext : m_deferredFocusedNodeChange)
-        handleFocusedUIElementChanged(deferredFocusedChangeContext.first, deferredFocusedChangeContext.second);
-    m_deferredFocusedNodeChange.clear();
 }
     
 void AXObjectCache::deferRecomputeIsIgnoredIfNeeded(Element* element)

Modified: trunk/Source/WebCore/accessibility/AXObjectCache.h (228389 => 228390)


--- trunk/Source/WebCore/accessibility/AXObjectCache.h	2018-02-12 20:30:51 UTC (rev 228389)
+++ trunk/Source/WebCore/accessibility/AXObjectCache.h	2018-02-12 20:40:23 UTC (rev 228390)
@@ -168,13 +168,21 @@
     void childrenChanged(RenderObject*, RenderObject* newChild = nullptr);
     void childrenChanged(AccessibilityObject*);
     void checkedStateChanged(Node*);
+    void selectedChildrenChanged(Node*);
+    void selectedChildrenChanged(RenderObject*);
+    // Called by a node when text or a text equivalent (e.g. alt) attribute is changed.
+    void textChanged(Node*);
     // Called when a node has just been attached, so we can make sure we have the right subclass of AccessibilityObject.
     void updateCacheAfterNodeIsAttached(Node*);
 
-    void deferFocusedUIElementChangeIfNeeded(Node* oldFocusedNode, Node* newFocusedNode);
+    void handleActiveDescendantChanged(Node*);
+    void handleAriaRoleChanged(Node*);
+    void handleFocusedUIElementChanged(Node* oldFocusedNode, Node* newFocusedNode);
     void handleScrolledToAnchor(const Node* anchorNode);
+    void handleAriaExpandedChange(Node*);
     void handleScrollbarUpdate(ScrollView*);
     
+    void handleModalChange(Node*);
     Node* modalNode();
 
     void deferAttributeChangeIfNeeded(const QualifiedName&, Element*);
@@ -403,20 +411,11 @@
     void handleMenuItemSelected(Node*);
     void handleAttributeChange(const QualifiedName&, Element*);
     bool shouldProcessAttributeChange(const QualifiedName&, Element*);
-    void selectedChildrenChanged(Node*);
-    void selectedChildrenChanged(RenderObject*);
-    // Called by a node when text or a text equivalent (e.g. alt) attribute is changed.
-    void textChanged(Node*);
-    void handleActiveDescendantChanged(Node*);
-    void handleAriaRoleChanged(Node*);
-    void handleAriaExpandedChange(Node*);
-    void handleFocusedUIElementChanged(Node* oldFocusedNode, Node* newFocusedNode);
-
+    
     // aria-modal related
     void findModalNodes();
     void updateCurrentModalNode();
     bool isNodeVisible(Node*) const;
-    void handleModalChange(Node*);
 
     Document& m_document;
     HashMap<AXID, RefPtr<AccessibilityObject>> m_objects;
@@ -450,7 +449,6 @@
     ListHashSet<Element*> m_deferredSelectedChildredChangedList;
     HashMap<Element*, String> m_deferredTextFormControlValue;
     HashMap<Element*, QualifiedName> m_deferredAttributeChange;
-    Vector<std::pair<Node*, Node*>> m_deferredFocusedNodeChange;
     bool m_isSynchronizingSelection { false };
     bool m_performingDeferredCacheUpdate { false };
 };

Modified: trunk/Source/WebCore/dom/Document.cpp (228389 => 228390)


--- trunk/Source/WebCore/dom/Document.cpp	2018-02-12 20:30:51 UTC (rev 228389)
+++ trunk/Source/WebCore/dom/Document.cpp	2018-02-12 20:40:23 UTC (rev 228390)
@@ -3968,7 +3968,7 @@
     if (!focusChangeBlocked && m_focusedElement) {
         // Create the AXObject cache in a focus change because GTK relies on it.
         if (AXObjectCache* cache = axObjectCache())
-            cache->deferFocusedUIElementChangeIfNeeded(oldFocusedElement.get(), newFocusedElement.get());
+            cache->handleFocusedUIElementChanged(oldFocusedElement.get(), newFocusedElement.get());
     }
 
     if (!focusChangeBlocked && page())
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to