Skip to content
Permalink
Browse files
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

Canonical link: https://commits.webkit.org/198500@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228390 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
rancored-mongoose committed Feb 12, 2018
1 parent 7edb75c commit 33771f4993c3c039b4f6ab722b80fbb7221d8c12
@@ -1,3 +1,16 @@
2018-02-12 Matt Lewis <jlewis3@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 <pvollan@apple.com>

Mark imported/mozilla/svg/conditions-07.svg as a flaky failure on Windows.
@@ -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>
@@ -16,9 +16,9 @@ accessibilityController.accessibleElementById("1").takeFocus()
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
@@ -1,3 +1,16 @@
2018-02-12 Matt Lewis <jlewis3@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 <ryanhaddad@apple.com>

[iOS] media tests failing ASSERT_NOT_REACHED() in WebCore::VideoFullscreenInterfaceAVKit::cleanupFullscreen()
@@ -1017,14 +1017,6 @@ void AXObjectCache::handleMenuItemSelected(Node* node)
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 @@ const Element* AXObjectCache::rootAXEditableElement(const Node* node)
return result;
}

static void conditionallyAddNodeToFilterList(Node* node, const Document& document, HashSet<Node*>& nodesToRemove)
{
if (!node->isConnected() || &node->document() == &document)
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);
for (auto& entry : list) {
auto* node = entry.key;
if (node->isConnected() && &node->document() != &document)
continue;
nodesToRemove.add(node);
}
}

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 @@ void AXObjectCache::prepareForDocumentDestruction(const Document& document)
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 @@ void AXObjectCache::performDeferredCacheUpdate()
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)
@@ -168,13 +168,21 @@ class AXObjectCache {
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 @@ class AXObjectCache {
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 @@ class AXObjectCache {
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 };
};
@@ -3968,7 +3968,7 @@ bool Document::setFocusedElement(Element* element, FocusDirection direction, Foc
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())

0 comments on commit 33771f4

Please sign in to comment.