Open Bug 1573625 Opened 5 years ago Updated 2 years ago

Fix usage of nsIDocShellTreeItem in nsCoreUtils::IsRootDocument

Categories

(Core :: Disability Access APIs, enhancement, P2)

enhancement

Tracking

()

Fission Milestone Future

People

(Reporter: djvj, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [rm-docshell-tree-item:simple])

In the function nsCoreUtils::IsRootDocument (https://searchfox.org/mozilla-central/source/accessible/base/nsCoreUtils.cpp#341):

This function checks if a document is a root document by getting its docshell tree-item, then obtaining its in-process parent, and checking if the parent is null.

Post-fission, this will return true incorrectly when the parent is out of process. This function should be modified as follows:

  1. Obtain the parent.
  2. If the parent is non-null, return false, as this document cannot be the root.
  3. If the parent is null, then use the associated BrowsingContext to determine whether there is an out-of-process parent, and return true if so, otherwise false.
Component: DOM: Core & HTML → Disability Access APIs
Fission Milestone: --- → M5
Priority: -- → P2
See Also: → 1582946

I was also thinking that returning true for the out-of-process document is wrong, but after some more reading the code around its call site, now I think returning true looks correct.

There is only one call site of nsCoreUtils::IsRootDocument, which is in DocManager::CreateDocOrRootAccessible. If we consider a given document is not root, we try to get the parent accessible document, then we call BindChildDocument. Apparently it won't work in fission.

So, I think we should rename nsCoreUtils::IsRootDocument to nsCoreUtils::IsRootDocumentInProcess, and make the function return true in the case where the given document is the root document of the out-of-process document tree.

Whiteboard: [rm-docshell-tree-item:simple]
Fission Milestone: M5 → Future

Kannan says replacing nsIDocShellTreeItem calls should block enabling Fission in Nightly (M6).

Fission Milestone: Future → M6

Comment 1 is correct. As far as the a11y engine is concerned, root accessible means in-process root accessible (the outer most accessible in the in-process a11y tree).

Fission Milestone: M6 → Future
Severity: normal normal → S3 S3
You need to log in before you can comment on or make changes to this bug.