Commit b63fffc7 authored by Aaron Leventhal's avatar Aaron Leventhal Committed by Commit Bot

Do not fire events on trimmed descendants of leaf nodes

NOTRY:true

Bug: 887512
Change-Id: Ie4aab44d8eb186b9aff35036aa5317c6f79fc643
Reviewed-on: https://chromium-review.googlesource.com/1236714
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593562}
parent 095b5229
...@@ -373,7 +373,7 @@ void BrowserAccessibilityManager::OnAccessibilityEvents( ...@@ -373,7 +373,7 @@ void BrowserAccessibilityManager::OnAccessibilityEvents(
// Fire any events related to changes to the tree. // Fire any events related to changes to the tree.
for (auto targeted_event : *this) { for (auto targeted_event : *this) {
BrowserAccessibility* event_target = GetFromAXNode(targeted_event.node); BrowserAccessibility* event_target = GetFromAXNode(targeted_event.node);
if (!event_target) if (!event_target || event_target->PlatformIsChildOfLeaf())
continue; continue;
FireGeneratedEvent(targeted_event.event_params.event, event_target); FireGeneratedEvent(targeted_event.event_params.event, event_target);
...@@ -386,7 +386,7 @@ void BrowserAccessibilityManager::OnAccessibilityEvents( ...@@ -386,7 +386,7 @@ void BrowserAccessibilityManager::OnAccessibilityEvents(
// Fire the native event. // Fire the native event.
BrowserAccessibility* event_target = GetFromID(event.id); BrowserAccessibility* event_target = GetFromID(event.id);
if (!event_target) if (!event_target || event_target->PlatformIsChildOfLeaf())
return; return;
if (event.event_type == ax::mojom::Event::kHover) if (event.event_type == ax::mojom::Event::kHover)
......
...@@ -197,6 +197,9 @@ void BrowserAccessibilityManagerWin::FireGeneratedEvent( ...@@ -197,6 +197,9 @@ void BrowserAccessibilityManagerWin::FireGeneratedEvent(
void BrowserAccessibilityManagerWin::FireWinAccessibilityEvent( void BrowserAccessibilityManagerWin::FireWinAccessibilityEvent(
LONG win_event_type, LONG win_event_type,
BrowserAccessibility* node) { BrowserAccessibility* node) {
if (node->PlatformIsChildOfLeaf())
return;
// If there's no root delegate, this may be a new frame that hasn't // If there's no root delegate, this may be a new frame that hasn't
// yet been swapped in or added to the frame tree. Suppress firing events // yet been swapped in or added to the frame tree. Suppress firing events
// until then. // until then.
......
...@@ -6,4 +6,3 @@ EVENT_OBJECT_SHOW role=ROLE_SYSTEM_CARET window_class=Chrome_WidgetWin_0 ...@@ -6,4 +6,3 @@ EVENT_OBJECT_SHOW role=ROLE_SYSTEM_CARET window_class=Chrome_WidgetWin_0
EVENT_OBJECT_VALUECHANGE on <input#in1> role=ROLE_SYSTEM_TEXT value="end" FOCUSABLE IA2_STATE_EDITABLE,IA2_STATE_SELECTABLE_TEXT,IA2_STATE_SINGLE_LINE EVENT_OBJECT_VALUECHANGE on <input#in1> role=ROLE_SYSTEM_TEXT value="end" FOCUSABLE IA2_STATE_EDITABLE,IA2_STATE_SELECTABLE_TEXT,IA2_STATE_SINGLE_LINE
IA2_EVENT_TEXT_CARET_MOVED on <input#in1> role=ROLE_SYSTEM_TEXT value="abcde" FOCUSED,FOCUSABLE IA2_STATE_EDITABLE,IA2_STATE_SELECTABLE_TEXT,IA2_STATE_SINGLE_LINE IA2_EVENT_TEXT_CARET_MOVED on <input#in1> role=ROLE_SYSTEM_TEXT value="abcde" FOCUSED,FOCUSABLE IA2_STATE_EDITABLE,IA2_STATE_SELECTABLE_TEXT,IA2_STATE_SINGLE_LINE
IA2_EVENT_TEXT_CARET_MOVED on <input#in1> role=ROLE_SYSTEM_TEXT value="abcde" FOCUSED,FOCUSABLE IA2_STATE_EDITABLE,IA2_STATE_SELECTABLE_TEXT,IA2_STATE_SINGLE_LINE IA2_EVENT_TEXT_CARET_MOVED on <input#in1> role=ROLE_SYSTEM_TEXT value="abcde" FOCUSED,FOCUSABLE IA2_STATE_EDITABLE,IA2_STATE_SELECTABLE_TEXT,IA2_STATE_SINGLE_LINE
IA2_EVENT_TEXT_CARET_MOVED on role=ROLE_SYSTEM_STATICTEXT name="abcde" IA2_STATE_EDITABLE
\ No newline at end of file
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