VOOZH about

URL: https://phabricator.services.mozilla.com/D214042

⇱ ⚙ D214042 Bug 1650944 - Removed ReflowInput.h include from nsIFrame.h r=emilio


Bug 1650944 - Removed ReflowInput.h include from nsIFrame.h r=emilio
AbandonedPublic

Authored by dholbert on Jun 17 2024, 10:01 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jun 15, 3:19 PM
Unknown Object (File)
Sat, May 23, 10:47 AM
Unknown Object (File)
Apr 25 2026, 11:03 PM
Unknown Object (File)
Apr 25 2026, 2:43 PM
Unknown Object (File)
Apr 25 2026, 3:28 AM
Unknown Object (File)
Apr 18 2026, 1:22 PM
Unknown Object (File)
Apr 18 2026, 10:45 AM
Unknown Object (File)
Apr 17 2026, 5:27 AM

Details

Reviewers
emilio
lilabivert
Bugzilla Bug ID
1650944

Diff Detail

Repository
rMOZILLACENTRAL mozilla-central
Branch
default

Event Timeline

phab-bot changed the visibility from "Custom Policy" to "Public (No Login Required)".
phab-bot changed the edit policy from "Custom Policy" to "Restricted Project (Project)".
phab-bot removed a project: secure-revision.
Comment Actions

Does this build? As mentioned in https://phabricator.services.mozilla.com/D81845#2501818, I had to keep it because there were files depending on this.

Comment Actions

Does this build? As mentioned in https://phabricator.services.mozilla.com/D81845#2501818, I had to keep it because there were files depending on this.

This does not build, looks there are still files dependent on this ReflowInput.h include.

Built on the latest windows 11 OS.

Comment Actions

Can you check what those files are and add ReflowInput.h there?

Comment Actions

Actually, what I said was wrong earlier. Upon removing the "ReflowInput.h".

There are missing types:

  • OverflowAreas
  • StyleSizeOverrides

But I think these can be remedied if I include their header files, if that is allowed.

In the "nsIFrame" class, there are redefinitions that need to be removed:
using ReflowInput = mozilla::ReflowInput;
using ReflowOutput = mozilla::ReflowOutput;

There are some member functions of nsIFrame class that depend on a "ReflowInput::BreakType", but we can copy the definition from ReflowInput.h to nsIFrame.h. Looks like its just a small enum class.

Also some member functions of nsIFrame require a passed in an instance of ReflowInput:

  • virtual void DidReflow(nsPresContext* aPresContext, const ReflowInput* aReflowInput);
  • FinishReflowWithAbsoluteFrame(....)
  • ReflowAbsoluteFrames(..)
Comment Actions

There are some member functions of nsIFrame class that depend on a "ReflowInput::BreakType", but we can copy the definition from ReflowInput.h to nsIFrame.h. Looks like its just a small enum class.

Hmm yeah, ReflowInput::BreakType is tricky that it cannot be forward declared. I would argue that any enums that is used for parameters of other class methods should not be inside the struct but should be extracted to a separate declaration.

Comment Actions

There are some member functions of nsIFrame class that depend on a "ReflowInput::BreakType", but we can copy the definition from ReflowInput.h to nsIFrame.h. Looks like its just a small enum class.

Hmm yeah, ReflowInput::BreakType is tricky that it cannot be forward declared. I would argue that any enums that is used for parameters of other class methods should not be inside the struct but should be extracted to a separate declaration.

I agree as well, should I extract the definition of "BreakType" in ReflowInput.h and create a separate headerfile containing only that definition. Something like "/layout/generic/BreakType.h" and make the appropriate replacements?

For the member functions that still contain a functions needing a "ReflowInput" class, are there replacement functions or should I look into cleaning that up.

emilio requested changes to this revision.Jun 19 2024, 8:12 AM
Comment Actions

Yeah so it seems this would need:

  • Forward-declaring ReflowInput and .
  • Move at least OverflowAreas, and ReflowInput::BreakType to a different file, or include for now.
  • Move one or two functions out of line.

Still it seems it'd be worth it in general, but it's a fair amount of work.

This revision now requires changes to proceed.Jun 19 2024, 8:12 AM
Comment Actions
  • Move one or two functions out of line.

Just to clarify, by functions do you mean the member functions that take in a reference to "ReflowInput". And by "out of line" do you mean to convert them into local functions within the .h/.cpp file.

dholbert added a reviewer: lilabivert.
dholbert added a subscriber: dholbert.
Comment Actions

Commandeering so that I can mark this as abandoned, so that a newly-arrived contributor can pick this up.

Revision Contents

PathSize
layout/
generic/
1 line
CommitParentsAuthorSummaryDate
167a81d2fd2fd00c580fa44dlilabivert
Bug 1650944 - Removed ReflowInput.h include from nsIFrame.h r=emilio (Show More…)
Jun 17 2024, 9:48 PM

Diff 877883

layout/generic/nsIFrame.h

Loading...