Backed out changeset 1b67ef7bd374 (bug 1822170) for assertion failures on Accessible.cpp. CLOSED TREE

This commit is contained in:
Marian-Vasile Laza 2023-03-15 20:46:00 +02:00
parent 5a9d677542
commit 5df0512bdd
4 changed files with 3 additions and 29 deletions

View File

@ -327,10 +327,6 @@ NSAttributedString* CachedTextMarkerRange::AttributedText() const {
TextLeafPoint attributesNext;
do {
attributesNext = start.FindTextAttrsStart(eDirNext, false);
if (attributesNext == start) {
MOZ_ASSERT_UNREACHABLE("Cannot proceed further in attribute run");
break;
}
RefPtr<AccAttributes> attributes = start.GetTextAttributes();
MOZ_ASSERT(attributes);
if (attributes && !attributes->Equal(currentRun)) {

View File

@ -415,13 +415,9 @@ static GeckoTextMarkerRange TextMarkerSubrange(Accessible* aAccessible,
NSRange r = [aRange rangeValue];
start.Offset() += r.location;
end.Offset() = start.Offset() + r.length;
end.Offset() = start.Offset() + r.location + r.length;
textMarkerRange = GeckoTextMarkerRange(start, end);
// Crop range to accessible
textMarkerRange.Crop(aAccessible);
return textMarkerRange;
return GeckoTextMarkerRange(start, end);
}
- (NSString*)moxStringForRange:(NSValue*)range {

View File

@ -61,24 +61,6 @@ addAccessibleTask(
[" ", "#000000", "#ffffff", null, null, null, 16, null, null],
["test", "#0000ee", "#ffffff", 1, "#0000ee", null, 16, "a2", null],
]);
// Test different NSRange parameters for AXAttributedStringForRange
let worldLeaf = findAccessibleChildByID(accDoc, "a1").firstChild;
let wordStaticText = worldLeaf.nativeInterface.QueryInterface(
Ci.nsIAccessibleMacInterface
);
attributedText = wordStaticText.getParameterizedAttributeValue(
"AXAttributedStringForRange",
NSRange(4, 1)
);
is(attributedText.length, 1, "Last character is in single attribute run");
is(attributedText[0].string, "d", "Last character matches");
attributedText = wordStaticText.getParameterizedAttributeValue(
"AXAttributedStringForRange",
NSRange(5, 1)
);
is(attributedText.length, 0, "Range is past accessible bounds");
}
);

View File

@ -65,7 +65,7 @@ addAccessibleTask(
NSRange(3, 6)
);
is(str, "lo, th", "AXStringForRange matches.");
is(str, "lo, this ", "AXStringForRange matches.");
let smallBounds = textLeaf.getParameterizedAttributeValue(
"AXBoundsForRange",