summaryrefslogtreecommitdiffstats
path: root/accessible/base
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
commit8dd16259287f58f9273002717ec4d27e97127719 (patch)
tree3863e62a53829a84037444beab3abd4ed9dfc7d0 /accessible/base
parentReleasing progress-linux version 126.0.1-1~progress7.99u1. (diff)
downloadfirefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz
firefox-8dd16259287f58f9273002717ec4d27e97127719.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'accessible/base')
-rw-r--r--accessible/base/ARIAMap.cpp109
-rw-r--r--accessible/base/ARIAMap.h5
-rw-r--r--accessible/base/AccTypes.h1
-rw-r--r--accessible/base/nsAccessibilityService.cpp168
-rw-r--r--accessible/base/nsCoreUtils.cpp26
-rw-r--r--accessible/base/nsCoreUtils.h5
6 files changed, 164 insertions, 150 deletions
diff --git a/accessible/base/ARIAMap.cpp b/accessible/base/ARIAMap.cpp
index d53592acf0..a557405497 100644
--- a/accessible/base/ARIAMap.cpp
+++ b/accessible/base/ARIAMap.cpp
@@ -256,7 +256,7 @@ static const nsRoleMapEntry sWAIRoleMaps[] = {
eNoValue,
eNoAction,
eNoLiveAttr,
- kGenericAccType,
+ eDPub,
kNoReqStates
},
{ // doc-acknowledgments
@@ -286,7 +286,7 @@ static const nsRoleMapEntry sWAIRoleMaps[] = {
eNoValue,
eNoAction,
eNoLiveAttr,
- eLandmark,
+ eDPub | eLandmark,
kNoReqStates
},
{ // doc-backlink
@@ -296,7 +296,7 @@ static const nsRoleMapEntry sWAIRoleMaps[] = {
eNoValue,
eJumpAction,
eNoLiveAttr,
- kGenericAccType,
+ eDPub,
states::LINKED
},
{ // doc-biblioentry
@@ -306,7 +306,7 @@ static const nsRoleMapEntry sWAIRoleMaps[] = {
eNoValue,
eNoAction,
eNoLiveAttr,
- kGenericAccType,
+ eDPub,
states::READONLY
},
{ // doc-bibliography
@@ -316,7 +316,7 @@ static const nsRoleMapEntry sWAIRoleMaps[] = {
eNoValue,
eNoAction,
eNoLiveAttr,
- eLandmark,
+ eDPub | eLandmark,
kNoReqStates
},
{ // doc-biblioref
@@ -326,7 +326,7 @@ static const nsRoleMapEntry sWAIRoleMaps[] = {
eNoValue,
eJumpAction,
eNoLiveAttr,
- kGenericAccType,
+ eDPub,
states::LINKED
},
{ // doc-chapter
@@ -336,7 +336,7 @@ static const nsRoleMapEntry sWAIRoleMaps[] = {
eNoValue,
eNoAction,
eNoLiveAttr,
- eLandmark,
+ eDPub | eLandmark,
kNoReqStates
},
{ // doc-colophon
@@ -346,7 +346,7 @@ static const nsRoleMapEntry sWAIRoleMaps[] = {
eNoValue,
eNoAction,
eNoLiveAttr,
- kGenericAccType,
+ eDPub,
kNoReqStates
},
{ // doc-conclusion
@@ -356,7 +356,7 @@ static const nsRoleMapEntry sWAIRoleMaps[] = {
eNoValue,
eNoAction,
eNoLiveAttr,
- eLandmark,
+ eDPub | eLandmark,
kNoReqStates
},
{ // doc-cover
@@ -366,7 +366,7 @@ static const nsRoleMapEntry sWAIRoleMaps[] = {
eNoValue,
eNoAction,
eNoLiveAttr,
- kGenericAccType,
+ eDPub,
kNoReqStates
},
{ // doc-credit
@@ -376,7 +376,7 @@ static const nsRoleMapEntry sWAIRoleMaps[] = {
eNoValue,
eNoAction,
eNoLiveAttr,
- kGenericAccType,
+ eDPub,
kNoReqStates
},
{ // doc-credits
@@ -386,7 +386,7 @@ static const nsRoleMapEntry sWAIRoleMaps[] = {
eNoValue,
eNoAction,
eNoLiveAttr,
- eLandmark,
+ eDPub | eLandmark,
kNoReqStates
},
{ // doc-dedication
@@ -396,7 +396,7 @@ static const nsRoleMapEntry sWAIRoleMaps[] = {
eNoValue,
eNoAction,
eNoLiveAttr,
- kGenericAccType,
+ eDPub,
kNoReqStates
},
{ // doc-endnote
@@ -406,7 +406,7 @@ static const nsRoleMapEntry sWAIRoleMaps[] = {
eNoValue,
eNoAction,
eNoLiveAttr,
- kGenericAccType,
+ eDPub,
states::READONLY
},
{ // doc-endnotes
@@ -416,7 +416,7 @@ static const nsRoleMapEntry sWAIRoleMaps[] = {
eNoValue,
eNoAction,
eNoLiveAttr,
- eLandmark,
+ eDPub | eLandmark,
kNoReqStates
},
{ // doc-epigraph
@@ -426,7 +426,7 @@ static const nsRoleMapEntry sWAIRoleMaps[] = {
eNoValue,
eNoAction,
eNoLiveAttr,
- kGenericAccType,
+ eDPub,
kNoReqStates
},
{ // doc-epilogue
@@ -436,7 +436,7 @@ static const nsRoleMapEntry sWAIRoleMaps[] = {
eNoValue,
eNoAction,
eNoLiveAttr,
- eLandmark,
+ eDPub | eLandmark,
kNoReqStates
},
{ // doc-errata
@@ -446,17 +446,17 @@ static const nsRoleMapEntry sWAIRoleMaps[] = {
eNoValue,
eNoAction,
eNoLiveAttr,
- eLandmark,
+ eDPub | eLandmark,
kNoReqStates
},
{ // doc-example
nsGkAtoms::docExample,
- roles::SECTION,
+ roles::FIGURE,
kUseMapRole,
eNoValue,
eNoAction,
eNoLiveAttr,
- kGenericAccType,
+ eDPub,
kNoReqStates
},
{ // doc-footnote
@@ -466,7 +466,7 @@ static const nsRoleMapEntry sWAIRoleMaps[] = {
eNoValue,
eNoAction,
eNoLiveAttr,
- eLandmark,
+ eDPub | eLandmark,
kNoReqStates
},
{ // doc-foreword
@@ -476,7 +476,7 @@ static const nsRoleMapEntry sWAIRoleMaps[] = {
eNoValue,
eNoAction,
eNoLiveAttr,
- eLandmark,
+ eDPub | eLandmark,
kNoReqStates
},
{ // doc-glossary
@@ -486,7 +486,7 @@ static const nsRoleMapEntry sWAIRoleMaps[] = {
eNoValue,
eNoAction,
eNoLiveAttr,
- eLandmark,
+ eDPub | eLandmark,
kNoReqStates
},
{ // doc-glossref
@@ -496,7 +496,7 @@ static const nsRoleMapEntry sWAIRoleMaps[] = {
eNoValue,
eJumpAction,
eNoLiveAttr,
- kGenericAccType,
+ eDPub,
states::LINKED
},
{ // doc-index
@@ -506,7 +506,7 @@ static const nsRoleMapEntry sWAIRoleMaps[] = {
eNoValue,
eNoAction,
eNoLiveAttr,
- eLandmark,
+ eDPub | eLandmark,
kNoReqStates
},
{ // doc-introduction
@@ -516,7 +516,7 @@ static const nsRoleMapEntry sWAIRoleMaps[] = {
eNoValue,
eNoAction,
eNoLiveAttr,
- eLandmark,
+ eDPub | eLandmark,
kNoReqStates
},
{ // doc-noteref
@@ -526,7 +526,7 @@ static const nsRoleMapEntry sWAIRoleMaps[] = {
eNoValue,
eJumpAction,
eNoLiveAttr,
- kGenericAccType,
+ eDPub,
states::LINKED
},
{ // doc-notice
@@ -536,7 +536,7 @@ static const nsRoleMapEntry sWAIRoleMaps[] = {
eNoValue,
eNoAction,
eNoLiveAttr,
- kGenericAccType,
+ eDPub,
kNoReqStates
},
{ // doc-pagebreak
@@ -546,7 +546,27 @@ static const nsRoleMapEntry sWAIRoleMaps[] = {
eNoValue,
eNoAction,
eNoLiveAttr,
- kGenericAccType,
+ eDPub,
+ kNoReqStates
+ },
+ { // doc-pagefooter
+ nsGkAtoms::docPagefooter,
+ roles::SECTION,
+ kUseMapRole,
+ eNoValue,
+ eNoAction,
+ eNoLiveAttr,
+ eDPub,
+ kNoReqStates
+ },
+ { // doc-pageheader
+ nsGkAtoms::docPageheader,
+ roles::SECTION,
+ kUseMapRole,
+ eNoValue,
+ eNoAction,
+ eNoLiveAttr,
+ eDPub,
kNoReqStates
},
{ // doc-pagelist
@@ -556,7 +576,7 @@ static const nsRoleMapEntry sWAIRoleMaps[] = {
eNoValue,
eNoAction,
eNoLiveAttr,
- eLandmark,
+ eDPub | eLandmark,
kNoReqStates
},
{ // doc-part
@@ -566,7 +586,7 @@ static const nsRoleMapEntry sWAIRoleMaps[] = {
eNoValue,
eNoAction,
eNoLiveAttr,
- eLandmark,
+ eDPub | eLandmark,
kNoReqStates
},
{ // doc-preface
@@ -576,7 +596,7 @@ static const nsRoleMapEntry sWAIRoleMaps[] = {
eNoValue,
eNoAction,
eNoLiveAttr,
- eLandmark,
+ eDPub | eLandmark,
kNoReqStates
},
{ // doc-prologue
@@ -586,7 +606,7 @@ static const nsRoleMapEntry sWAIRoleMaps[] = {
eNoValue,
eNoAction,
eNoLiveAttr,
- eLandmark,
+ eDPub | eLandmark,
kNoReqStates
},
{ // doc-pullquote
@@ -596,7 +616,7 @@ static const nsRoleMapEntry sWAIRoleMaps[] = {
eNoValue,
eNoAction,
eNoLiveAttr,
- kGenericAccType,
+ eDPub,
kNoReqStates
},
{ // doc-qna
@@ -606,7 +626,7 @@ static const nsRoleMapEntry sWAIRoleMaps[] = {
eNoValue,
eNoAction,
eNoLiveAttr,
- kGenericAccType,
+ eDPub,
kNoReqStates
},
{ // doc-subtitle
@@ -616,7 +636,7 @@ static const nsRoleMapEntry sWAIRoleMaps[] = {
eNoValue,
eNoAction,
eNoLiveAttr,
- kGenericAccType,
+ eDPub,
kNoReqStates
},
{ // doc-tip
@@ -626,7 +646,7 @@ static const nsRoleMapEntry sWAIRoleMaps[] = {
eNoValue,
eNoAction,
eNoLiveAttr,
- kGenericAccType,
+ eDPub,
kNoReqStates
},
{ // doc-toc
@@ -636,7 +656,7 @@ static const nsRoleMapEntry sWAIRoleMaps[] = {
eNoValue,
eNoAction,
eNoLiveAttr,
- eLandmark,
+ eDPub | eLandmark,
kNoReqStates
},
{ // document
@@ -1589,6 +1609,19 @@ bool aria::HasDefinedARIAHidden(nsIContent* aContent) {
eCaseMatters);
}
+const nsRoleMapEntry* aria::GetRoleMap(const nsStaticAtom* aAriaRole) {
+ const nsDependentAtomString role(aAriaRole);
+ auto comparator = [&role](const nsRoleMapEntry& aEntry) {
+ return Compare(role, aEntry.ARIARoleString());
+ };
+ size_t idx;
+ if (BinarySearchIf(sWAIRoleMaps, 0, ArrayLength(sWAIRoleMaps), comparator,
+ &idx)) {
+ return GetRoleMapFromIndex(idx);
+ }
+ return nullptr;
+}
+
////////////////////////////////////////////////////////////////////////////////
// AttrIterator class
diff --git a/accessible/base/ARIAMap.h b/accessible/base/ARIAMap.h
index 58a96b7112..2fa3ac80d4 100644
--- a/accessible/base/ARIAMap.h
+++ b/accessible/base/ARIAMap.h
@@ -305,6 +305,11 @@ uint8_t AttrCharacteristicsFor(nsAtom* aAtom);
bool HasDefinedARIAHidden(nsIContent* aContent);
/**
+ * Get the role map entry for a given ARIA role.
+ */
+const nsRoleMapEntry* GetRoleMap(const nsStaticAtom* aAriaRole);
+
+/**
* Represents a simple enumerator for iterating through ARIA attributes
* exposed as object attributes on a given accessible.
*/
diff --git a/accessible/base/AccTypes.h b/accessible/base/AccTypes.h
index 3e9d88e486..76fdaae2d7 100644
--- a/accessible/base/AccTypes.h
+++ b/accessible/base/AccTypes.h
@@ -87,6 +87,7 @@ enum AccGenericType {
eText = 1 << 14,
eNumericValue = 1 << 15,
eActionable = 1 << 16, // This is for remote accessibles
+ eDPub = 1 << 17,
eLastAccGenericType = eActionable,
eAllGenericTypes = (eLastAccGenericType << 1) - 1
diff --git a/accessible/base/nsAccessibilityService.cpp b/accessible/base/nsAccessibilityService.cpp
index 615af596a7..7b5f127672 100644
--- a/accessible/base/nsAccessibilityService.cpp
+++ b/accessible/base/nsAccessibilityService.cpp
@@ -12,6 +12,7 @@
#include "DocAccessible-inl.h"
#include "DocAccessibleChild.h"
#include "FocusManager.h"
+#include "mozilla/FocusModel.h"
#include "HTMLCanvasAccessible.h"
#include "HTMLElementAccessibles.h"
#include "HTMLImageMapAccessible.h"
@@ -136,48 +137,6 @@ static LocalAccessible* MaybeCreateSpecificARIAAccessible(
}
/**
- * Return true if the element has an attribute (ARIA, title, or relation) that
- * requires the creation of an Accessible for the element.
- */
-static bool AttributesMustBeAccessible(nsIContent* aContent,
- DocAccessible* aDocument) {
- if (aContent->IsElement()) {
- uint32_t attrCount = aContent->AsElement()->GetAttrCount();
- for (uint32_t attrIdx = 0; attrIdx < attrCount; attrIdx++) {
- const nsAttrName* attr = aContent->AsElement()->GetAttrNameAt(attrIdx);
- if (attr->NamespaceEquals(kNameSpaceID_None)) {
- nsAtom* attrAtom = attr->Atom();
- if (attrAtom == nsGkAtoms::title && aContent->IsHTMLElement()) {
- // If the author provided a title on an element that would not
- // be accessible normally, assume an intent and make it accessible.
- return true;
- }
-
- nsDependentAtomString attrStr(attrAtom);
- if (!StringBeginsWith(attrStr, u"aria-"_ns)) continue; // not ARIA
-
- // A global state or a property and in case of token defined.
- uint8_t attrFlags = aria::AttrCharacteristicsFor(attrAtom);
- if ((attrFlags & ATTR_GLOBAL) &&
- (!(attrFlags & ATTR_VALTOKEN) ||
- nsAccUtils::HasDefinedARIAToken(aContent, attrAtom))) {
- return true;
- }
- }
- }
-
- // If the given ID is referred by relation attribute then create an
- // Accessible for it.
- nsAutoString id;
- if (nsCoreUtils::GetID(aContent, id) && !id.IsEmpty()) {
- return aDocument->IsDependentID(aContent->AsElement(), id);
- }
- }
-
- return false;
-}
-
-/**
* Return true if the element must be a generic Accessible, even if it has been
* marked presentational with role="presentation", etc. MustBeAccessible causes
* an Accessible to be created as if it weren't marked presentational at all;
@@ -224,19 +183,53 @@ static bool MustBeGenericAccessible(nsIContent* aContent,
* Return true if the element must be accessible.
*/
static bool MustBeAccessible(nsIContent* aContent, DocAccessible* aDocument) {
- nsIFrame* frame = aContent->GetPrimaryFrame();
- MOZ_ASSERT(frame);
- // This document might be invisible when it first loads. Therefore, we must
- // check focusability irrespective of visibility here. Otherwise, we might not
- // create Accessibles for some focusable elements; e.g. a span with only a
- // tabindex. Elements that are invisible within this document are excluded
- // earlier in CreateAccessible.
- if (frame->IsFocusable(/* aWithMouse */ false,
- /* aCheckVisibility */ false)) {
- return true;
+ if (nsIFrame* frame = aContent->GetPrimaryFrame()) {
+ // This document might be invisible when it first loads. Therefore, we must
+ // check focusability irrespective of visibility here. Otherwise, we might
+ // not create Accessibles for some focusable elements; e.g. a span with only
+ // a tabindex. Elements that are invisible within this document are excluded
+ // earlier in CreateAccessible.
+ if (frame->IsFocusable(IsFocusableFlags::IgnoreVisibility)) {
+ return true;
+ }
+ }
+
+ // Return true if the element has an attribute (ARIA, title, or relation) that
+ // requires the creation of an Accessible for the element.
+ if (aContent->IsElement()) {
+ uint32_t attrCount = aContent->AsElement()->GetAttrCount();
+ for (uint32_t attrIdx = 0; attrIdx < attrCount; attrIdx++) {
+ const nsAttrName* attr = aContent->AsElement()->GetAttrNameAt(attrIdx);
+ if (attr->NamespaceEquals(kNameSpaceID_None)) {
+ nsAtom* attrAtom = attr->Atom();
+ if (attrAtom == nsGkAtoms::title && aContent->IsHTMLElement()) {
+ // If the author provided a title on an element that would not
+ // be accessible normally, assume an intent and make it accessible.
+ return true;
+ }
+
+ nsDependentAtomString attrStr(attrAtom);
+ if (!StringBeginsWith(attrStr, u"aria-"_ns)) continue; // not ARIA
+
+ // A global state or a property and in case of token defined.
+ uint8_t attrFlags = aria::AttrCharacteristicsFor(attrAtom);
+ if ((attrFlags & ATTR_GLOBAL) &&
+ (!(attrFlags & ATTR_VALTOKEN) ||
+ nsAccUtils::HasDefinedARIAToken(aContent, attrAtom))) {
+ return true;
+ }
+ }
+ }
+
+ // If the given ID is referred by relation attribute then create an
+ // Accessible for it.
+ nsAutoString id;
+ if (nsCoreUtils::GetID(aContent, id) && !id.IsEmpty()) {
+ return aDocument->IsDependentID(aContent->AsElement(), id);
+ }
}
- return AttributesMustBeAccessible(aContent, aDocument);
+ return false;
}
bool nsAccessibilityService::ShouldCreateImgAccessible(
@@ -294,6 +287,38 @@ static bool MustSVGElementBeAccessible(nsIContent* aContent,
}
/**
+ * Return an accessible for the content if the SVG element requires the creation
+ * of an Accessible.
+ */
+static RefPtr<LocalAccessible> MaybeCreateSVGAccessible(
+ nsIContent* aContent, DocAccessible* aDocument) {
+ if (aContent->IsSVGGeometryElement() ||
+ aContent->IsSVGElement(nsGkAtoms::image)) {
+ // Shape elements: rect, circle, ellipse, line, path, polygon, and polyline.
+ // 'use' and 'text' graphic elements require special support.
+ if (MustSVGElementBeAccessible(aContent, aDocument)) {
+ return new EnumRoleAccessible<roles::GRAPHIC>(aContent, aDocument);
+ }
+ } else if (aContent->IsSVGElement(nsGkAtoms::text)) {
+ return new HyperTextAccessible(aContent->AsElement(), aDocument);
+ } else if (aContent->IsSVGElement(nsGkAtoms::svg)) {
+ // An <svg> element could contain <foreignObject>, which contains HTML but
+ // does not normally create its own Accessible. This means that the <svg>
+ // Accessible could have TextLeafAccessible children, so it must be a
+ // HyperTextAccessible.
+ return new EnumRoleHyperTextAccessible<roles::DIAGRAM>(aContent, aDocument);
+ } else if (aContent->IsSVGElement(nsGkAtoms::g) &&
+ MustSVGElementBeAccessible(aContent, aDocument)) {
+ // <g> can also contain <foreignObject>.
+ return new EnumRoleHyperTextAccessible<roles::GROUPING>(aContent,
+ aDocument);
+ } else if (aContent->IsSVGElement(nsGkAtoms::a)) {
+ return new HTMLLinkAccessible(aContent, aDocument);
+ }
+ return nullptr;
+}
+
+/**
* Used by XULMap.h to map both menupopup and popup elements
*/
LocalAccessible* CreateMenupopupAccessible(Element* aElement,
@@ -1138,13 +1163,19 @@ LocalAccessible* nsAccessibilityService::CreateAccessible(
}
}
+ // SVG elements are not in a markup map, but we may still need to create an
+ // accessible for one, even in the case of display:contents.
+ if (!newAcc && content->IsSVGElement()) {
+ newAcc = MaybeCreateSVGAccessible(content, document);
+ }
+
// Check whether this element has an ARIA role or attribute that requires
// us to create an Accessible.
const bool hasNonPresentationalARIARole =
roleMapEntry && !roleMapEntry->Is(nsGkAtoms::presentation) &&
!roleMapEntry->Is(nsGkAtoms::none);
- if (!newAcc && (hasNonPresentationalARIARole ||
- AttributesMustBeAccessible(content, document))) {
+ if (!newAcc &&
+ (hasNonPresentationalARIARole || MustBeAccessible(content, document))) {
newAcc = new HyperTextAccessible(content, document);
}
@@ -1365,32 +1396,7 @@ LocalAccessible* nsAccessibilityService::CreateAccessible(
if (!newAcc) {
if (content->IsSVGElement()) {
- if (content->IsSVGGeometryElement() ||
- content->IsSVGElement(nsGkAtoms::image)) {
- // Shape elements: rect, circle, ellipse, line, path, polygon,
- // and polyline. 'use' and 'text' graphic elements require
- // special support.
- if (MustSVGElementBeAccessible(content, document)) {
- newAcc = new EnumRoleAccessible<roles::GRAPHIC>(content, document);
- }
- } else if (content->IsSVGElement(nsGkAtoms::text)) {
- newAcc = new HyperTextAccessible(content->AsElement(), document);
- } else if (content->IsSVGElement(nsGkAtoms::svg)) {
- // An <svg> element could contain <foreignObject>, which contains HTML
- // but does not normally create its own Accessible. This means that the
- // <svg> Accessible could have TextLeafAccessible children, so it must
- // be a HyperTextAccessible.
- newAcc =
- new EnumRoleHyperTextAccessible<roles::DIAGRAM>(content, document);
- } else if (content->IsSVGElement(nsGkAtoms::g) &&
- MustSVGElementBeAccessible(content, document)) {
- // <g> can also contain <foreignObject>.
- newAcc =
- new EnumRoleHyperTextAccessible<roles::GROUPING>(content, document);
- } else if (content->IsSVGElement(nsGkAtoms::a)) {
- newAcc = new HTMLLinkAccessible(content, document);
- }
-
+ newAcc = MaybeCreateSVGAccessible(content, document);
} else if (content->IsMathMLElement()) {
const MarkupMapInfo* markupMap =
mMathMLMarkupMap.Get(content->NodeInfo()->NameAtom());
diff --git a/accessible/base/nsCoreUtils.cpp b/accessible/base/nsCoreUtils.cpp
index c5e89258fa..3e66fa9c23 100644
--- a/accessible/base/nsCoreUtils.cpp
+++ b/accessible/base/nsCoreUtils.cpp
@@ -547,32 +547,6 @@ bool nsCoreUtils::IsWhitespaceString(const nsAString& aString) {
return iterBegin == iterEnd;
}
-void nsCoreUtils::TrimNonBreakingSpaces(nsAString& aString) {
- if (aString.IsEmpty()) {
- return;
- }
-
- // Find the index past the last nbsp prefix character.
- constexpr char16_t nbsp{0xA0};
- size_t startIndex = 0;
- while (aString.CharAt(startIndex) == nbsp) {
- startIndex++;
- }
-
- // Find the index before the first nbsp suffix character.
- size_t endIndex = aString.Length() - 1;
- while (endIndex > startIndex && aString.CharAt(endIndex) == nbsp) {
- endIndex--;
- }
- if (startIndex > endIndex) {
- aString.Truncate();
- return;
- }
-
- // Trim the string down, removing the non-breaking space characters.
- aString = Substring(aString, startIndex, endIndex - startIndex + 1);
-}
-
bool nsCoreUtils::AccEventObserversExist() {
nsCOMPtr<nsIObserverService> obsService = services::GetObserverService();
NS_ENSURE_TRUE(obsService, false);
diff --git a/accessible/base/nsCoreUtils.h b/accessible/base/nsCoreUtils.h
index 5e77d6bfe0..28ead982af 100644
--- a/accessible/base/nsCoreUtils.h
+++ b/accessible/base/nsCoreUtils.h
@@ -307,11 +307,6 @@ class nsCoreUtils {
aChar == 0xa0;
}
- /**
- * Remove non-breaking spaces from the beginning and end of the string.
- */
- static void TrimNonBreakingSpaces(nsAString& aString);
-
/*
* Return true if there are any observers of accessible events.
*/