mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 00:32:11 +00:00
Bug 1774197 part 2: Don't include the document in the viewport cache. r=morgan
Sometimes, the document occurs too early in the viewport cache, perhaps even right at the start. We weren't benefitting from it being in the cache anyway, since we always skipped it. We already have a fallback in ChildAtPoint for the case where we didn't find a matching Accessible, so we rely on that to handle returning the document when appropriate. Differential Revision: https://phabricator.services.mozilla.com/D149493
This commit is contained in:
parent
d73cd7641e
commit
e03a5619fd
@ -3236,7 +3236,11 @@ already_AddRefed<AccAttributes> LocalAccessible::BundleFieldsForCache(
|
||||
}
|
||||
|
||||
LocalAccessible* acc = doc->GetAccessibleOrContainer(content);
|
||||
if (!acc) {
|
||||
// The document is sometimes placed too early in the list, which would
|
||||
// cause us to return the document instead of the correct descendant.
|
||||
// We skip the document here and handle it as a fallback when hit
|
||||
// testing.
|
||||
if (!acc || acc == mDoc) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -346,16 +346,6 @@ Accessible* RemoteAccessibleBase<Derived>::ChildAtPoint(
|
||||
break;
|
||||
}
|
||||
|
||||
if (acc == doc) {
|
||||
// If we're already in `doc`s viewport cache, and the doc is
|
||||
// not the acc this call originated on, skip it.
|
||||
// We have to have `doc` in this list, because we need to support
|
||||
// calling `doc->ChildAtPoint()`. Without this check, we end up
|
||||
// calling `doc->ChildAtPoint(...)` below which changes the context of
|
||||
// this call.
|
||||
continue;
|
||||
}
|
||||
|
||||
if (acc->Bounds().Contains(aX, aY)) {
|
||||
if (acc->IsDoc()) {
|
||||
// If we encounter a doc, search its viewport
|
||||
|
Loading…
Reference in New Issue
Block a user