Commit 2d292528 authored by Aaron Leventhal's avatar Aaron Leventhal Committed by Commit Bot

Text changes inside css flex do not fire IA2 text change events

Chrome attempts to fire the event on an ignored parent of the text,
and the method returns early. The event needs to be fired on
an unignored ancestor.

Bug: 1041290
Change-Id: I12cda65ec23c8ff3a771da3fe1c29ebf4b8cb0ec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2015606
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Reviewed-by: default avatarAdam Ettenberger <adettenb@microsoft.com>
Reviewed-by: default avatarNektarios Paisios <nektar@chromium.org>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#737372}
parent 74ebdcc0
...@@ -1506,7 +1506,7 @@ void BrowserAccessibilityManager::CollectChangedNodesAndParentsForAtomicUpdate( ...@@ -1506,7 +1506,7 @@ void BrowserAccessibilityManager::CollectChangedNodesAndParentsForAtomicUpdate(
// When a node is a text node or line break, update its parent, because // When a node is a text node or line break, update its parent, because
// its text is part of its hypertext. // its text is part of its hypertext.
const ui::AXNode* parent = changed_node->parent(); const ui::AXNode* parent = changed_node->GetUnignoredParent();
if (!parent) if (!parent)
continue; continue;
......
...@@ -504,6 +504,11 @@ IN_PROC_BROWSER_TEST_P(DumpAccessibilityEventsTest, ...@@ -504,6 +504,11 @@ IN_PROC_BROWSER_TEST_P(DumpAccessibilityEventsTest,
RunEventTest(FILE_PATH_LITERAL("css-display.html")); RunEventTest(FILE_PATH_LITERAL("css-display.html"));
} }
IN_PROC_BROWSER_TEST_P(DumpAccessibilityEventsTest,
AccessibilityEventsCSSFlexTextUpdate) {
RunEventTest(FILE_PATH_LITERAL("css-flex-text-update.html"));
}
IN_PROC_BROWSER_TEST_P(DumpAccessibilityEventsTest, IN_PROC_BROWSER_TEST_P(DumpAccessibilityEventsTest,
AccessibilityEventsCSSVisibility) { AccessibilityEventsCSSVisibility) {
RunEventTest(FILE_PATH_LITERAL("css-visibility.html")); RunEventTest(FILE_PATH_LITERAL("css-visibility.html"));
......
CHILDREN-CHANGED index:0 CHILD:(role=ROLE_STATIC) role=ROLE_STATIC ENABLED,SENSITIVE,SHOWING,VISIBLE
NAME-CHANGED:new role=ROLE_STATIC name='new' ENABLED,SENSITIVE,SHOWING,VISIBLE
STATE-CHANGE:DEFUNCT:TRUE role=ROLE_INVALID name='(null)' DEFUNCT
Name changed on role=description, name=new
Text_TextChanged on role=description, name=new
IA2_EVENT_TEXT_INSERTED on <div#app> role=DIV new_text={'<obj>new' start=0 end=4}
IA2_EVENT_TEXT_REMOVED on <div#app> role=DIV old_text={'<obj>old' start=0 end=4}
<div id="app">
<div style="display:flex;">
<button>Test</button>
old
</div>
</div>
<script>
function go() {
// Get text node with "old" in it.
const node = document.getElementById('app').firstElementChild.lastChild;
// Change to "new".
node.textContent = 'new';
}
</script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment