0

[A11yPerformance] Rename AXMode::kScreenReader to kExtendedProperties

The new name is much more descriptive of what the mode actually is,
since many non-screen readers can also turn this mode on.
In addition, having it be called screen reader mode is confusing
since we do now have actual screen reader detection.

In fact, working on this makes it clear there are current features that
actually think they're switching behavior based on the presence
of a screen reader, but are really getting a signal if a utility
or OS feature was using a11y APIs. The percentage of users with
the misnamed kScreenReader mode was over 10% on some platforms!
Bug 401443089 has been filed to audit all the call sites that
used AXMode::kScreenReader and use actual screen reader detection
(see CL:6336045 for an example of how to do that).

This is a foundational piece for separating out two different concepts
in BrowserAccessibility related to whether a screen reader is present,
so that we can carefully use the right signal for turning off
ProgressiveAccessibility/AutoDisable when a screen reader is present.
The current kScreenReader mode is a misnomer.
See decision doc:
https://docs.google.com/document/d/1OJC1PWUjOtacjfwDj-OciPYrOez6DM5x4AoA_gNsAKg/edit

Bug: 401232343
Change-Id: Ic92e6f34825168429c6864380386e8e825476c67
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6331102
Reviewed-by: Benjamin Beaudry <benjamin.beaudry@microsoft.com>
Reviewed-by: Jihad Hanna <jihadghanna@google.com>
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Reviewed-by: Mark Schillaci <mschillaci@google.com>
Reviewed-by: Theresa Sullivan <twellington@chromium.org>
Reviewed-by: Andy Phan <andyphan@chromium.org>
Reviewed-by: Abigail Klein <abigailbklein@google.com>
Reviewed-by: Dana Fried <dfried@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1429679}
This commit is contained in:
Aaron Leventhal
2025-03-07 12:39:30 -08:00
committed by Chromium LUCI CQ
parent a1c3103818
commit 4af865793a
48 changed files with 247 additions and 238 deletions
chrome
components
content
third_party/blink/renderer
core
accessibility
modules
tools/metrics/histograms/metadata/accessibility
ui/accessibility

