Commit 77c5e475 authored by Abigail Klein's avatar Abigail Klein Committed by Commit Bot

Do not fire AXLayoutComplete events based on feedback from Apple

that voiceover does not use them.

Bug: 1049320
Change-Id: Ic7059a1c1f2a9800afca5a711994a5e485163564
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2357629Reviewed-by: default avatarAaron Leventhal <aleventhal@chromium.org>
Commit-Queue: Abigail Klein <abigailbklein@google.com>
Cr-Commit-Position: refs/heads/master@{#798305}
parent f102581d
...@@ -66,9 +66,9 @@ enum AXTextEditType { ...@@ -66,9 +66,9 @@ enum AXTextEditType {
AXTextEditTypeAttributesChange AXTextEditTypeAttributesChange
}; };
// Native mac notifications fired.
NSString* const NSAccessibilityAutocorrectionOccurredNotification = NSString* const NSAccessibilityAutocorrectionOccurredNotification =
@"AXAutocorrectionOccurred"; @"AXAutocorrectionOccurred";
NSString* const NSAccessibilityLayoutCompleteNotification = @"AXLayoutComplete";
NSString* const NSAccessibilityNewDocumentLoadCompleteNotification = NSString* const NSAccessibilityNewDocumentLoadCompleteNotification =
@"AXNewDocumentLoadComplete"; @"AXNewDocumentLoadComplete";
NSString* const NSAccessibilityInvalidStatusChangedNotification = NSString* const NSAccessibilityInvalidStatusChangedNotification =
...@@ -81,6 +81,9 @@ NSString* const NSAccessibilityExpandedChanged = @"AXExpandedChanged"; ...@@ -81,6 +81,9 @@ NSString* const NSAccessibilityExpandedChanged = @"AXExpandedChanged";
NSString* const NSAccessibilityMenuItemSelectedNotification = NSString* const NSAccessibilityMenuItemSelectedNotification =
@"AXMenuItemSelected"; @"AXMenuItemSelected";
// The following native mac notifications are not fired:
// AXLayoutComplete: Voiceover does not use this, it is considered too spammy.
// Attributes used for NSAccessibilitySelectedTextChangedNotification and // Attributes used for NSAccessibilitySelectedTextChangedNotification and
// NSAccessibilityValueChangedNotification. // NSAccessibilityValueChangedNotification.
NSString* const NSAccessibilityTextStateChangeTypeKey = NSString* const NSAccessibilityTextStateChangeTypeKey =
...@@ -163,9 +166,6 @@ void BrowserAccessibilityManagerMac::FireBlinkEvent( ...@@ -163,9 +166,6 @@ void BrowserAccessibilityManagerMac::FireBlinkEvent(
case ax::mojom::Event::kAutocorrectionOccured: case ax::mojom::Event::kAutocorrectionOccured:
mac_notification = NSAccessibilityAutocorrectionOccurredNotification; mac_notification = NSAccessibilityAutocorrectionOccurredNotification;
break; break;
case ax::mojom::Event::kLayoutComplete:
mac_notification = NSAccessibilityLayoutCompleteNotification;
break;
default: default:
return; return;
} }
...@@ -223,23 +223,18 @@ void BrowserAccessibilityManagerMac::FireGeneratedEvent( ...@@ -223,23 +223,18 @@ void BrowserAccessibilityManagerMac::FireGeneratedEvent(
break; break;
case ui::AXEventGenerator::Event::LOAD_COMPLETE: case ui::AXEventGenerator::Event::LOAD_COMPLETE:
// |NSAccessibilityNewDocumentLoadCompleteNotification| should only be // |NSAccessibilityNewDocumentLoadCompleteNotification| should only be
// fired on the top document. Iframes should use // fired on the top document.
// |ax::mojom::Event::kLayoutComplete| to signify that they have finished // |NSAccessibilityNewDocumentLoadCompleteNotification| is the event that
// loading. |NSAccessibilityNewDocumentLoadCompleteNotification| is the // Webkit notifies VoiceOver that a page load has completed.
// event that Webkit notifies VoiceOver that a page load has completed.
// TODO(crbug.com/1049320): Verify in MacOS 10.16 that the "Automatically // TODO(crbug.com/1049320): Verify in MacOS 10.16 that the "Automatically
// speak the webpage" option in the VoiceOver utility is triggered upon // speak the webpage" option in the VoiceOver utility is triggered upon
// observing this event. // observing this event.
if (IsRootTree()) { if (IsRootTree()) {
mac_notification = NSAccessibilityNewDocumentLoadCompleteNotification; mac_notification = NSAccessibilityNewDocumentLoadCompleteNotification;
} else { } else {
mac_notification = NSAccessibilityLayoutCompleteNotification; return;
} }
break; break;
case ui::AXEventGenerator::Event::PORTAL_ACTIVATED:
DCHECK(IsRootTree());
mac_notification = NSAccessibilityLayoutCompleteNotification;
break;
case ui::AXEventGenerator::Event::INVALID_STATUS_CHANGED: case ui::AXEventGenerator::Event::INVALID_STATUS_CHANGED:
mac_notification = NSAccessibilityInvalidStatusChangedNotification; mac_notification = NSAccessibilityInvalidStatusChangedNotification;
break; break;
...@@ -445,6 +440,7 @@ void BrowserAccessibilityManagerMac::FireGeneratedEvent( ...@@ -445,6 +440,7 @@ void BrowserAccessibilityManagerMac::FireGeneratedEvent(
case ui::AXEventGenerator::Event::OBJECT_ATTRIBUTE_CHANGED: case ui::AXEventGenerator::Event::OBJECT_ATTRIBUTE_CHANGED:
case ui::AXEventGenerator::Event::OTHER_ATTRIBUTE_CHANGED: case ui::AXEventGenerator::Event::OTHER_ATTRIBUTE_CHANGED:
case ui::AXEventGenerator::Event::PLACEHOLDER_CHANGED: case ui::AXEventGenerator::Event::PLACEHOLDER_CHANGED:
case ui::AXEventGenerator::Event::PORTAL_ACTIVATED:
case ui::AXEventGenerator::Event::POSITION_IN_SET_CHANGED: case ui::AXEventGenerator::Event::POSITION_IN_SET_CHANGED:
case ui::AXEventGenerator::Event::READONLY_CHANGED: case ui::AXEventGenerator::Event::READONLY_CHANGED:
case ui::AXEventGenerator::Event::RELATED_NODE_CHANGED: case ui::AXEventGenerator::Event::RELATED_NODE_CHANGED:
......
<!-- <!--
@WIN-DENY:* @WIN-DENY:*
@WIN-ALLOW:EVENT_OBJECT_VALUECHANGE* @WIN-ALLOW:EVENT_OBJECT_VALUECHANGE*
@MAC-DENY:AXLayoutComplete*
--> -->
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
......
<!-- <!--
@WIN-DENY:* @WIN-DENY:*
@WIN-ALLOW:EVENT_OBJECT_VALUECHANGE* @WIN-ALLOW:EVENT_OBJECT_VALUECHANGE*
@MAC-DENY:AXLayoutComplete*
--> -->
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
......
<!-- <!--
@WIN-DENY:* @WIN-DENY:*
@WIN-ALLOW:EVENT_OBJECT_VALUECHANGE* @WIN-ALLOW:EVENT_OBJECT_VALUECHANGE*
@MAC-DENY:AXLayoutComplete*
--> -->
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
<!-- <!--
@WIN-DENY:* @WIN-DENY:*
@WIN-ALLOW:EVENT_OBJECT_VALUECHANGE* @WIN-ALLOW:EVENT_OBJECT_VALUECHANGE*
@MAC-DENY:AXLayoutComplete*
--> -->
<html> <html>
<body> <body>
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
<!-- <!--
@WIN-DENY:* @WIN-DENY:*
@WIN-ALLOW:EVENT_OBJECT_VALUECHANGE* @WIN-ALLOW:EVENT_OBJECT_VALUECHANGE*
@MAC-DENY:AXLayoutComplete*
--> -->
<html> <html>
<body> <body>
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
@UIA-WIN-DENY:* @UIA-WIN-DENY:*
@UIA-WIN-ALLOW:AriaProperties* @UIA-WIN-ALLOW:AriaProperties*
@UIA-WIN-ALLOW:RangeValueValue* @UIA-WIN-ALLOW:RangeValueValue*
@MAC-DENY:AXLayoutComplete*
--> -->
<html> <html>
<body> <body>
......
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