mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-19 01:10:22 +00:00
Backed out changeset 30b7d9c22176 (bug 1822170) for causing mochitest failures on CachedTextMarker.mm CLOSED TREE
This commit is contained in:
parent
d0e9fc21a4
commit
b3e8485c79
@ -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)) {
|
||||
|
@ -365,23 +365,24 @@ void LegacyTextMarkerRange::Select() const {
|
||||
}
|
||||
|
||||
bool LegacyTextMarkerRange::Crop(Accessible* aContainer) {
|
||||
LegacyTextMarkerRange containerRange(aContainer);
|
||||
LegacyTextMarker containerStart(aContainer, 0);
|
||||
LegacyTextMarker containerEnd(aContainer, CharacterCount(aContainer));
|
||||
|
||||
if (mEnd < containerRange.mStart || containerRange.mEnd < mStart) {
|
||||
if (mEnd < containerStart || containerEnd < mStart) {
|
||||
// The range ends before the container, or starts after it.
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mStart < containerRange.mStart) {
|
||||
if (mStart < containerStart) {
|
||||
// If range start is before container start, adjust range start to
|
||||
// start of container.
|
||||
mStart = containerRange.mStart;
|
||||
mStart = containerStart;
|
||||
}
|
||||
|
||||
if (containerRange.mEnd < mEnd) {
|
||||
if (containerEnd < mEnd) {
|
||||
// If range end is after container end, adjust range end to end of
|
||||
// container.
|
||||
mEnd = containerRange.mEnd;
|
||||
mEnd = containerEnd;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -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 {
|
||||
|
@ -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");
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user