@ -59,7 +59,7 @@ class AccessibilityLabelsBrowserTest : public InProcessBrowserTest {
screen_reader_override_.reset();
} else if (!screen_reader_override_) {
screen_reader_override_.emplace(ui::AXMode::kWebContents |
ui::AXMode::kScreenReader);
ui::AXMode::kExtendedProperties);
}
#endif // BUILDFLAG(IS_CHROMEOS)
}
@ -104,7 +104,7 @@ IN_PROC_BROWSER_TEST_F(AccessibilityLabelsBrowserTest, NewWebContents) {
web_contents = browser()->tab_strip_model()->GetActiveWebContents();
// Wait for ChromeVox to attach to the new tab if needed.
if (!web_contents->GetAccessibilityMode().has_mode(
ui::AXMode::kScreenReader)) {
ui::AXMode::kExtendedProperties)) {
content::AccessibilityNotificationWaiter waiter(web_contents);
ASSERT_TRUE(waiter.WaitForNotification());
}
@ -118,7 +118,7 @@ IN_PROC_BROWSER_TEST_F(AccessibilityLabelsBrowserTest, NewWebContents) {
web_contents = browser()->tab_strip_model()->GetActiveWebContents();
// Wait for ChromeVox to attach to the new tab if needed.
if (!web_contents->GetAccessibilityMode().has_mode(
ui::AXMode::kScreenReader)) {
ui::AXMode::kExtendedProperties)) {
content::AccessibilityNotificationWaiter waiter(web_contents);
ASSERT_TRUE(waiter.WaitForNotification());
}
@ -220,7 +220,7 @@ IN_PROC_BROWSER_TEST_F(AccessibilityLabelsBrowserTest, EnabledByPreference) {
// reader should have been detected yet, and the feature should be off.
if (!content::BrowserAccessibilityState::GetInstance()
->GetAccessibilityMode()
.has_mode(ui::AXMode::kScreenReader)) {
.has_mode(ui::AXMode::kExtendedProperties)) {
EXPECT_FALSE(web_contents->GetAccessibilityMode().has_mode(
ui::AXMode::kLabelImages));

@ -37,7 +37,7 @@ bool IsScreenReaderEnabled() {
// an actual screen reader is enabled.
ui::AXMode mode =
content::BrowserAccessibilityState::GetInstance()->GetAccessibilityMode();
return mode.has_mode(ui::AXMode::kScreenReader);
return mode.has_mode(ui::AXMode::kExtendedProperties);
#endif // BUILDFLAG(IS_CHROMEOS)
}

@ -191,7 +191,7 @@ void AXMainNodeAnnotatorController::Activate() {
#if !BUILDFLAG(IS_CHROMEOS)
void AXMainNodeAnnotatorController::OnAXModeAdded(ui::AXMode mode) {
if (mode.has_mode(ui::AXMode::kScreenReader)) {
if (mode.has_mode(ui::AXMode::kExtendedProperties)) {
activated_ = true;
OnActivationChanged();
}

@ -106,7 +106,7 @@ class AXMainNodeAnnotatorControllerBrowserTest : public InProcessBrowserTest {
screen_reader_override_.reset();
} else if (!screen_reader_override_) {
screen_reader_override_.emplace(ui::AXMode::kWebContents |
ui::AXMode::kScreenReader);
ui::AXMode::kExtendedProperties);
}
#endif // BUILDFLAG(IS_CHROMEOS)
}
@ -155,7 +155,7 @@ IN_PROC_BROWSER_TEST_F(AXMainNodeAnnotatorControllerBrowserTest,
web_contents = browser()->tab_strip_model()->GetActiveWebContents();
// Wait for ChromeVox to attach to the new tab if needed.
if (!web_contents->GetAccessibilityMode().has_mode(
ui::AXMode::kScreenReader)) {
ui::AXMode::kExtendedProperties)) {
content::AccessibilityNotificationWaiter waiter(web_contents);
ASSERT_TRUE(waiter.WaitForNotification());
}

@ -124,7 +124,8 @@ bool IsAccessibilityEnabled(Profile* profile) {
// `SetUpPdfObserver()`. So if any of them have screen reader mode enabled,
// return true.
for (auto* contents : GetAllPdfWebContents(profile)) {
if (contents->GetAccessibilityMode().has_mode(ui::AXMode::kScreenReader)) {
if (contents->GetAccessibilityMode().has_mode(
ui::AXMode::kExtendedProperties)) {
return true;
}
}
@ -282,7 +283,7 @@ void PdfOcrController::Activate() {
#if !BUILDFLAG(IS_CHROMEOS)
void PdfOcrController::OnAXModeAdded(ui::AXMode mode) {
if (mode.has_mode(ui::AXMode::kScreenReader)) {
if (mode.has_mode(ui::AXMode::kExtendedProperties)) {
OnActivationChanged();
}
}

@ -115,7 +115,7 @@ class PdfOcrControllerBrowserTest : public base::test::WithFeatureOverride,
scoped_accessibility_override_.reset();
} else if (!scoped_accessibility_override_) {
scoped_accessibility_override_.emplace(ui::AXMode::kWebContents |
ui::AXMode::kScreenReader);
ui::AXMode::kExtendedProperties);
}
#endif // BUILDFLAG(IS_CHROMEOS)
}

@ -19,7 +19,7 @@ metrics::SystemProfileProto::AccessibilityState::AXMode ModeFlagsToProtoEnum(
return metrics::SystemProfileProto::AccessibilityState::WEB_CONTENTS;
case ui::AXMode::kInlineTextBoxes:
return metrics::SystemProfileProto::AccessibilityState::INLINE_TEXT_BOXES;
case ui::AXMode::kScreenReader:
case ui::AXMode::kExtendedProperties:
return metrics::SystemProfileProto::AccessibilityState::SCREEN_READER;
case ui::AXMode::kHTML:
return metrics::SystemProfileProto::AccessibilityState::HTML;
@ -65,7 +65,7 @@ void AccessibilityStateProvider::ProvideSystemProfileMetrics(
MaybeAddAccessibilityModeFlags(mode, ui::AXMode::kNativeAPIs, state);
MaybeAddAccessibilityModeFlags(mode, ui::AXMode::kWebContents, state);
MaybeAddAccessibilityModeFlags(mode, ui::AXMode::kInlineTextBoxes, state);
MaybeAddAccessibilityModeFlags(mode, ui::AXMode::kScreenReader, state);
MaybeAddAccessibilityModeFlags(mode, ui::AXMode::kExtendedProperties, state);
MaybeAddAccessibilityModeFlags(mode, ui::AXMode::kHTML, state);
MaybeAddAccessibilityModeFlags(mode, ui::AXMode::kHTMLMetadata, state);
MaybeAddAccessibilityModeFlags(mode, ui::AXMode::kLabelImages, state);

@ -239,10 +239,10 @@ class PDFExtensionAccessibilityTest : public PDFExtensionTestBase {
// Spoof a screen reader.
if (enabled) {
content::BrowserAccessibilityState::GetInstance()
->AddAccessibilityModeFlags(ui::AXMode::kScreenReader);
->AddAccessibilityModeFlags(ui::AXMode::kExtendedProperties);
} else {
content::BrowserAccessibilityState::GetInstance()
->RemoveAccessibilityModeFlags(ui::AXMode::kScreenReader);
->RemoveAccessibilityModeFlags(ui::AXMode::kExtendedProperties);
}
}
};

@ -29,7 +29,7 @@ ui::AXMode::ModeFlagHistogramValue ModeFlagsToEnum(uint32_t mode_flags) {
return ui::AXMode::ModeFlagHistogramValue::UMA_AX_MODE_WEB_CONTENTS;
case ui::AXMode::kInlineTextBoxes:
return ui::AXMode::ModeFlagHistogramValue::UMA_AX_MODE_INLINE_TEXT_BOXES;
case ui::AXMode::kScreenReader:
case ui::AXMode::kExtendedProperties:
return ui::AXMode::ModeFlagHistogramValue::UMA_AX_MODE_SCREEN_READER;
case ui::AXMode::kHTML:
return ui::AXMode::ModeFlagHistogramValue::UMA_AX_MODE_HTML;
@ -107,7 +107,7 @@ void MetricsProviderCommon::RecordA11yFlags() {
MaybeRecordAccessibilityModeFlags(mode, ui::AXMode::kNativeAPIs);
MaybeRecordAccessibilityModeFlags(mode, ui::AXMode::kWebContents);
MaybeRecordAccessibilityModeFlags(mode, ui::AXMode::kInlineTextBoxes);
MaybeRecordAccessibilityModeFlags(mode, ui::AXMode::kScreenReader);
MaybeRecordAccessibilityModeFlags(mode, ui::AXMode::kExtendedProperties);
MaybeRecordAccessibilityModeFlags(mode, ui::AXMode::kHTML);
MaybeRecordAccessibilityModeFlags(mode, ui::AXMode::kHTMLMetadata);
MaybeRecordAccessibilityModeFlags(mode, ui::AXMode::kLabelImages);

@ -93,7 +93,7 @@ IN_PROC_BROWSER_TEST_F(AccessibilityLabelsMenuObserverTest,
#else
// Spoof a screen reader.
content::ScopedAccessibilityModeOverride scoped_accessibility_mode(
ui::AXMode::kScreenReader);
ui::AXMode::kExtendedProperties);
#endif // BUILDFLAG(IS_CHROMEOS)
menu()->GetPrefs()->SetBoolean(prefs::kAccessibilityImageLabelsEnabled,
false);

@ -15,7 +15,7 @@ enum AxMode {
NATIVE_APIS = 1 << 0,
WEB_CONTENTS = 1 << 1,
INLINE_TEXT_BOXES = 1 << 2,
SCREEN_READER = 1 << 3,
EXTENDED_PROPERTIES = 1 << 3,
HTML = 1 << 4,
HTML_METADATA = 1 << 5,
LABEL_IMAGES = 1 << 6,
@ -42,14 +42,14 @@ type PageData = Data&{
routingId: number,
url?: string,
// Used for GlobalStateName.
// Note: Does 'metadata' actually exist? Does not appear anywhere in
// chrome/browser/accessibility/accessibility_ui.cc.
metadata: boolean,
native: boolean,
pdfPrinting: boolean,
screenreader: boolean,
web: boolean,
// Used for GlobalStateName.
// Note: Does 'metadata' actually exist? Does not appear anywhere in
// chrome/browser/accessibility/accessibility_ui.cc.
metadata: boolean,
native: boolean,
pdfPrinting: boolean,
extendedProperties: boolean,
web: boolean,
tree?: string,
error?: string,
@ -76,14 +76,15 @@ interface InitData {
html: EnabledStatus;
native: EnabledStatus;
pdfPrinting: EnabledStatus;
screenreader: EnabledStatus;
extendedProperties: EnabledStatus;
text: EnabledStatus;
web: EnabledStatus;
}
type RequestType = 'showOrRefreshTree';
type GlobalStateName = 'native'|'web'|'metadata'|'pdfPrinting'|'screenreader';
type GlobalStateName =
'native'|'web'|'metadata'|'pdfPrinting'|'extendedProperties';
class BrowserProxy {
toggleAccessibility(
@ -246,7 +247,7 @@ function initialize() {
bindCheckbox('native', data.native);
bindCheckbox('web', data.web);
bindCheckbox('text', data.text);
bindCheckbox('screenreader', data.screenreader);
bindCheckbox('extendedProperties', data.extendedProperties);
bindCheckbox('html', data.html);
bindDropdown('apiType', data.supportedApiTypes, data.apiType);
bindCheckbox('locked', data.locked);
@ -388,17 +389,18 @@ function formatRow(
row.appendChild(createModeElement(AxMode.WEB_CONTENTS, pageData, 'native'));
row.appendChild(
createModeElement(AxMode.INLINE_TEXT_BOXES, pageData, 'web'));
row.appendChild(createModeElement(AxMode.SCREEN_READER, pageData, 'web'));
row.appendChild(
createModeElement(AxMode.EXTENDED_PROPERTIES, pageData, 'web'));
row.appendChild(createModeElement(AxMode.HTML, pageData, 'web'));
row.appendChild(
createModeElement(AxMode.HTML_METADATA, pageData, 'metadata'));
row.appendChild(
createModeElement(AxMode.PDF_PRINTING, pageData, 'pdfPrinting'));
row.appendChild(createModeElement(
AxMode.LABEL_IMAGES, pageData, 'screenreader',
AxMode.LABEL_IMAGES, pageData, 'extendedProperties',
/*readonly=*/ true));
row.appendChild(createModeElement(
AxMode.ANNOTATE_MAIN_NODE, pageData, 'screenreader',
AxMode.ANNOTATE_MAIN_NODE, pageData, 'extendedProperties',
/* readOnly= */ true));
} else {
const siteInfo = document.createElement('span');
@ -491,8 +493,8 @@ function getNameForAccessibilityMode(mode: AxMode): string {
return 'Web';
case AxMode.INLINE_TEXT_BOXES:
return 'Inline text';
case AxMode.SCREEN_READER:
return 'Screen reader';
case AxMode.EXTENDED_PROPERTIES:
return 'Extended properties';
case AxMode.HTML:
return 'HTML';
case AxMode.HTML_METADATA:

@ -1008,7 +1008,7 @@ class AutofillPopupControllerImplTestAccessibility
static constexpr int kAxUniqueId = 123;
AutofillPopupControllerImplTestAccessibility()
: accessibility_mode_override_(ui::AXMode::kScreenReader) {}
: accessibility_mode_override_(ui::AXMode::kExtendedProperties) {}
AutofillPopupControllerImplTestAccessibility(
AutofillPopupControllerImplTestAccessibility&) = delete;
AutofillPopupControllerImplTestAccessibility& operator=(
@ -1032,7 +1032,7 @@ class AutofillPopupControllerImplTestAccessibility
void TearDown() override {
// This needs to bo reset explicit because having the mode set to
// `kScreenReader` causes mocked functions to get called with
// `kExtendedProperties` causes mocked functions to get called with
// `mock_ax_platform_node_delegate` after it has been destroyed.
accessibility_mode_override_.ResetMode();
AutofillPopupControllerImplTestAccessibilityBase::TearDown();

@ -908,7 +908,7 @@ class BrowserView::AccessibilityModeObserver : public ui::AXModeObserver {
// asynchronously since AXMode changes can happen while AXTree updates or
// notifications are in progress, and |MaybeInitializeWebUITabStrip| can
// destroy things synchronously.
if (mode.has_mode(ui::AXMode::kScreenReader)) {
if (mode.has_mode(ui::AXMode::kExtendedProperties)) {
base::SingleThreadTaskRunner::GetCurrentDefault()->PostTask(
FROM_HERE, base::BindOnce(&BrowserView::MaybeInitializeWebUITabStrip,
browser_view_->GetAsWeakPtr()));

@ -504,7 +504,7 @@ bool WebUITabStripContainerView::UseTouchableTabStrip(const Browser* browser) {
// being less accessible than the traditional tabstrip.
if (content::BrowserAccessibilityState::GetInstance()
->GetAccessibilityMode()
.has_mode(ui::AXMode::kScreenReader)) {
.has_mode(ui::AXMode::kExtendedProperties)) {
return false;
}

@ -104,7 +104,7 @@ static const char kLocked[] = "locked";
static const char kNative[] = "native";
static const char kPage[] = "page";
static const char kPDFPrinting[] = "pdfPrinting";
static const char kScreenReader[] = "screenreader";
static const char kExtendedProperties[] = "extendedProperties";
static const char kShowOrRefreshTree[] = "showOrRefreshTree";
static const char kText[] = "text";
static const char kWeb[] = "web";
@ -200,7 +200,7 @@ void HandleAccessibilityRequestCallback(
bool native = mode.has_mode(ui::AXMode::kNativeAPIs);
bool web = mode.has_mode(ui::AXMode::kWebContents);
bool text = mode.has_mode(ui::AXMode::kInlineTextBoxes);
bool screenreader = mode.has_mode(ui::AXMode::kScreenReader);
bool extendedProperties = mode.has_mode(ui::AXMode::kExtendedProperties);
bool html = mode.has_mode(ui::AXMode::kHTML);
bool pdf_printing = mode.has_mode(ui::AXMode::kPDFPrinting);
@ -209,12 +209,12 @@ void HandleAccessibilityRequestCallback(
data.Set(kNative, is_native_enabled ? (native ? kOn : kOff) : kDisabled);
data.Set(kWeb, is_native_enabled ? (web ? kOn : kOff) : kDisabled);
// The "text", "screenreader" and "html" flags are only
// The "text", "extendedProperties" and "html" flags are only
// meaningful if "web" is enabled.
bool is_web_enabled = is_native_enabled && web;
data.Set(kText, is_web_enabled ? (text ? kOn : kOff) : kDisabled);
data.Set(kScreenReader,
is_web_enabled ? (screenreader ? kOn : kOff) : kDisabled);
data.Set(kExtendedProperties,
is_web_enabled ? (extendedProperties ? kOn : kOff) : kDisabled);
data.Set(kHTML, is_web_enabled ? (html ? kOn : kOff) : kDisabled);
// The "pdfPrinting" flag is independent of the others.
@ -281,7 +281,7 @@ void HandleAccessibilityRequestCallback(
base::Value::Dict descriptor = BuildTargetDescriptor(rvh);
descriptor.Set(kNative, is_native_enabled);
descriptor.Set(kScreenReader, is_web_enabled && screenreader);
descriptor.Set(kExtendedProperties, is_web_enabled && extendedProperties);
descriptor.Set(kWeb, is_web_enabled);
page_list.Append(std::move(descriptor));
}
@ -668,8 +668,8 @@ void AccessibilityUIMessageHandler::ToggleAccessibilityForWebContents(
current_mode.set_mode(ui::AXMode::kInlineTextBoxes, true);
}
if (mode & ui::AXMode::kScreenReader) {
current_mode.set_mode(ui::AXMode::kScreenReader, true);
if (mode & ui::AXMode::kExtendedProperties) {
current_mode.set_mode(ui::AXMode::kExtendedProperties, true);
}
if (mode & ui::AXMode::kHTML) {
@ -716,8 +716,8 @@ void AccessibilityUIMessageHandler::SetGlobalFlag(
new_mode = ui::AXMode::kWebContents;
} else if (flag_name == kText) {
new_mode = ui::AXMode::kInlineTextBoxes;
} else if (flag_name == kScreenReader) {
new_mode = ui::AXMode::kScreenReader;
} else if (flag_name == kExtendedProperties) {
new_mode = ui::AXMode::kExtendedProperties;
} else if (flag_name == kHTML) {
new_mode = ui::AXMode::kHTML;
} else {
@ -727,7 +727,7 @@ void AccessibilityUIMessageHandler::SetGlobalFlag(
// It doesn't make sense to enable one of the flags that depends on
// web contents without enabling web contents accessibility too.
if (enabled && (new_mode.has_mode(ui::AXMode::kInlineTextBoxes) ||
new_mode.has_mode(ui::AXMode::kScreenReader) ||
new_mode.has_mode(ui::AXMode::kExtendedProperties) ||
new_mode.has_mode(ui::AXMode::kHTML))) {
new_mode.set_mode(ui::AXMode::kWebContents, true);
}
@ -736,7 +736,7 @@ void AccessibilityUIMessageHandler::SetGlobalFlag(
// flags that depend on it.
if (!enabled && new_mode.has_mode(ui::AXMode::kWebContents)) {
new_mode.set_mode(ui::AXMode::kInlineTextBoxes, true);
new_mode.set_mode(ui::AXMode::kScreenReader, true);
new_mode.set_mode(ui::AXMode::kExtendedProperties, true);
new_mode.set_mode(ui::AXMode::kHTML, true);
}

@ -91,7 +91,7 @@ namespace {
// All AXMode flags of kAXModeWebContentsOnly are needed. |ui::AXMode::kHTML| is
// needed for retrieveing the `aria-expanded` attribute.
// |ui::AXMode::kScreenReader| is needed for HTML tag, and heading level
// |ui::AXMode::kExtendedProperties| is needed for HTML tag, and heading level
// information. |ui::AXMode::kInlineTextBoxes| is needed for complete screen2x
// output -- if excluded, some nodes from the tree will not be identified as
// content nodes.

@ -34,9 +34,10 @@ class AXTreeDistillerTestBase : public ChromeRenderViewTest {
// all HTML attributes into the accessibility tree. It should be removed
// ASAP.
//
// |ui::AXMode::kScreenReader| is needed for heading level information.
// |ui::AXMode::kExtendedProperties| is needed for heading level
// information.
const ui::AXMode ax_mode = ui::AXMode::kWebContents | ui::AXMode::kHTML |
ui::AXMode::kScreenReader;
ui::AXMode::kExtendedProperties;
render_frame->CreateAXTreeSnapshotter(ax_mode)->Snapshot(
/* max_nodes= */ 0,
/* timeout= */ {}, &snapshot);

@ -25,7 +25,7 @@ TEST_F(A11yUtilsTest, SetAutofillSuggestionAvailability) {
// Creating context imitates a screen reader enabled, so that all ax nodes
// are created and attributes/state are updatable.
auto ax_context = std::make_unique<blink::WebAXContext>(
document, ui::AXMode::kScreenReader);
document, ui::AXMode::kExtendedProperties);
ax_context->UpdateAXForAllDocuments();
blink::WebInputElement element =
@ -35,7 +35,7 @@ TEST_F(A11yUtilsTest, SetAutofillSuggestionAvailability) {
// kNoSuggestions by default.
ui::AXNodeData node_data;
element_ax_object.Serialize(&node_data, ui::AXMode::kScreenReader);
element_ax_object.Serialize(&node_data, ui::AXMode::kExtendedProperties);
EXPECT_FALSE(node_data.HasState(ax::mojom::State::kAutofillAvailable));
EXPECT_FALSE(
node_data.HasStringAttribute(ax::mojom::StringAttribute::kAutoComplete));
@ -46,7 +46,7 @@ TEST_F(A11yUtilsTest, SetAutofillSuggestionAvailability) {
ax_context->UpdateAXForAllDocuments();
node_data = ui::AXNodeData();
element_ax_object.Serialize(&node_data, ui::AXMode::kScreenReader);
element_ax_object.Serialize(&node_data, ui::AXMode::kExtendedProperties);
EXPECT_TRUE(node_data.HasState(ax::mojom::State::kAutofillAvailable));
EXPECT_FALSE(
node_data.HasStringAttribute(ax::mojom::StringAttribute::kAutoComplete));
@ -57,7 +57,7 @@ TEST_F(A11yUtilsTest, SetAutofillSuggestionAvailability) {
ax_context->UpdateAXForAllDocuments();
node_data = ui::AXNodeData();
element_ax_object.Serialize(&node_data, ui::AXMode::kScreenReader);
element_ax_object.Serialize(&node_data, ui::AXMode::kExtendedProperties);
EXPECT_FALSE(node_data.HasState(ax::mojom::State::kAutofillAvailable));
EXPECT_TRUE(
node_data.HasStringAttribute(ax::mojom::StringAttribute::kAutoComplete));
@ -68,7 +68,7 @@ TEST_F(A11yUtilsTest, SetAutofillSuggestionAvailability) {
ax_context->UpdateAXForAllDocuments();
node_data = ui::AXNodeData();
element_ax_object.Serialize(&node_data, ui::AXMode::kScreenReader);
element_ax_object.Serialize(&node_data, ui::AXMode::kExtendedProperties);
EXPECT_FALSE(node_data.HasState(ax::mojom::State::kAutofillAvailable));
EXPECT_FALSE(
node_data.HasStringAttribute(ax::mojom::StringAttribute::kAutoComplete));

@ -770,7 +770,7 @@ void AutofillAgent::OnDestruct() {
}
void AutofillAgent::AccessibilityModeChanged(const ui::AXMode& mode) {
is_screen_reader_enabled_ = mode.has_mode(ui::AXMode::kScreenReader);
is_screen_reader_enabled_ = mode.has_mode(ui::AXMode::kExtendedProperties);
}
void AutofillAgent::FireHostSubmitEvents(const FormData& form_data,

@ -481,7 +481,7 @@ bool AutofillExternalDelegate::HasActiveScreenReader() const {
// Note: This always returns false if ChromeVox is in use because the
// process-wide AXMode is not updated in that case.
return ui::AXPlatform::GetInstance().GetMode().has_mode(
ui::AXMode::kScreenReader);
ui::AXMode::kExtendedProperties);
#endif
}

@ -399,7 +399,7 @@ class CaptionBubbleLabel : public views::Label {
// a tabstop, so it should only be focusable for screen reader users.
void SetFocusBehaviorForAccessibility() {
SetFocusBehavior(ui::AXPlatform::GetInstance().GetMode().has_mode(
ui::AXMode::kScreenReader)
ui::AXMode::kExtendedProperties)
? FocusBehavior::ALWAYS
: FocusBehavior::NEVER);
}

@ -543,8 +543,8 @@ void PdfAccessibilityTree::OnHasSearchifyText() {
content::RenderAccessibility* render_accessibility =
render_frame() ? render_frame()->GetRenderAccessibility() : nullptr;
bool screen_reader_mode =
(render_accessibility &&
render_accessibility->GetAXMode().has_mode(ui::AXMode::kScreenReader));
(render_accessibility && render_accessibility->GetAXMode().has_mode(
ui::AXMode::kExtendedProperties));
base::UmaHistogramBoolean(
"Accessibility.ScreenAI.Searchify.ScreenReaderModeEnabled",
screen_reader_mode);

@ -232,10 +232,10 @@ FeaturePromoControllerCommon::CloseBubbleAndContinuePromoWithReason(
return FeaturePromoHandle(GetAsWeakPtr(), &iph_feature);
}
bool FeaturePromoControllerCommon::CheckScreenReaderPromptAvailable(
bool FeaturePromoControllerCommon::CheckExtendedPropertiesPromptAvailable(
bool for_demo) const {
if (!ui::AXPlatform::GetInstance().GetMode().has_mode(
ui::AXMode::kScreenReader)) {
ui::AXMode::kExtendedProperties)) {
return false;
}

@ -316,7 +316,7 @@ class FeaturePromoControllerCommon : public FeaturePromoController {
// ShouldTriggerHelpUI() to always return false if another promo is being
// displayed. Once we have machinery to allow concurrency in the FE system
// all of this logic can be rewritten.
bool CheckScreenReaderPromptAvailable(bool for_demo) const;
bool CheckExtendedPropertiesPromptAvailable(bool for_demo) const;
// Creates a lifecycle for the given promo.
std::unique_ptr<FeaturePromoLifecycle> CreateLifecycleFor(

@ -428,7 +428,7 @@ FeaturePromoResult FeaturePromoController20::MaybeShowPromoCommon(
// TODO(crbug.com/40200981): Currently this must be called before
// ShouldTriggerHelpUI() below. See bug for details.
const bool screen_reader_available =
CheckScreenReaderPromptAvailable(for_demo || in_iph_demo_mode_);
CheckExtendedPropertiesPromptAvailable(for_demo || in_iph_demo_mode_);
if (!for_demo && !feature_engagement_tracker()->ShouldTriggerHelpUI(
params.feature.get())) {

@ -388,7 +388,8 @@ FeaturePromoResult FeaturePromoController25::ShowPromo(PromoData& promo_data) {
// TODO(crbug.com/40200981): Currently this must be called before
// ShouldTriggerHelpUI() below. See bug for details.
show_params.screen_reader_prompt_available =
CheckScreenReaderPromptAvailable(promo_data.for_demo || in_demo_mode);
CheckExtendedPropertiesPromptAvailable(promo_data.for_demo ||
in_demo_mode);
// When not explicitly for a demo, notify the tracker that the promo is
// starting. Since this is also one of the preconditions for the promo,

@ -243,7 +243,8 @@ IN_PROC_BROWSER_TEST_F(AccessibilityModeTest, AddScreenReaderModeFlag) {
AccessibilityNotificationWaiter waiter2(shell()->web_contents(), ui::AXMode(),
ax::mojom::Event::kLoadComplete);
ScopedAccessibilityModeOverride ax_mode_override(ui::AXMode::kScreenReader);
ScopedAccessibilityModeOverride ax_mode_override(
ui::AXMode::kExtendedProperties);
ASSERT_TRUE(waiter2.WaitForNotification());
const ui::BrowserAccessibility* textbox2 =

@ -2277,12 +2277,12 @@ IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest,
Microsoft::WRL::ComPtr<IAccessibleText> paragraph_text;
SetUpSampleParagraph(&paragraph_text, ui::AXMode::kNativeAPIs |
ui::AXMode::kWebContents |
ui::AXMode::kScreenReader);
ui::AXMode::kExtendedProperties);
AccessibilityNotificationWaiter waiter(
shell()->web_contents(),
ui::AXMode::kNativeAPIs | ui::AXMode::kWebContents |
ui::AXMode::kScreenReader | ui::AXMode::kInlineTextBoxes,
ui::AXMode::kExtendedProperties | ui::AXMode::kInlineTextBoxes,
ax::mojom::Event::kLoadComplete);
// Calling `get_characterExtents` will enable `ui::AXMode::kInlineTextBoxes`
@ -6218,7 +6218,7 @@ IN_PROC_BROWSER_TEST_F(AccessibilityWinUIASelectivelyEnabledBrowserTest,
// Web content accessibility support should now be enabled.
expected_mode |= ui::AXMode::kNativeAPIs | ui::AXMode::kWebContents |
ui::AXMode::kScreenReader;
ui::AXMode::kExtendedProperties;
EXPECT_EQ(expected_mode, content::BrowserAccessibilityStateImpl::GetInstance()
->GetAccessibilityMode());
ASSERT_TRUE(waiter.WaitForNotification());
@ -6244,7 +6244,7 @@ IN_PROC_BROWSER_TEST_F(AccessibilityWinUIASelectivelyEnabledBrowserTest,
UIA_LabeledByPropertyId, variant.Receive()));
}
// Now check that we have complete accessibility support enabled.
expected_mode |= ui::AXMode::kScreenReader;
expected_mode |= ui::AXMode::kExtendedProperties;
EXPECT_EQ(expected_mode, content::BrowserAccessibilityStateImpl::GetInstance()
->GetAccessibilityMode());

@ -146,12 +146,13 @@ const int ModeCollectionForTarget::kUserDataKey;
// Returns a subset of `mode` for delivery to a WebContents.
ui::AXMode FilterAccessibilityModeInvariants(ui::AXMode mode) {
// Strip kLabelImages if kScreenReader is absent.
// Strip kLabelImages if kExtendedProperties is absent.
// TODO(grt): kLabelImages is a feature of //chrome. Find a way to
// achieve this filtering without teaching //content about it. Perhaps via
// the delegate interface to be added in support of https://crbug.com/1470199.
if (ui::AXMode(mode.flags() ^ ui::AXMode::kScreenReader)
.has_mode(ui::AXMode::kLabelImages | ui::AXMode::kScreenReader)) {
if (ui::AXMode(mode.flags() ^ ui::AXMode::kExtendedProperties)
.has_mode(ui::AXMode::kLabelImages |
ui::AXMode::kExtendedProperties)) {
mode.set_mode(ui::AXMode::kLabelImages, false);
}
@ -169,7 +170,7 @@ ui::AXMode FilterAccessibilityModeInvariants(ui::AXMode mode) {
// screen reader mode is turned on after forms control mode. In that case,
// forms mode must be removed.
if (mode.has_mode(ui::AXMode::kInlineTextBoxes) ||
mode.has_mode(ui::AXMode::kScreenReader)) {
mode.has_mode(ui::AXMode::kExtendedProperties)) {
return ui::AXMode(mode.flags(), mode.experimental_flags() &
~ui::AXMode::kExperimentalFormControls);
}

@ -76,12 +76,11 @@ class CONTENT_EXPORT BrowserAccessibilityStateImpl
void AddAccessibilityModeFlags(ui::AXMode mode) override;
void RemoveAccessibilityModeFlags(ui::AXMode mode) override;
void ResetAccessibilityMode() override;
// These methods indicate the presence of AXMode::kScreenReader, which is
// These methods indicate the presence of AXMode::kAllProperties, which is
// a misnomer because it is used by many clients, and not just screen readers.
// Methods with "KnownAssistiveTech" in the name deal with actual
// screen reader usage.
// TODO(accessibility) Rename these methods and AXMode::kScreenReader to
// something like kAllProperties.
// TODO(accessibility) Rename these methods to fix the misnomer.
void OnScreenReaderDetected() override;
void OnScreenReaderStopped() override;
// Some platforms have a strong signal indicating the presence of a

@ -439,14 +439,14 @@ void BrowserAccessibilityStateImplAndroid::UpdateHistogramsOnOtherThread() {
DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::UI));
// Old screen reader metric: does not indicate the use of a screen reader,
// just kScreenReader mode, which is used by many clients.
// just kExtendedProperties mode, which is used by many clients.
// TODO(accessibility) Add metric for Talkback usage and remove this
// metric, which is redundant with
// PerformanceManager.Experimental.HasAccessibilityModeFlag.
ui::AXMode mode =
BrowserAccessibilityStateImpl::GetInstance()->GetAccessibilityMode();
UMA_HISTOGRAM_BOOLEAN("Accessibility.Android.ScreenReader",
mode.has_mode(ui::AXMode::kScreenReader));
mode.has_mode(ui::AXMode::kExtendedProperties));
}
void BrowserAccessibilityStateImplAndroid::UpdateUniqueUserHistograms() {
@ -454,12 +454,12 @@ void BrowserAccessibilityStateImplAndroid::UpdateUniqueUserHistograms() {
ui::AXMode mode = GetAccessibilityMode();
// Old screen reader metric: does not indicate the use of a screen reader,
// just kScreenReader mode, which is used by many clients.
// just kExtendedProperties mode, which is used by many clients.
// TODO(accessibility) Add metric for Talkback usage and remove this
// metric, which is redundant with
// PerformanceManager.Experimental.HasAccessibilityModeFlag.
UMA_HISTOGRAM_BOOLEAN("Accessibility.Android.ScreenReader.EveryReport",
mode.has_mode(ui::AXMode::kScreenReader));
mode.has_mode(ui::AXMode::kExtendedProperties));
UMA_HISTOGRAM_BOOLEAN("Accessibility.Android.Talkback.EveryReport",
is_talkback_active_);
}

@ -83,7 +83,7 @@ void BrowserAccessibilityStateImplMac::UpdateHistogramsOnOtherThread() {
ui::AXMode mode =
BrowserAccessibilityStateImpl::GetInstance()->GetAccessibilityMode();
UMA_HISTOGRAM_BOOLEAN("Accessibility.Mac.ScreenReader",
mode.has_mode(ui::AXMode::kScreenReader));
mode.has_mode(ui::AXMode::kExtendedProperties));
}
void BrowserAccessibilityStateImplMac::SetKnownScreenReaderAppActive(
@ -114,12 +114,12 @@ void BrowserAccessibilityStateImplMac::UpdateUniqueUserHistograms() {
ui::AXMode mode = GetAccessibilityMode();
// Old screen reader metric: does not indicate the use of a screen reader,
// just kScreenReader mode, which is used by many clients.
// just kExtendedProperties mode, which is used by many clients.
// Instead of this, use the specific VoiceOver metric.
// TODO(accessibility) Remove this, which is redundant with
// PerformanceManager.Experimental.HasAccessibilityModeFlag.
UMA_HISTOGRAM_BOOLEAN("Accessibility.Mac.ScreenReader.EveryReport",
mode.has_mode(ui::AXMode::kScreenReader));
mode.has_mode(ui::AXMode::kExtendedProperties));
UMA_HISTOGRAM_BOOLEAN("Accessibility.Mac.VoiceOver.EveryReport",
is_voiceover_active_);
}

@ -104,7 +104,7 @@ class WindowsAccessibilityEnabler
void OnProbableUIAutomationScreenReaderDetected() override {
// Same as kAXModeComplete but without kHTML as it is not needed for UIA.
AddAXModeForUIA(ui::AXMode::kNativeAPIs | ui::AXMode::kWebContents |
ui::AXMode::kScreenReader);
ui::AXMode::kExtendedProperties);
}
void OnTextPatternRequested() override {
@ -195,14 +195,14 @@ void BrowserAccessibilityStateImplWin::UpdateKnownAssistiveTechSlow() {
// UpdateHistogramsOnUIThread instead.
// Old screen reader metric: does not indicate the use of a screen reader,
// just kScreenReader mode, which is used by many clients.
// just kExtendedProperties mode, which is used by many clients.
// Instead of this, use specific metrics below, e.g. WinJAWS, WinNVDA.
// TODO(accessibility) Remove this, which is redundant with
// PerformanceManager.Experimental.HasAccessibilityModeFlag.
ui::AXMode mode =
BrowserAccessibilityStateImpl::GetInstance()->GetAccessibilityMode();
UMA_HISTOGRAM_BOOLEAN("Accessibility.WinScreenReader2",
mode.has_mode(ui::AXMode::kScreenReader));
mode.has_mode(ui::AXMode::kExtendedProperties));
STICKYKEYS sticky_keys = {0};
sticky_keys.cbSize = sizeof(STICKYKEYS);
@ -332,7 +332,7 @@ void BrowserAccessibilityStateImplWin::UpdateUniqueUserHistograms() {
ui::AXMode mode = GetAccessibilityMode();
UMA_HISTOGRAM_BOOLEAN("Accessibility.WinScreenReader2.EveryReport",
mode.has_mode(ui::AXMode::kScreenReader));
mode.has_mode(ui::AXMode::kExtendedProperties));
UMA_HISTOGRAM_BOOLEAN("Accessibility.WinJAWS.EveryReport", is_jaws_active_);
UMA_HISTOGRAM_BOOLEAN("Accessibility.WinNVDA.EveryReport", is_nvda_active_);
UMA_HISTOGRAM_BOOLEAN("Accessibility.WinSupernova.EveryReport",

@ -315,7 +315,7 @@ IN_PROC_BROWSER_TEST_F(ScopedAccessibilityModeTest, Filtering) {
wc_mode = accessibility_state().CreateScopedModeForWebContents(
&web_contents1(), ui::AXMode::kPDFOcr | ui::AXMode::kLabelImages);
// The WebContents doesn't get kLabelImages until kScreenReader appears.
// The WebContents doesn't get kLabelImages until kExtendedProperties appears.
ASSERT_EQ(web_contents1().GetAccessibilityMode() & ~kIgnoredModeFlags,
(ui::kAXModeBasic | ui::AXMode::kPDFOcr) & ~kIgnoredModeFlags);

@ -1494,7 +1494,7 @@ jint WebContentsAccessibilityAndroid::FindElementType(
EnumForPredicate(element_type));
} else {
// When TalkBack isn't running, split by AXMode (for TB we know we will for
// sure be in a mode with kScreenReader).
// sure be in a mode with kExtendedProperties).
BrowserAccessibilityStateImpl* accessibility_state =
BrowserAccessibilityStateImpl::GetInstance();
ui::AXMode mode = accessibility_state->GetAccessibilityMode();

@ -2014,7 +2014,7 @@ DisableForRenderFrameHostReasonToProtocol(
case BackForwardCacheDisable::DisabledReasonId::kMediaSessionService:
return Page::BackForwardCacheNotRestoredReasonEnum::
ContentMediaSessionService;
case BackForwardCacheDisable::DisabledReasonId::kScreenReader:
case BackForwardCacheDisable::DisabledReasonId::kExtendedProperties:
return Page::BackForwardCacheNotRestoredReasonEnum::
ContentScreenReader;
case BackForwardCacheDisable::DisabledReasonId::kDiscarded:

@ -28,7 +28,7 @@ std::string ReasonIdToString(
return "WebUSB";
case BackForwardCacheDisable::DisabledReasonId::kMediaSessionService:
return "MediaSessionService";
case BackForwardCacheDisable::DisabledReasonId::kScreenReader:
case BackForwardCacheDisable::DisabledReasonId::kExtendedProperties:
return "ScreenReader";
case BackForwardCacheDisable::DisabledReasonId::kDiscarded:
return "Discarded";

@ -41,7 +41,7 @@ class CONTENT_EXPORT BackForwardCacheDisable {
// TODO(crbug.com/40805561): Screen readers do not recognize a navigation
// when the page is served from bfcache.
kScreenReader = 13,
kExtendedProperties = 13,
// Documents that are cleared for discard should not be BFCached.
kDiscarded = 14,

@ -85,13 +85,13 @@ class CONTENT_EXPORT BrowserAccessibilityState {
virtual void ResetAccessibilityMode() = 0;
// Called when an accessibility client is detected, using a heuristic.
// These methods indicate the presence of AXMode::kScreenReader, which is
// a misnomer because it is used by many clients, and not just screen readers.
// Methods with "KnownScreenReader" or KnownAssistiveTech" in the name deal
// with actual screen reader or assistive tech usage.
// These methods indicate the presence of AXMode::kExtendedProperties, which
// is a misnomer because it is used by many clients, and not just screen
// readers. Methods with "KnownScreenReader" or KnownAssistiveTech" in the
// name deal with actual screen reader or assistive tech usage.
virtual void OnScreenReaderDetected() = 0;
// Called when kScreenReader mode should be turned off.
// Called when kExtendedProperties mode should be turned off.
virtual void OnScreenReaderStopped() = 0;
// Some platforms have a strong signal indicating the presence of a

@ -29,7 +29,7 @@ TEST_F(AXContextTest, AXContextSetsAXMode) {
SetBodyInnerHTML(R"HTML(<p>Hello, world</p>)HTML");
constexpr ui::AXMode mode_1 = ui::AXMode::kWebContents;
constexpr ui::AXMode mode_2 = ui::AXMode::kScreenReader;
constexpr ui::AXMode mode_2 = ui::AXMode::kExtendedProperties;
ui::AXMode mode_combined = mode_1;
mode_combined |= mode_2;

@ -1388,7 +1388,7 @@ void AXObject::Serialize(ui::AXNodeData* node_data,
SerializeBoundingBoxAttributes(*node_data);
}
if (accessibility_mode.has_mode(ui::AXMode::kScreenReader)) {
if (accessibility_mode.has_mode(ui::AXMode::kExtendedProperties)) {
// TODO(accessibility) We serialize these even on ignored nodes, in order
// for the browser side to compute inherited colors for descendants, but we
// do not ensure that elements that change foreground/background color are
@ -1398,7 +1398,7 @@ void AXObject::Serialize(ui::AXNodeData* node_data,
SerializeColorAttributes(node_data); // Blends using all nodes' values.
}
if (accessibility_mode.has_mode(ui::AXMode::kScreenReader) ||
if (accessibility_mode.has_mode(ui::AXMode::kExtendedProperties) ||
accessibility_mode.has_mode(ui::AXMode::kPDFPrinting)) {
SerializeLangAttribute(node_data); // Propagates using all nodes' values.
}
@ -1423,7 +1423,7 @@ void AXObject::Serialize(ui::AXNodeData* node_data,
SerializeUnignoredAttributes(node_data, accessibility_mode, is_snapshot);
if (!accessibility_mode.has_mode(ui::AXMode::kScreenReader)) {
if (!accessibility_mode.has_mode(ui::AXMode::kExtendedProperties)) {
// Return early. None of the following attributes are needed outside of
// screen reader mode.
return;
@ -1936,8 +1936,9 @@ void AXObject::SerializeNameAndDescriptionAttributes(
TruncateAndAddStringAttribute(
node_data, ax::mojom::blink::StringAttribute::kTooltip, title);
if (!accessibility_mode.has_mode(ui::AXMode::kScreenReader))
if (!accessibility_mode.has_mode(ui::AXMode::kExtendedProperties)) {
return;
}
String placeholder = Placeholder(name_from);
TruncateAndAddStringAttribute(
@ -2371,7 +2372,7 @@ void AXObject::SerializeUnignoredAttributes(ui::AXNodeData* node_data,
bool is_snapshot) const {
SerializeNameAndDescriptionAttributes(accessibility_mode, node_data);
if (accessibility_mode.has_mode(ui::AXMode::kScreenReader)) {
if (accessibility_mode.has_mode(ui::AXMode::kExtendedProperties)) {
SerializeMarkerAttributes(node_data);
#if BUILDFLAG(IS_ANDROID)
// On Android, style attributes are only serialized for snapshots, or, when
@ -2458,7 +2459,7 @@ void AXObject::SerializeUnignoredAttributes(ui::AXNodeData* node_data,
else if (Orientation() == blink::kAccessibilityOrientationHorizontal)
node_data->AddState(ax::mojom::blink::State::kHorizontal);
if (accessibility_mode.has_mode(ui::AXMode::kScreenReader) ||
if (accessibility_mode.has_mode(ui::AXMode::kExtendedProperties) ||
accessibility_mode.has_mode(ui::AXMode::kPDFPrinting)) {
// Heading level.
if (ui::IsHeading(role) && HeadingLevel()) {

@ -2056,11 +2056,11 @@ TEST_F(AccessibilityTest, StitchChildTree) {
ScopedFreezeAXCache freeze(GetAXObjectCache());
ui::AXNodeData div_node_data;
div->Serialize(&div_node_data, ui::AXMode::kScreenReader);
div->Serialize(&div_node_data, ui::AXMode::kExtendedProperties);
ui::AXNodeData button_node_data;
button->Serialize(&button_node_data, ui::AXMode::kScreenReader);
button->Serialize(&button_node_data, ui::AXMode::kExtendedProperties);
ui::AXNodeData canvas_node_data;
canvas->Serialize(&canvas_node_data, ui::AXMode::kScreenReader);
canvas->Serialize(&canvas_node_data, ui::AXMode::kExtendedProperties);
EXPECT_EQ(div_child_tree_id.ToString(),
div_node_data.GetStringAttribute(

@ -3407,11 +3407,12 @@ even if they fit the naming pattern. -->
<variant name="WinNarrator" summary="Windows, specifically Narrator."/>
<variant name="WinNVDA" summary="Windows, specifically NVDA"/>
<variant name="WinScreenReader2"
summary="Windows. This is tracking the presence of the kScreenReader
mode flag. In this case, Chrome has detected accessibility
calls that would normally only occur from a screen reader.
See also the more specific metrics such as
Accessibility.WinJAWS/WinNVDA, or Accessibility.ModeFlag"/>
summary="Windows. This is tracking the presence of the
kExtendedProperties mode flag. In this case, Chrome has
detected accessibility calls that would normally only occur
from a screen reader. See also the more specific metrics
such as Accessibility.WinJAWS/WinNVDA, or
Accessibility.ModeFlag"/>
<variant name="WinSupernova" summary="Windows, specifically Supernova."/>
</token>
<token key="ReportDelay" variants="ReportDelay"/>

@ -42,8 +42,8 @@ std::string AXMode::ToString() const {
case AXMode::kInlineTextBoxes:
flag_name = "kInlineTextBoxes";
break;
case AXMode::kScreenReader:
flag_name = "kScreenReader";
case AXMode::kExtendedProperties:
flag_name = "kExtendedProperties";
break;
case AXMode::kHTML:
flag_name = "kHTML";

@ -63,7 +63,7 @@ class AX_BASE_EXPORT AXMode {
// attributes, table cell information, live region properties, range
// values, and relationship attributes. Note that the HTML tag, ID, class, and
// display attributes will also be included.
static constexpr uint32_t kScreenReader = 1 << 3;
static constexpr uint32_t kExtendedProperties = 1 << 3;
// The accessibility tree will contain all the HTML attributes for all
// accessibility nodes that come from web content. This effectively dumps all
@ -223,14 +223,14 @@ inline constexpr AXMode kAXModeBasic(AXMode::kNativeAPIs |
// not present.
inline constexpr AXMode kAXModeWebContentsOnly(AXMode::kWebContents |
AXMode::kInlineTextBoxes |
AXMode::kScreenReader);
AXMode::kExtendedProperties);
// Used when an AT that requires full accessibility access, such as a screen
// reader, is present.
inline constexpr AXMode kAXModeComplete(AXMode::kNativeAPIs |
AXMode::kWebContents |
AXMode::kInlineTextBoxes |
AXMode::kScreenReader);
AXMode::kExtendedProperties);
// Used when tools that only need autofill functionality are present.
inline constexpr AXMode kAXModeFormControls(AXMode::kNativeAPIs |

@ -54,7 +54,7 @@ void RecordAccessibilityModeHistograms(AXHistogramPrefix prefix,
AXMode::ModeFlagHistogramValue::UMA_AX_MODE_INLINE_TEXT_BOXES);
}
if (new_mode_flags & AXMode::kScreenReader) {
if (new_mode_flags & AXMode::kExtendedProperties) {
RecordModeFlag(prefix,
AXMode::ModeFlagHistogramValue::UMA_AX_MODE_SCREEN_READER);
}

@ -348,8 +348,8 @@ void AXPlatformNodeWin::AddAttributeToList(const char* name,
// This also sets kNativeAPIs and kWebContents to ensure we don't have an
// incorrect combination of AXModes.
const uint32_t kScreenReaderAccessibilityMode =
AXMode::kNativeAPIs | AXMode::kWebContents | AXMode::kScreenReader;
const uint32_t kExtendedPropertiesAccessibilityMode =
AXMode::kNativeAPIs | AXMode::kWebContents | AXMode::kExtendedProperties;
//
// WinAccessibilityAPIUsageObserver
@ -1811,7 +1811,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_accDefaultAction(VARIANT var_id,
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_ACC_DEFAULT_ACTION);
AXPlatformNodeWin* target;
COM_OBJECT_VALIDATE_VAR_ID_1_ARG_AND_GET_TARGET(var_id, def_action, target);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
int action;
if (!target->GetIntAttribute(ax::mojom::IntAttribute::kDefaultActionVerb,
@ -2083,7 +2083,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_states(AccessibleStates* states) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_states");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_STATES);
COM_OBJECT_VALIDATE_1_ARG(states);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
*states = ComputeIA2State();
return S_OK;
@ -2195,7 +2195,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_attributes(BSTR* attributes) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_attributes");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_IA2_GET_ATTRIBUTES);
COM_OBJECT_VALIDATE_1_ARG(attributes);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
*attributes = nullptr;
std::wstring attributes_str;
@ -2227,7 +2227,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_nRelations(LONG* n_relations) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_nRelations");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_N_RELATIONS);
COM_OBJECT_VALIDATE_1_ARG(n_relations);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
int count = AXPlatformRelationWin::EnumerateRelationships(
this, -1, std::wstring(), nullptr, nullptr);
@ -2240,7 +2240,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_relation(LONG relation_index,
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_relation");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_RELATION);
COM_OBJECT_VALIDATE_1_ARG(relation);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
std::wstring relation_type;
std::vector<AXPlatformNode*> targets;
@ -2269,7 +2269,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_relations(LONG max_relations,
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_relations");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_RELATIONS);
COM_OBJECT_VALIDATE_2_ARGS(relations, n_relations);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
LONG count;
HRESULT hr = get_nRelations(&count);
@ -2294,7 +2294,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_groupPosition(
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_GROUP_POSITION);
COM_OBJECT_VALIDATE_3_ARGS(group_level, similar_items_in_group,
position_in_group);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
*group_level = GetIntAttribute(ax::mojom::IntAttribute::kHierarchicalLevel);
*similar_items_in_group = GetSetSize().value_or(0);
@ -2310,7 +2310,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_localizedExtendedRole(
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_localizedExtendedRole");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_LOCALIZED_EXTENDED_ROLE);
COM_OBJECT_VALIDATE_1_ARG(localized_extended_role);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
std::u16string role_description =
GetRoleDescriptionFromImageAnnotationStatusOrFromAttribute();
@ -2324,7 +2324,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_localizedExtendedRole(
IFACEMETHODIMP AXPlatformNodeWin::get_attribute(BSTR name, VARIANT* attribute) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_attribute");
COM_OBJECT_VALIDATE_1_ARG(attribute);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
std::wstring desired_attribute(name);
@ -2463,7 +2463,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_selectionRanges(IA2Range** ranges,
LONG* nRanges) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_selectionRanges");
COM_OBJECT_VALIDATE_2_ARGS(ranges, nRanges);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
AXSelection unignored_selection = GetDelegate()->GetUnignoredSelection();
AXNodeID anchor_id = unignored_selection.anchor_object_id;
@ -2505,7 +2505,7 @@ IFACEMETHODIMP AXPlatformNodeWin::setSelectionRanges(LONG nRanges,
return E_INVALIDARG;
if (!ranges)
return E_INVALIDARG;
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
if (!ranges->anchor)
return E_INVALIDARG;
@ -3568,7 +3568,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_accessibleAt(LONG row,
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_accessibleAt");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_ACCESSIBLE_AT);
COM_OBJECT_VALIDATE_1_ARG(accessible);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
AXPlatformNodeBase* cell = GetTableCell(int{row}, int{column});
if (!cell)
@ -3582,7 +3582,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_caption(IUnknown** accessible) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_caption");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_CAPTION);
COM_OBJECT_VALIDATE_1_ARG(accessible);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
AXPlatformNodeBase* caption = GetTableCaption();
if (!caption)
@ -3598,7 +3598,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_childIndex(LONG row,
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_childIndex");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_CHILD_INDEX);
COM_OBJECT_VALIDATE_1_ARG(cell_index);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
AXPlatformNodeBase* cell = GetTableCell(int{row}, int{column});
if (!cell)
@ -3617,7 +3617,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_columnDescription(LONG column,
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_columnDescription");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_COLUMN_DESCRIPTION);
COM_OBJECT_VALIDATE_1_ARG(description);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
std::optional<int> columns = GetTableColumnCount();
if (!columns)
@ -3657,7 +3657,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_columnExtentAt(LONG row,
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_columnExtentAt");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_COLUMN_EXTENT_AT);
COM_OBJECT_VALIDATE_1_ARG(n_columns_spanned);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
AXPlatformNodeBase* cell = GetTableCell(int{row}, int{column});
if (!cell)
@ -3676,7 +3676,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_columnHeader(
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_columnHeader");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_COLUMN_HEADER);
COM_OBJECT_VALIDATE_2_ARGS(accessible_table, starting_row_index);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
// Currently unimplemented.
return E_NOTIMPL;
@ -3687,7 +3687,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_columnIndex(LONG cell_index,
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_columnIndex");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_COLUMN_INDEX);
COM_OBJECT_VALIDATE_1_ARG(column_index);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
AXPlatformNodeBase* cell = GetTableCell(cell_index);
if (!cell)
@ -3704,7 +3704,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_nColumns(LONG* column_count) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_nColumns");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_N_COLUMNS);
COM_OBJECT_VALIDATE_1_ARG(column_count);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
std::optional<int> columns = GetTableColumnCount();
if (!columns)
return E_FAIL;
@ -3716,7 +3716,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_nRows(LONG* row_count) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_nRows");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_N_ROWS);
COM_OBJECT_VALIDATE_1_ARG(row_count);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
std::optional<int> rows = GetTableRowCount();
if (!rows)
return E_FAIL;
@ -3728,7 +3728,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_nSelectedChildren(LONG* cell_count) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_nSelectedChildren");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_N_SELECTED_CHILDREN);
COM_OBJECT_VALIDATE_1_ARG(cell_count);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
std::optional<int> columns = GetTableColumnCount();
std::optional<int> rows = GetTableRowCount();
@ -3751,7 +3751,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_nSelectedColumns(LONG* column_count) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_nSelectedColumns");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_N_SELECTED_COLUMNS);
COM_OBJECT_VALIDATE_1_ARG(column_count);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
std::optional<int> columns = GetTableColumnCount();
std::optional<int> rows = GetTableRowCount();
@ -3780,7 +3780,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_nSelectedRows(LONG* row_count) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_nSelectedRows");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_N_SELECTED_ROWS);
COM_OBJECT_VALIDATE_1_ARG(row_count);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
std::optional<int> columns = GetTableColumnCount();
std::optional<int> rows = GetTableRowCount();
@ -3810,7 +3810,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_rowDescription(LONG row,
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_rowDescription");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_ROW_DESCRIPTION);
COM_OBJECT_VALIDATE_1_ARG(description);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
std::optional<int> rows = GetTableRowCount();
if (!rows)
@ -3850,7 +3850,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_rowExtentAt(LONG row,
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_rowExtentAt");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_ROW_EXTENT_AT);
COM_OBJECT_VALIDATE_1_ARG(n_rows_spanned);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
const AXPlatformNodeBase* cell = GetTableCell(int{row}, int{column});
if (!cell)
@ -3869,7 +3869,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_rowHeader(
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_rowHeader");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_ROW_HEADER);
COM_OBJECT_VALIDATE_2_ARGS(accessible_table, starting_column_index);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
// Currently unimplemented.
return E_NOTIMPL;
@ -3879,7 +3879,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_rowIndex(LONG cell_index,
LONG* row_index) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_rowIndex");
COM_OBJECT_VALIDATE_1_ARG(row_index);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
const AXPlatformNodeBase* cell = GetTableCell(cell_index);
if (!cell)
@ -3897,7 +3897,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_selectedChildren(LONG max_children,
LONG* n_children) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_selectedChildren");
COM_OBJECT_VALIDATE_2_ARGS(children, n_children);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
if (max_children <= 0)
return E_INVALIDARG;
@ -3930,7 +3930,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_selectedColumns(LONG max_columns,
LONG* n_columns) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_selectedColumns");
COM_OBJECT_VALIDATE_2_ARGS(columns, n_columns);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
if (max_columns <= 0)
return E_INVALIDARG;
@ -3961,7 +3961,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_selectedRows(LONG max_rows,
LONG* n_rows) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_selectedRows");
COM_OBJECT_VALIDATE_2_ARGS(rows, n_rows);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
if (max_rows <= 0)
return E_INVALIDARG;
@ -3990,7 +3990,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_selectedRows(LONG max_rows,
IFACEMETHODIMP AXPlatformNodeWin::get_summary(IUnknown** accessible) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_summary");
COM_OBJECT_VALIDATE_1_ARG(accessible);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
// Current unimplemented.
return E_NOTIMPL;
@ -4000,7 +4000,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_isColumnSelected(LONG column,
boolean* is_selected) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_isColumnSelected");
COM_OBJECT_VALIDATE_1_ARG(is_selected);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
std::optional<int> columns = GetTableColumnCount();
std::optional<int> rows = GetTableRowCount();
@ -4024,7 +4024,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_isRowSelected(LONG row,
boolean* is_selected) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_isRowSelected");
COM_OBJECT_VALIDATE_1_ARG(is_selected);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
std::optional<int> columns = GetTableColumnCount();
std::optional<int> rows = GetTableRowCount();
@ -4049,7 +4049,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_isSelected(LONG row,
boolean* is_selected) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_isSelected");
COM_OBJECT_VALIDATE_1_ARG(is_selected);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
std::optional<int> columns = GetTableColumnCount();
std::optional<int> rows = GetTableRowCount();
@ -4076,7 +4076,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_rowColumnExtentsAtIndex(
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_rowColumnExtentsAtIndex");
COM_OBJECT_VALIDATE_5_ARGS(row, column, row_extents, column_extents,
is_selected);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
const AXPlatformNodeBase* cell = GetTableCell(index);
if (!cell)
@ -4100,7 +4100,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_rowColumnExtentsAtIndex(
IFACEMETHODIMP AXPlatformNodeWin::selectRow(LONG row) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("selectRow");
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
std::optional<int> rows = GetTableRowCount();
if (!rows)
@ -4114,7 +4114,7 @@ IFACEMETHODIMP AXPlatformNodeWin::selectRow(LONG row) {
IFACEMETHODIMP AXPlatformNodeWin::selectColumn(LONG column) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("selectColumn");
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
std::optional<int> columns = GetTableColumnCount();
if (!columns)
@ -4128,7 +4128,7 @@ IFACEMETHODIMP AXPlatformNodeWin::selectColumn(LONG column) {
IFACEMETHODIMP AXPlatformNodeWin::unselectRow(LONG row) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("unselectRow");
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
std::optional<int> rows = GetTableRowCount();
if (!rows)
@ -4142,7 +4142,7 @@ IFACEMETHODIMP AXPlatformNodeWin::unselectRow(LONG row) {
IFACEMETHODIMP AXPlatformNodeWin::unselectColumn(LONG column) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("unselectColumn");
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
std::optional<int> columns = GetTableColumnCount();
if (!columns)
@ -4173,7 +4173,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_cellAt(LONG row,
IUnknown** cell) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_cellAt");
COM_OBJECT_VALIDATE_1_ARG(cell);
NotifyAddAXModeFlagsForIA2(AXMode::kScreenReader);
NotifyAddAXModeFlagsForIA2(AXMode::kExtendedProperties);
AXPlatformNodeBase* table_cell = GetTableCell(int{row}, int{column});
if (!table_cell)
@ -4194,7 +4194,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_selectedCells(IUnknown*** cells,
LONG* n_selected_cells) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_selectedCells");
COM_OBJECT_VALIDATE_2_ARGS(cells, n_selected_cells);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
std::optional<int> columns = GetTableColumnCount();
std::optional<int> rows = GetTableRowCount();
@ -4239,7 +4239,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_selectedRows(LONG** rows, LONG* n_rows) {
IFACEMETHODIMP AXPlatformNodeWin::get_columnExtent(LONG* n_columns_spanned) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_columnExtent");
COM_OBJECT_VALIDATE_1_ARG(n_columns_spanned);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
std::optional<int> column_span = GetTableColumnSpan();
if (!column_span)
@ -4253,7 +4253,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_columnHeaderCells(
LONG* n_column_header_cells) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_columnHeaderCells");
COM_OBJECT_VALIDATE_2_ARGS(cell_accessibles, n_column_header_cells);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
std::optional<int> column = GetTableColumn();
if (!column)
@ -4280,7 +4280,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_columnHeaderCells(
IFACEMETHODIMP AXPlatformNodeWin::get_columnIndex(LONG* column_index) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_columnIndex");
COM_OBJECT_VALIDATE_1_ARG(column_index);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
std::optional<int> column = GetTableColumn();
if (!column)
@ -4292,7 +4292,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_columnIndex(LONG* column_index) {
IFACEMETHODIMP AXPlatformNodeWin::get_rowExtent(LONG* n_rows_spanned) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_rowExtent");
COM_OBJECT_VALIDATE_1_ARG(n_rows_spanned);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
std::optional<int> row_span = GetTableRowSpan();
if (!row_span)
@ -4306,7 +4306,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_rowHeaderCells(
LONG* n_row_header_cells) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_rowHeaderCells");
COM_OBJECT_VALIDATE_2_ARGS(cell_accessibles, n_row_header_cells);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
std::optional<int> row = GetTableRow();
if (!row)
@ -4333,7 +4333,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_rowHeaderCells(
IFACEMETHODIMP AXPlatformNodeWin::get_rowIndex(LONG* row_index) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_rowIndex");
COM_OBJECT_VALIDATE_1_ARG(row_index);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
std::optional<int> row = GetTableRow();
if (!row)
@ -4345,7 +4345,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_rowIndex(LONG* row_index) {
IFACEMETHODIMP AXPlatformNodeWin::get_isSelected(boolean* is_selected) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_isSelected");
COM_OBJECT_VALIDATE_1_ARG(is_selected);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
if (GetBoolAttribute(ax::mojom::BoolAttribute::kSelected))
*is_selected = true;
@ -4360,7 +4360,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_rowColumnExtents(LONG* row_index,
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_rowColumnExtents");
COM_OBJECT_VALIDATE_5_ARGS(row_index, column_index, row_extents,
column_extents, is_selected);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
std::optional<int> row = GetTableRow();
std::optional<int> column = GetTableColumn();
@ -4381,7 +4381,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_rowColumnExtents(LONG* row_index,
IFACEMETHODIMP AXPlatformNodeWin::get_table(IUnknown** table) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_table");
COM_OBJECT_VALIDATE_1_ARG(table);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
AXPlatformNodeBase* table_node = GetTable();
if (!table_node)
@ -4399,7 +4399,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_nCharacters(LONG* n_characters) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_nCharacters");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_N_CHARACTERS);
COM_OBJECT_VALIDATE_1_ARG(n_characters);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode |
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode |
AXMode::kInlineTextBoxes);
std::u16string text = GetHypertext();
@ -4412,7 +4412,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_caretOffset(LONG* offset) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_caretOffset");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_CARET_OFFSET);
COM_OBJECT_VALIDATE_1_ARG(offset);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
*offset = 0;
if (!HasVisibleCaretOrSelection())
@ -4429,7 +4429,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_nSelections(LONG* n_selections) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_nSelections");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_N_SELECTIONS);
COM_OBJECT_VALIDATE_1_ARG(n_selections);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
*n_selections = 0;
int selection_start, selection_end;
@ -4447,7 +4447,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_selection(LONG selection_index,
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_selection");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_SELECTION);
COM_OBJECT_VALIDATE_2_ARGS(start_offset, end_offset);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
if (!start_offset || !end_offset || selection_index != 0)
return E_INVALIDARG;
@ -4479,7 +4479,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_text(LONG start_offset,
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_text");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_TEXT);
COM_OBJECT_VALIDATE_1_ARG(text);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
HandleSpecialTextOffset(&start_offset);
HandleSpecialTextOffset(&end_offset);
@ -4511,7 +4511,7 @@ HRESULT AXPlatformNodeWin::IAccessibleTextGetTextForOffsetType(
LONG* end_offset,
BSTR* text) {
COM_OBJECT_VALIDATE_3_ARGS(start_offset, end_offset, text);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode |
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode |
AXMode::kInlineTextBoxes);
HandleSpecialTextOffset(&offset);
@ -4675,7 +4675,7 @@ IFACEMETHODIMP AXPlatformNodeWin::addSelection(LONG start_offset,
WIN_ACCESSIBILITY_API_TRACE_EVENT("addSelection");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_ADD_SELECTION);
COM_OBJECT_VALIDATE();
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
// We only support one selection.
return setSelection(0, start_offset, end_offset);
@ -4685,7 +4685,7 @@ IFACEMETHODIMP AXPlatformNodeWin::removeSelection(LONG selection_index) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("removeSelection");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_REMOVE_SELECTION);
COM_OBJECT_VALIDATE();
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
if (selection_index != 0)
return E_INVALIDARG;
@ -4731,7 +4731,7 @@ IFACEMETHODIMP
AXPlatformNodeWin::get_selections(IA2TextSelection** selections,
LONG* nSelections) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_selections");
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
COM_OBJECT_VALIDATE_2_ARGS(selections, nSelections);
@ -4819,7 +4819,7 @@ AXPlatformNodeWin::get_selections(IA2TextSelection** selections,
IFACEMETHODIMP AXPlatformNodeWin::setSelections(LONG nSelections,
IA2TextSelection* selections) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("setSelections");
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
COM_OBJECT_VALIDATE();
@ -4979,7 +4979,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_currentValue(VARIANT* value) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_currentValue");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_CURRENT_VALUE);
COM_OBJECT_VALIDATE_1_ARG(value);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
float float_val;
if (GetFloatAttribute(ax::mojom::FloatAttribute::kValueForRange,
@ -4997,7 +4997,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_minimumValue(VARIANT* value) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_minimumValue");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_MINIMUM_VALUE);
COM_OBJECT_VALIDATE_1_ARG(value);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
float float_val;
if (GetFloatAttribute(ax::mojom::FloatAttribute::kMinValueForRange,
@ -5015,7 +5015,7 @@ IFACEMETHODIMP AXPlatformNodeWin::get_maximumValue(VARIANT* value) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_maximumValue");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_MAXIMUM_VALUE);
COM_OBJECT_VALIDATE_1_ARG(value);
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
float float_val;
if (GetFloatAttribute(ax::mojom::FloatAttribute::kMaxValueForRange,
@ -5033,7 +5033,7 @@ IFACEMETHODIMP AXPlatformNodeWin::setCurrentValue(VARIANT new_value) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("setCurrentValue");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_SET_CURRENT_VALUE);
COM_OBJECT_VALIDATE();
NotifyAddAXModeFlagsForIA2(kScreenReaderAccessibilityMode);
NotifyAddAXModeFlagsForIA2(kExtendedPropertiesAccessibilityMode);
double double_value = 0.0;
if (V_VT(&new_value) == VT_R8)
@ -8577,7 +8577,7 @@ void AXPlatformNodeWin::NotifyAPIObserverForPatternRequest(
text_pattern_support_needed = true;
break;
// These properties require more advanced accessibility features to be
// enabled See kScreenReader for details.
// enabled See kExtendedProperties for details.
case UIA_RangeValuePatternId:
case UIA_TableItemPatternId:
probable_advanced_client_detected = true;

@ -39,9 +39,9 @@
// This also sets kNativeAPIs and kWebContents to ensure we don't have an
// incorrect combination of AXModes.
const uint32_t kScreenReaderAccessibilityMode = ui::AXMode::kNativeAPIs |
ui::AXMode::kWebContents |
ui::AXMode::kScreenReader;
const uint32_t kExtendedPropertiesAccessibilityMode =
ui::AXMode::kNativeAPIs | ui::AXMode::kWebContents |
ui::AXMode::kExtendedProperties;
namespace ui {
@ -245,7 +245,7 @@ IFACEMETHODIMP BrowserAccessibilityComWin::get_characterExtents(
LONG* out_height) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_characterExtents");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_CHARACTER_EXTENTS);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode |
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode |
AXMode::kInlineTextBoxes);
if (!GetOwner()) {
return E_FAIL;
@ -300,7 +300,7 @@ IFACEMETHODIMP BrowserAccessibilityComWin::get_text(LONG start_offset,
BSTR* text) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_text");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_TEXT);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode);
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode);
if (!GetOwner()) {
return E_FAIL;
}
@ -336,7 +336,7 @@ IFACEMETHODIMP BrowserAccessibilityComWin::get_newText(
IA2TextSegment* new_text) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_newText");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_NEW_TEXT);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode);
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode);
if (!GetOwner()) {
return E_FAIL;
}
@ -365,7 +365,7 @@ IFACEMETHODIMP BrowserAccessibilityComWin::get_oldText(
IA2TextSegment* old_text) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_oldText");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_OLD_TEXT);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode);
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode);
if (!GetOwner()) {
return E_FAIL;
}
@ -397,7 +397,7 @@ IFACEMETHODIMP BrowserAccessibilityComWin::scrollSubstringTo(
IA2ScrollType scroll_type) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("scrollSubstringTo");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_SCROLL_SUBSTRING_TO);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode |
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode |
AXMode::kInlineTextBoxes);
// TODO(dmazzoni): adjust this for the start and end index, too.
// TODO(grt): Call an impl fn rather than the COM method.
@ -412,7 +412,7 @@ IFACEMETHODIMP BrowserAccessibilityComWin::scrollSubstringToPoint(
LONG y) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("scrollSubstringToPoint");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_SCROLL_SUBSTRING_TO_POINT);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode |
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode |
AXMode::kInlineTextBoxes);
if (!GetOwner()) {
return E_FAIL;
@ -436,7 +436,7 @@ IFACEMETHODIMP BrowserAccessibilityComWin::scrollSubstringToPoint(
IFACEMETHODIMP BrowserAccessibilityComWin::setCaretOffset(LONG offset) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("setCaretOffset");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_SET_CARET_OFFSET);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode);
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode);
if (!GetOwner()) {
return E_FAIL;
}
@ -449,7 +449,7 @@ IFACEMETHODIMP BrowserAccessibilityComWin::setSelection(LONG selection_index,
LONG end_offset) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("setSelection");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_SET_SELECTION);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode);
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode);
if (!GetOwner()) {
return E_FAIL;
}
@ -468,7 +468,7 @@ IFACEMETHODIMP BrowserAccessibilityComWin::get_attributes(
BSTR* text_attributes) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_attributes");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_IATEXT_GET_ATTRIBUTES);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode);
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode);
if (!start_offset || !end_offset || !text_attributes)
return E_INVALIDARG;
@ -520,7 +520,7 @@ IFACEMETHODIMP BrowserAccessibilityComWin::get_nHyperlinks(
LONG* hyperlink_count) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_nHyperlinks");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_N_HYPERLINKS);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode);
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode);
if (!GetOwner()) {
return E_FAIL;
}
@ -543,7 +543,7 @@ IFACEMETHODIMP BrowserAccessibilityComWin::get_hyperlink(
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_hyperlink");
*hyperlink = nullptr;
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_HYPERLINK);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode);
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode);
if (!GetOwner()) {
return E_FAIL;
}
@ -587,7 +587,7 @@ IFACEMETHODIMP BrowserAccessibilityComWin::get_hyperlinkIndex(
LONG* hyperlink_index) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_hyperlinkIndex");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_HYPERLINK_INDEX);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode);
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode);
if (!GetOwner()) {
return E_FAIL;
}
@ -620,7 +620,7 @@ IFACEMETHODIMP BrowserAccessibilityComWin::get_anchor(LONG index,
VARIANT* anchor) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_anchor");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_ANCHOR);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode);
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode);
if (!GetOwner() || !IsHyperlink()) {
return E_FAIL;
}
@ -648,7 +648,7 @@ IFACEMETHODIMP BrowserAccessibilityComWin::get_anchorTarget(
VARIANT* anchor_target) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_anchorTarget");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_ANCHOR_TARGET);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode);
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode);
if (!GetOwner() || !IsHyperlink()) {
return E_FAIL;
}
@ -679,7 +679,7 @@ IFACEMETHODIMP BrowserAccessibilityComWin::get_anchorTarget(
IFACEMETHODIMP BrowserAccessibilityComWin::get_startIndex(LONG* index) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_startIndex");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_START_INDEX);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode);
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode);
if (!GetOwner() || !IsHyperlink()) {
return E_FAIL;
}
@ -700,7 +700,7 @@ IFACEMETHODIMP BrowserAccessibilityComWin::get_startIndex(LONG* index) {
IFACEMETHODIMP BrowserAccessibilityComWin::get_endIndex(LONG* index) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_endIndex");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_END_INDEX);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode);
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode);
LONG start_index;
// TODO(grt): Call an impl fn rather than the COM method.
HRESULT hr = get_startIndex(&start_index);
@ -713,7 +713,7 @@ IFACEMETHODIMP BrowserAccessibilityComWin::get_endIndex(LONG* index) {
IFACEMETHODIMP BrowserAccessibilityComWin::get_valid(boolean* valid) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_valid");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_VALID);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode);
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode);
return E_NOTIMPL;
}
@ -724,7 +724,7 @@ IFACEMETHODIMP BrowserAccessibilityComWin::get_valid(boolean* valid) {
IFACEMETHODIMP BrowserAccessibilityComWin::nActions(LONG* n_actions) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("nActions");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_N_ACTIONS);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode);
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode);
if (!GetOwner()) {
return E_FAIL;
}
@ -743,7 +743,7 @@ IFACEMETHODIMP BrowserAccessibilityComWin::nActions(LONG* n_actions) {
IFACEMETHODIMP BrowserAccessibilityComWin::doAction(LONG action_index) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("doAction");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_DO_ACTION);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode);
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode);
if (!GetOwner()) {
return E_FAIL;
}
@ -783,7 +783,7 @@ BrowserAccessibilityComWin::get_description(LONG action_index,
BSTR* description) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_description");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_IAACTION_GET_DESCRIPTION);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode);
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode);
return E_NOTIMPL;
}
@ -793,7 +793,7 @@ IFACEMETHODIMP BrowserAccessibilityComWin::get_keyBinding(LONG action_index,
LONG* n_bindings) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_keyBinding");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_KEY_BINDING);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode);
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode);
if (!GetOwner()) {
return E_FAIL;
}
@ -830,7 +830,7 @@ IFACEMETHODIMP BrowserAccessibilityComWin::get_name(LONG action_index,
BSTR* name) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_name");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_NAME);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode);
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode);
if (!GetOwner()) {
return E_FAIL;
}
@ -887,7 +887,7 @@ BrowserAccessibilityComWin::get_localizedName(LONG action_index,
BSTR* localized_name) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_localizedName");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_LOCALIZED_NAME);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode);
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode);
if (!GetOwner()) {
return E_FAIL;
}
@ -950,7 +950,7 @@ BrowserAccessibilityComWin::get_localizedName(LONG action_index,
IFACEMETHODIMP BrowserAccessibilityComWin::get_URL(BSTR* url) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_URL");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_URL);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode);
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode);
if (!GetOwner()) {
return E_FAIL;
}
@ -979,7 +979,7 @@ IFACEMETHODIMP BrowserAccessibilityComWin::get_URL(BSTR* url) {
IFACEMETHODIMP BrowserAccessibilityComWin::get_title(BSTR* title) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_title");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_TITLE);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode);
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode);
if (!GetOwner()) {
return E_FAIL;
}
@ -1004,7 +1004,7 @@ IFACEMETHODIMP BrowserAccessibilityComWin::get_title(BSTR* title) {
IFACEMETHODIMP BrowserAccessibilityComWin::get_mimeType(BSTR* mime_type) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_mimeType");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_MIME_TYPE);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode);
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode);
if (!GetOwner()) {
return E_FAIL;
}
@ -1029,7 +1029,7 @@ IFACEMETHODIMP BrowserAccessibilityComWin::get_mimeType(BSTR* mime_type) {
IFACEMETHODIMP BrowserAccessibilityComWin::get_docType(BSTR* doc_type) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_docType");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_DOC_TYPE);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode);
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode);
if (!GetOwner()) {
return E_FAIL;
}
@ -1056,7 +1056,7 @@ BrowserAccessibilityComWin::get_nameSpaceURIForID(SHORT name_space_id,
BSTR* name_space_uri) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_nameSpaceURIForID");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_NAMESPACE_URI_FOR_ID);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode);
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode);
return E_NOTIMPL;
}
@ -1065,7 +1065,7 @@ BrowserAccessibilityComWin::put_alternateViewMediaTypes(
BSTR* comma_separated_media_types) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("put_alternateViewMediaTypes");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_PUT_ALTERNATE_VIEW_MEDIA_TYPES);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode);
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode);
return E_NOTIMPL;
}
@ -1082,7 +1082,7 @@ IFACEMETHODIMP BrowserAccessibilityComWin::get_nodeInfo(
USHORT* node_type) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_nodeInfo");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_NODE_INFO);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode);
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode);
if (!GetOwner()) {
return E_FAIL;
}
@ -1126,7 +1126,8 @@ IFACEMETHODIMP BrowserAccessibilityComWin::get_attributes(USHORT max_attribs,
USHORT* num_attribs) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_attributes");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_ISIMPLEDOMNODE_GET_ATTRIBUTES);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode | AXMode::kHTML);
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode |
AXMode::kHTML);
if (!GetOwner()) {
return E_FAIL;
}
@ -1246,7 +1247,7 @@ IFACEMETHODIMP BrowserAccessibilityComWin::get_parentNode(
ISimpleDOMNode** node) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_parentNode");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_PARENT_NODE);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode);
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode);
if (!GetOwner()) {
return E_FAIL;
}
@ -1263,7 +1264,7 @@ IFACEMETHODIMP BrowserAccessibilityComWin::get_firstChild(
ISimpleDOMNode** node) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_firstChild");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_FIRST_CHILD);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode);
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode);
if (!GetOwner()) {
return E_FAIL;
}
@ -1285,7 +1286,7 @@ IFACEMETHODIMP BrowserAccessibilityComWin::get_lastChild(
ISimpleDOMNode** node) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_lastChild");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_LAST_CHILD);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode);
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode);
if (!GetOwner()) {
return E_FAIL;
}
@ -1307,7 +1308,7 @@ IFACEMETHODIMP BrowserAccessibilityComWin::get_previousSibling(
ISimpleDOMNode** node) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_previousSibling");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_PREVIOUS_SIBLING);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode);
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode);
if (!GetOwner()) {
return E_FAIL;
}
@ -1333,7 +1334,7 @@ IFACEMETHODIMP BrowserAccessibilityComWin::get_nextSibling(
ISimpleDOMNode** node) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_nextSibling");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_NEXT_SIBLING);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode);
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode);
if (!GetOwner()) {
return E_FAIL;
}
@ -1361,7 +1362,7 @@ IFACEMETHODIMP BrowserAccessibilityComWin::get_childAt(unsigned int child_index,
ISimpleDOMNode** node) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_childAt");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_CHILD_AT);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode);
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode);
if (!GetOwner()) {
return E_FAIL;
}
@ -1387,7 +1388,7 @@ IFACEMETHODIMP BrowserAccessibilityComWin::get_childAt(unsigned int child_index,
IFACEMETHODIMP BrowserAccessibilityComWin::get_innerHTML(BSTR* innerHTML) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_innerHTML");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_INNER_HTML);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode);
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode);
if (!GetOwner()) {
return E_FAIL;
}
@ -1408,14 +1409,14 @@ IFACEMETHODIMP
BrowserAccessibilityComWin::get_localInterface(void** local_interface) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_localInterface");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_LOCAL_INTERFACE);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode);
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode);
return E_NOTIMPL;
}
IFACEMETHODIMP BrowserAccessibilityComWin::get_language(BSTR* language) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_language");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_LANGUAGE);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode);
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode);
if (!language)
return E_INVALIDARG;
*language = nullptr;
@ -1440,7 +1441,7 @@ IFACEMETHODIMP BrowserAccessibilityComWin::get_language(BSTR* language) {
IFACEMETHODIMP BrowserAccessibilityComWin::get_domText(BSTR* dom_text) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_domText");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_DOM_TEXT);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode);
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode);
if (!GetOwner()) {
return E_FAIL;
}
@ -1460,7 +1461,7 @@ IFACEMETHODIMP BrowserAccessibilityComWin::get_clippedSubstringBounds(
int* out_height) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_clippedSubstringBounds");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_CLIPPED_SUBSTRING_BOUNDS);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode |
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode |
AXMode::kInlineTextBoxes);
// TODO(dmazzoni): fully support this API by intersecting the
// rect with the container's rect.
@ -1477,7 +1478,7 @@ IFACEMETHODIMP BrowserAccessibilityComWin::get_unclippedSubstringBounds(
int* out_height) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_unclippedSubstringBounds");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_UNCLIPPED_SUBSTRING_BOUNDS);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode |
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode |
AXMode::kInlineTextBoxes);
if (!GetOwner()) {
return E_FAIL;
@ -1506,7 +1507,7 @@ IFACEMETHODIMP BrowserAccessibilityComWin::scrollToSubstring(
unsigned int end_index) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("scrollToSubstring");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_SCROLL_TO_SUBSTRING);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode |
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode |
AXMode::kInlineTextBoxes);
if (!GetOwner()) {
return E_FAIL;
@ -1533,7 +1534,7 @@ IFACEMETHODIMP BrowserAccessibilityComWin::scrollToSubstring(
IFACEMETHODIMP BrowserAccessibilityComWin::get_fontFamily(BSTR* font_family) {
WIN_ACCESSIBILITY_API_TRACE_EVENT("get_fontFamily");
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_FONT_FAMILY);
AddAccessibilityModeFlags(kScreenReaderAccessibilityMode);
AddAccessibilityModeFlags(kExtendedPropertiesAccessibilityMode);
if (!font_family)
return E_INVALIDARG;
*font_family = nullptr;