Closed Bug 1897135 Opened 10 months ago Closed 10 months ago

Cleanup in nsFrameManager, nsCSSFrameConstructor, and PresShell

Categories

(Core :: Layout, task)

task

Tracking

()

RESOLVED FIXED
128 Branch
Tracking Status
firefox128 --- fixed

People

(Reporter: TYLin, Assigned: TYLin)

Details

Attachments

(3 files)

See the patches for the details.

Also, delete unused DEBUG_UNDISPLAYED_MAP and DEBUG_DISPLAY_CONTENTS_MAP in
nsFrameManager.cpp.

Delete the comments between the #includes in PresShell.cpp per coding style
guideline: "Don't place comments between non-conditional includes." in
https://firefox-source-docs.mozilla.org/code-quality/coding-style/coding_style_cpp.html#include-directives

Assignee: nobody → aethanyc
Status: NEW → ASSIGNED

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.

Move SetRootFrame() to nsFrameManager.cpp because calling IsViewportFrame()
requires full definition of nsIFrame.

An alternative idea without adding an assertion is that we can change
mRootFrame, GetRootFrame() and SetRootFrame() in nsFrameManager to use
ViewportFrame*. However, given that most of the caller are getting root frame
via PresShell::GetRootFrame(), and I don't see the exisiting usage requires
accessing ViewportFrame. Therefore, this idea doesn't seem beneficial, and
might make other files depending on "ViewportFrame.h" unnecessarily.

Attachment #9402225 - Attachment description: Bug 1897135 Part 3 - Add an assertion to ensure root frame is a ViewportFrame. r?#layout → Bug 1897135 Part 3 - Change two APIs to ensure root frame is a ViewportFrame. r?#layout
Pushed by aethanyc@gmail.com: https://hg.mozilla.org/integration/autoland/rev/5dbc0205b48a Part 1 - Sort #includes and forward declarations in nsFrameManager, nsCSSFrameConstructor, and PresShell. r=dholbert https://hg.mozilla.org/integration/autoland/rev/813bb8dcc655 Part 2 - Remove redundant mFrameManager member in PresShell. r=dholbert https://hg.mozilla.org/integration/autoland/rev/0cd4c114c5e6 Part 3 - Change two APIs to ensure root frame is a ViewportFrame. r=dholbert
Status: ASSIGNED → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → 128 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: