Backed out 5 changesets (bug 1661758) for build bustages on GeckoTextMarker.h.

Backed out changeset 9b086da1f8f1 (bug 1661758)
Backed out changeset 8def1d51ae3d (bug 1661758)
Backed out changeset 17532cdc54ae (bug 1661758)
Backed out changeset be0ea9159b11 (bug 1661758)
Backed out changeset 2ca136e7d279 (bug 1661758)
This commit is contained in:
Brindusan Cristian 2020-09-11 02:16:49 +03:00
parent 807eb4e6a9
commit c5f2ef7f15
12 changed files with 37 additions and 216 deletions

View File

@ -166,36 +166,6 @@ mozilla::ipc::IPCResult DocAccessiblePlatformExtChild::RecvOffsetAtIndex(
return IPC_OK();
}
mozilla::ipc::IPCResult DocAccessiblePlatformExtChild::RecvRangeOfChild(
const uint64_t& aID, const uint64_t& aChild, int32_t* aStartOffset,
int32_t* aEndOffset) {
HyperTextAccessibleWrap* acc = IdToHyperTextAccessibleWrap(aID);
Accessible* child =
static_cast<DocAccessibleChild*>(Manager())->IdToAccessible(aChild);
if (!acc || !child) {
return IPC_OK();
}
acc->RangeOfChild(child, aStartOffset, aEndOffset);
return IPC_OK();
}
mozilla::ipc::IPCResult DocAccessiblePlatformExtChild::RecvLeafAtOffset(
const uint64_t& aID, const int32_t& aOffset, uint64_t* aLeaf) {
HyperTextAccessibleWrap* acc = IdToHyperTextAccessibleWrap(aID);
if (!acc) {
return IPC_OK();
}
Accessible* leaf = acc->LeafAtOffset(aOffset);
MOZ_ASSERT(!leaf || leaf->Document() == acc->Document());
*aLeaf = UNIQUE_ID(leaf);
return IPC_OK();
}
HyperTextAccessibleWrap*
DocAccessiblePlatformExtChild::IdToHyperTextAccessibleWrap(
const uint64_t& aID) const {

View File

@ -57,15 +57,6 @@ class DocAccessiblePlatformExtChild : public PDocAccessiblePlatformExtChild {
uint64_t* aContainer,
int32_t* aOffset);
mozilla::ipc::IPCResult RecvRangeOfChild(const uint64_t& aID,
const uint64_t& aChild,
int32_t* aStartOffset,
int32_t* aEndOffset);
mozilla::ipc::IPCResult RecvLeafAtOffset(const uint64_t& aID,
const int32_t& aOffset,
uint64_t* aLeaf);
private:
HyperTextAccessibleWrap* IdToHyperTextAccessibleWrap(
const uint64_t& aID) const;

View File

@ -43,11 +43,6 @@ child:
nested(inside_sync) sync OffsetAtIndex(uint64_t aID, int32_t aIndex)
returns(uint64_t aContainer, int32_t aOffset);
nested(inside_sync) sync RangeOfChild(uint64_t aID, uint64_t aChild)
returns(int32_t aStartOffset, int32_t aEndOffset);
nested(inside_sync) sync LeafAtOffset(uint64_t aID, int32_t aOffset)
returns(uint64_t aLeaf);
};
} // namespace a11y

View File

