Closed Bug 1888535 Opened 3 months ago Closed 3 months ago

Consider removing DISPLAY_REFLOW macros and DR_Cookie

Categories

(Core :: Layout, task)

task

Tracking

()

RESOLVED FIXED
126 Branch
Tracking Status
firefox126 --- fixed

People

(Reporter: TYLin, Assigned: TYLin)

References

Details

Attachments

(6 files)

DISPLAY_RREFLOW macros [1] and DR_Cookie are old tool for debugging reflow. Nowadays, I feel their can be replaced by pernosco, rr, and MOZ_LOG, and we don't support it well in modern frame types like flex and grid. I propose we get rid of them to lower the maintain burden of layout.

Daniel suggested in private slack discussion that we can transform some of them to MOZ_LOG-logging.

[1] https://searchfox.org/mozilla-central/rev/f8258e49f277c1c881c5c0da95f463dd12b7397e/layout/generic/nsContainerFrame.h#1153-1176

--> Adding dependency on the bug that (I think) added this logging utility code, >20 years ago: bug 103925

Depends on: 103925

I give the tool a try by following http://devdoc.net/web/developer.mozilla.org/en-US/docs/Debugging_Frame_Reflow.html

reflow_rules.txt is just a line * 1, and running this command

GECKO_DISPLAY_REFLOW_RULES_FILE=reflow_rules.txt ./mach run --layoutdebug "data:text/html,hello"

The log is really spammy because it dumps all the reflow log for frontend UI, too ... I feel it's easier to debug via recording with rr, dumping frame tree, and starting backwards from the recording.

DISPLAY_LAYOUT, DISPLAY_PREF_SIZE, DISPLAY_MIN_SIZE, and
DISPLAY_MAX_SIZE are not used in layout at all.

Assignee: nobody → aethanyc
Status: NEW → ASSIGNED

The two macros are only used in ReflowInput.cpp, which are to print margin,
border, padding, available sizes, and other computed sizes in ReflowInput. The
information can be replaced by adding local printf or via rr if there are
debug needs.

Note: ReflowInput::DisplayInitFrameTypeEnter and
ReflowInput::DisplayInitFrameTypeExit have been removed in
https://hg.mozilla.org/mozilla-central/rev/429a4d022ade

The two macros are used in GetPrefISize() and GetMinISize() implementations.
After removing them, we could further simplify some implementations because we
don't need a result variable in many cases.

This patch doesn't change behavior.

It is used in Reflow() implementations.

This final patch completely removes display reflow debugging mechanism.

Attachment #9394399 - Attachment description: Bug 1888535 Part 4 - Remove DISPLAY_REFLOW. r?#layout → Bug 1888535 Part 5 - Remove DISPLAY_REFLOW. r?#layout
Pushed by tlin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ccd4c30ad693
Part 1 - Remove four unused display reflow debugging macros. r=layout-reviewers,emilio
https://hg.mozilla.org/integration/autoland/rev/9f4f5c0809cb
Part 2 - Remove DISPLAY_INIT_CONSTRAINTS and DISPLAY_INIT_OFFSETS. r=layout-reviewers,emilio
https://hg.mozilla.org/integration/autoland/rev/4f809b006b38
Part 3 - Remove DISPLAY_REFLOW_CHANGE used only in nsTableCellFrame. r=layout-reviewers,emilio
https://hg.mozilla.org/integration/autoland/rev/b0a163af22bd
Part 4 - Remove DISPLAY_PREF_INLINE_SIZE and DISPLAY_MIN_INLINE_SIZE. r=layout-reviewers,emilio
https://hg.mozilla.org/integration/autoland/rev/6d308d64893c
Part 5 - Remove DISPLAY_REFLOW. r=layout-reviewers,emilio
https://hg.mozilla.org/integration/autoland/rev/298ae4f7d47b
Part 6 - Unhook display reflow debugging from nsLayoutStatics, and remove display reflow debugging. r=layout-reviewers,emilio
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: