Bug 1897135 Part 2 - Remove redundant mFrameManager member in PresShell. r=dholbert

We can just use `mFrameConstructor` to call `GetRootFrame()`. In order to do so
while keeping `PresShell::GetRootFrame()` as a inline method, we need to include
`nsCSSFrameConstructor` header in `PresShell.h`, and remove `PresShell` header
in `nsCSSFrameConstructor.h`. That means we can no longer inline
`RestyleManager()` since it needs to access `PresShell`, but it's OK since
`RestyleManager` is used only in the frame constructor, and is probably not in
the hot path.

Differential Revision: https://phabricator.services.mozilla.com/D210670
This commit is contained in:
Ting-Yu Lin
2024-05-17 21:37:01 +00:00
parent 02535685c4
commit 3fca23660d
6 changed files with 21 additions and 25 deletions

View File

@@ -2631,6 +2631,10 @@ nsIFrame* nsCSSFrameConstructor::ConstructDocElementFrame(
return newFrame;
}
RestyleManager* nsCSSFrameConstructor::RestyleManager() const {
return mPresShell->GetPresContext()->RestyleManager();
}
nsIFrame* nsCSSFrameConstructor::ConstructRootFrame() {
AUTO_PROFILER_LABEL_HOT("nsCSSFrameConstructor::ConstructRootFrame",
LAYOUT_FrameConstruction);