@ -45,8 +45,6 @@ class GeckoTextMarker final {
// Return a word range right of the given offset.
GeckoTextMarkerRange RightWordRange();
AccessibleOrProxy Leaf();
bool IsValid() const { return !mContainer.IsNull(); };
bool operator<(const GeckoTextMarker& aPoint) const;
@ -76,8 +74,6 @@ class GeckoTextMarkerRange final {
GeckoTextMarkerRange(AccessibleOrProxy aDoc,
AXTextMarkerRangeRef aTextMarkerRange);
GeckoTextMarkerRange(const AccessibleOrProxy& aAccessible);
id CreateAXTextMarkerRange();
bool IsValid() const {

View File

@ -269,21 +269,6 @@ GeckoTextMarkerRange GeckoTextMarker::RightWordRange() {
return GeckoTextMarkerRange(GeckoTextMarker(), GeckoTextMarker());
}
AccessibleOrProxy GeckoTextMarker::Leaf() {
MOZ_ASSERT(!mContainer.IsNull());
if (mContainer.IsProxy()) {
uint64_t leafID = 0;
DocAccessibleParent* ipcDoc = mContainer.AsProxy()->Document();
Unused << ipcDoc->GetPlatformExtension()->SendLeafAtOffset(
mContainer.AsProxy()->ID(), mOffset, &leafID);
return ipcDoc->GetAccessible(leafID);
} else if (auto htWrap = ContainerAsHyperTextWrap()) {
return htWrap->LeafAtOffset(mOffset);
}
return mContainer;
}
// GeckoTextMarkerRange
GeckoTextMarkerRange::GeckoTextMarkerRange(
@ -303,21 +288,6 @@ GeckoTextMarkerRange::GeckoTextMarkerRange(
CFRelease(end_marker);
}
GeckoTextMarkerRange::GeckoTextMarkerRange(
const AccessibleOrProxy& aAccessible) {
mStart = GeckoTextMarker(aAccessible.Parent(), 0);
mEnd = GeckoTextMarker(aAccessible.Parent(), 0);
if (mStart.mContainer.IsProxy()) {
DocAccessibleParent* ipcDoc = mStart.mContainer.AsProxy()->Document();
Unused << ipcDoc->GetPlatformExtension()->SendRangeOfChild(
mStart.mContainer.AsProxy()->ID(), aAccessible.AsProxy()->ID(),
&mStart.mOffset, &mEnd.mOffset);
} else if (auto htWrap = mStart.ContainerAsHyperTextWrap()) {
htWrap->RangeOfChild(aAccessible.AsAccessible(), &mStart.mOffset,
&mEnd.mOffset);
}
}
id GeckoTextMarkerRange::CreateAXTextMarkerRange() {
AXTextMarkerRangeRef cf_text_marker_range =
AXTextMarkerRangeCreate(kCFAllocatorDefault, mStart.CreateAXTextMarker(),

View File

@ -46,11 +46,6 @@ class HyperTextAccessibleWrap : public HyperTextAccessible {
void PreviousClusterAt(int32_t aOffset, HyperTextAccessible** aPrevContainer,
int32_t* aPrevOffset);
void RangeOfChild(Accessible* aChild, int32_t* aStartOffset,
int32_t* aEndOffset);
Accessible* LeafAtOffset(int32_t aOffset);
protected:
~HyperTextAccessibleWrap() {}

View File

@ -351,43 +351,6 @@ void HyperTextAccessibleWrap::PreviousClusterAt(
*aPrevOffset = prev.mOffset;
}
void HyperTextAccessibleWrap::RangeOfChild(Accessible* aChild,
int32_t* aStartOffset,
int32_t* aEndOffset) {
MOZ_ASSERT(aChild->Parent() == this);
*aStartOffset = *aEndOffset = -1;
int32_t index = GetIndexOf(aChild);
if (index != -1) {
*aStartOffset = GetChildOffset(index);
// If this is the last child index + 1 will return the total
// chracter count.
*aEndOffset = GetChildOffset(index + 1);
}
}
Accessible* HyperTextAccessibleWrap::LeafAtOffset(int32_t aOffset) {
HyperTextAccessible* text = this;
Accessible* child = nullptr;
int32_t innerOffset = aOffset;
do {
int32_t childIdx = text->GetChildIndexAtOffset(innerOffset);
if (childIdx == -1) {
return text;
}
child = text->GetChildAt(childIdx);
if (!child || nsAccUtils::MustPrune(child)) {
return text;
}
innerOffset -= text->GetChildOffset(childIdx);
text = child->AsHyperText();
} while (text);
return child;
}
TextPoint HyperTextAccessibleWrap::FindTextPoint(
int32_t aOffset, nsDirection aDirection, nsSelectionAmount aAmount,
EWordMovementType aWordMovementType) {

View File

@ -398,10 +398,4 @@
// AXTextMarkerForIndex
- (id _Nullable)moxTextMarkerForIndex:(NSNumber* _Nonnull)index;
// AXUIElementForTextMarker
- (id _Nullable)moxUIElementForTextMarker:(id _Nonnull)textMarker;
// AXTextMarkerRangeForUIElement
- (id _Nullable)moxTextMarkerRangeForUIElement:(id _Nonnull)element;
@end

View File

@ -74,10 +74,4 @@
// override
- (NSValue*)moxBoundsForTextMarkerRange:(id)textMarkerRange;
// override
- (id)moxUIElementForTextMarker:(id)textMarker;
// override
- (id)moxTextMarkerRangeForUIElement:(id)element;
@end

View File

@ -243,22 +243,4 @@ static nsDataHashtable<nsUint64HashKey, MOXTextMarkerDelegate*> sDelegates;
return geckoTextMarker.CreateAXTextMarker();
}
- (id)moxUIElementForTextMarker:(id)textMarker {
GeckoTextMarker geckoTextMarker(mGeckoDocAccessible, textMarker);
if (!geckoTextMarker.IsValid()) {
return nil;
}
return GetNativeFromGeckoAccessible(geckoTextMarker.Leaf());
}
- (id)moxTextMarkerRangeForUIElement:(id)element {
if (![element isKindOfClass:[mozAccessible class]]) {
return nil;
}
GeckoTextMarkerRange range([element geckoAccessible]);
return range.CreateAXTextMarkerRange();
}
@end

View File

@ -18,20 +18,6 @@ function stringForRange(macDoc, range) {
);
}
function testUIElementAtMarker(macDoc, marker, expectedString) {
let elem = macDoc.getParameterizedAttributeValue(
"AXUIElementForTextMarker",
marker
);
is(elem.getAttributeValue("AXRole"), "AXStaticText");
is(elem.getAttributeValue("AXValue"), expectedString);
let elemRange = macDoc.getParameterizedAttributeValue(
"AXTextMarkerRangeForUIElement",
elem
);
is(stringForRange(macDoc, elemRange), expectedString);
}
function testWordAtMarker(
macDoc,
marker,
@ -138,46 +124,45 @@ addAccessibleTask(
let marker = macDoc.getAttributeValue("AXStartTextMarker");
function testWordAndAdvance(left, right, elemText) {
testWordAtMarker(macDoc, marker, left, right);
testUIElementAtMarker(macDoc, marker, elemText);
function testWordAndAdvance(left, right, options = {}) {
testWordAtMarker(macDoc, marker, left, right, options);
marker = macDoc.getParameterizedAttributeValue(
"AXNextTextMarkerForTextMarker",
marker
);
}
testWordAndAdvance("hello", "hello", "hello world ");
testWordAndAdvance("hello", "hello", "hello world ");
testWordAndAdvance("hello", "hello", "hello world ");
testWordAndAdvance("hello", "hello", "hello world ");
testWordAndAdvance("hello", "hello", "hello world ");
testWordAndAdvance("hello", " ", "hello world ");
testWordAndAdvance(" ", "world", "hello world ");
testWordAndAdvance("world", "world", "hello world ");
testWordAndAdvance("world", "world", "hello world ");
testWordAndAdvance("world", "world", "hello world ");
testWordAndAdvance("world", "world", "hello world ");
testWordAndAdvance("world", " ", "hello world ");
testWordAndAdvance(" ", "i", "i love you");
testWordAndAdvance("i", " ", "i love you");
testWordAndAdvance(" ", "love", "i love you");
testWordAndAdvance("love", "love", "i love you");
testWordAndAdvance("love", "love", "i love you");
testWordAndAdvance("love", "love", "i love you");
testWordAndAdvance("love", " ", "i love you");
testWordAndAdvance(" ", "you", "i love you");
testWordAndAdvance("you", "you", "i love you");
testWordAndAdvance("you", "you", "i love you");
testWordAndAdvance("you", " ", "i love you");
testWordAndAdvance(" ", "goodbye", " goodbye");
testWordAndAdvance("goodbye", "goodbye", " goodbye");
testWordAndAdvance("goodbye", "goodbye", " goodbye");
testWordAndAdvance("goodbye", "goodbye", " goodbye");
testWordAndAdvance("goodbye", "goodbye", " goodbye");
testWordAndAdvance("goodbye", "goodbye", " goodbye");
testWordAndAdvance("goodbye", "goodbye", " goodbye");
testWordAndAdvance("goodbye", "", " goodbye");
testWordAndAdvance("hello", "hello");
testWordAndAdvance("hello", "hello");
testWordAndAdvance("hello", "hello");
testWordAndAdvance("hello", "hello");
testWordAndAdvance("hello", "hello");
testWordAndAdvance("hello", " ");
testWordAndAdvance(" ", "world");
testWordAndAdvance("world", "world");
testWordAndAdvance("world", "world");
testWordAndAdvance("world", "world");
testWordAndAdvance("world", "world");
testWordAndAdvance("world", " ");
testWordAndAdvance(" ", "i");
testWordAndAdvance("i", " ");
testWordAndAdvance(" ", "love");
testWordAndAdvance("love", "love");
testWordAndAdvance("love", "love");
testWordAndAdvance("love", "love");
testWordAndAdvance("love", " ");
testWordAndAdvance(" ", "you");
testWordAndAdvance("you", "you");
testWordAndAdvance("you", "you");
testWordAndAdvance("you", " ");
testWordAndAdvance(" ", "goodbye");
testWordAndAdvance("goodbye", "goodbye");
testWordAndAdvance("goodbye", "goodbye");
testWordAndAdvance("goodbye", "goodbye");
testWordAndAdvance("goodbye", "goodbye");
testWordAndAdvance("goodbye", "goodbye");
testWordAndAdvance("goodbye", "goodbye");
testWordAndAdvance("goodbye", "");
ok(!marker, "Iterated through all markers");
testMarkerIntegrity(accDoc);
@ -193,18 +178,13 @@ addAccessibleTask(
let marker = macDoc.getAttributeValue("AXStartTextMarker");
function getMarkerAtIndex(index) {
return macDoc.getParameterizedAttributeValue(
"AXTextMarkerForIndex",
index
for (let i = 0; i < 7; i++) {
marker = macDoc.getParameterizedAttributeValue(
"AXNextTextMarkerForTextMarker",
marker
);
}
testUIElementAtMarker(macDoc, marker, "hello ");
marker = getMarkerAtIndex(7);
testUIElementAtMarker(macDoc, marker, "wor");
let left = macDoc.getParameterizedAttributeValue(
"AXLeftWordTextMarkerRangeForTextMarker",
marker
@ -232,9 +212,6 @@ addAccessibleTask(
is(stringForRange(macDoc, left), "world", "Left word matches");
is(stringForRange(macDoc, right), "world", "Right word matches");
marker = getMarkerAtIndex(14);
testUIElementAtMarker(macDoc, marker, "ld goodbye");
testMarkerIntegrity(accDoc);
}
);

View File

@ -638,12 +638,6 @@ platform = mac
[PDocAccessiblePlatformExt::OffsetAtIndex]
description = Retrieve text offset at absolute index. Platform API is synchronous, so this needs to be too.
platform = mac
[PDocAccessiblePlatformExt::RangeOfChild]
description = Retrieve text range in parent of child. Platform API is synchronous, so this needs to be too.
platform = mac
[PDocAccessiblePlatformExt::LeafAtOffset]
description = Retrieve text leaf at given offset. Platform API is synchronous, so this needs to be too.
platform = mac
# Plugins
[PPluginWidget::Create]