tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit da1a6f2a67e667a1f191fa443d41019c64005aad
parent 686747256c18c6779a1e0a41fdebd7d459201d9e
Author: Eitan Isaacson <eitan@monotonous.org>
Date:   Wed, 22 Oct 2025 03:12:53 +0000

Bug 1942799 - P3: Remove specialized moxRequired, moxInvalid and moxValue. r=morgan

This is a cleanup in order to transition to a Objective C class category later.

moxValue: The role check will always be false because this is not a static text role. This is also trying to accomodate very old mac a11y features that have since been replaced.

moxRequired: This implementation matches the base mozAccessible implementation.

moxInvalid: I can't get this to work. I don't think it does anything since it expects the "invalid" attribute in the default string attributes. We already have support for both invalid in attributed text and via aria-invalid.

Differential Revision: https://phabricator.services.mozilla.com/D268629

Diffstat:
Maccessible/mac/mozTextAccessible.h | 9---------
Maccessible/mac/mozTextAccessible.mm | 40----------------------------------------
2 files changed, 0 insertions(+), 49 deletions(-)

diff --git a/accessible/mac/mozTextAccessible.h b/accessible/mac/mozTextAccessible.h @@ -10,15 +10,6 @@ @interface mozTextAccessible : mozAccessible // override -- (id)moxValue; - -// override -- (id)moxRequired; - -// override -- (NSString*)moxInvalid; - -// override - (NSNumber*)moxInsertionPointLineNumber; // override diff --git a/accessible/mac/mozTextAccessible.mm b/accessible/mac/mozTextAccessible.mm @@ -50,46 +50,6 @@ inline NSString* ToNSString(id aValue) { @implementation mozTextAccessible -- (id)moxValue { - // Apple's SpeechSynthesisServer expects AXValue to return an AXStaticText - // object's AXSelectedText attribute. See bug 674612 for details. - // Also if there is no selected text, we return the full text. - // See bug 369710 for details. - if ([[self moxRole] isEqualToString:NSAccessibilityStaticTextRole]) { - NSString* selectedText = [self moxSelectedText]; - return (selectedText && [selectedText length]) ? selectedText : [self text]; - } - - return [self text]; -} - -- (id)moxRequired { - return @([self stateWithMask:states::REQUIRED] != 0); -} - -- (NSString*)moxInvalid { - if ([self stateWithMask:states::INVALID] != 0) { - // If the attribute exists, it has one of four values: true, false, - // grammar, or spelling. We query the attribute value here in order - // to find the correct string to return. - RefPtr<AccAttributes> attributes; - HyperTextAccessibleBase* text = mGeckoAccessible->AsHyperTextBase(); - if (text && mGeckoAccessible->IsTextRole()) { - attributes = text->DefaultTextAttributes(); - } - - nsAutoString invalidStr; - if (!attributes || - !attributes->GetAttribute(nsGkAtoms::invalid, invalidStr)) { - return @"true"; - } - return nsCocoaUtils::ToNSString(invalidStr); - } - - // If the flag is not set, we return false. - return @"false"; -} - - (NSNumber*)moxInsertionPointLineNumber { MOZ_ASSERT(mGeckoAccessible);