Closed Bug 1646516 Opened 5 years ago Closed 4 years ago

[meta] Audit uses of nsContentUtils::GetRootDocument

Categories

(Core :: DOM: Core & HTML, task, P3)

task

Tracking

()

RESOLVED FIXED
Fission Milestone M7a

People

(Reporter: kmag, Assigned: edgar)

References

(Blocks 1 open bug)

Details

(Keywords: meta)

+++ This bug was initially created as a clone of Bug #1646510 +++

Similar to uses of nsIDocShellTreeItem, many/most of the callers of these methods will probably do the wrong thing under Fission with remote frames.

Don't know how this missed our triage till now :(

Fission Milestone: --- → ?

Steven, can you please add a comment to GetRootDocument() definition to mention this shouldn't be used in new code, and also audit the remaining callers of this and add comments to this bug about which ones need to be fixed and which ones are okay and not a problem with Fission?

Fission Milestone: ? → M7a
Flags: needinfo?(smacleod)

Most of the callers are related to fullscreen, which Alphan already audited in bug 1646491. For the fullscreen code calling GetRootDocument, you may be able to just copy/paste his bug comments.

Edgar, can you audit and confirm, please?

Flags: needinfo?(smacleod) → needinfo?(echen)

I will take a look.

Assignee: nobody → echen
Flags: needinfo?(echen)
Depends on: 1646491
Depends on: 1709200

Most of the callers are related to fullscreen, which has been checked in bug 1646491.
Others are,

  1. https://searchfox.org/mozilla-central/rev/54097530955a98c768f2aaf56925578ec886ec77/dom/base/DOMIntersectionObserver.cpp#452,460
  2. https://searchfox.org/mozilla-central/rev/54097530955a98c768f2aaf56925578ec886ec77/layout/base/GeometryUtils.cpp#330
  3. https://searchfox.org/mozilla-central/rev/54097530955a98c768f2aaf56925578ec886ec77/layout/base/PresShell.cpp#8415
  1. and 2) looks fine since they do expect nsContentUtils::GetRootDocument doesn't cross the process boundary.

I am checking 3) and will file a separated bug if needed.

(In reply to Edgar Chen [:edgar] from comment #6)

  1. https://searchfox.org/mozilla-central/rev/54097530955a98c768f2aaf56925578ec886ec77/layout/base/PresShell.cpp#8415
  1. is for ESC key handling for fullscreen that works fine with Fission.

I have audited the all of the usage, and renamed GetRootDocument to GetInProcessSubtreeRootDocument in bug 1709200 to reduce confusion. So close as FIXED.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.