Closed Bug 1424094 Opened 7 years ago Closed 7 years ago

Get rid of the second argument of GetLastIBSplitSibling

Categories

(Core :: Layout, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla59
Tracking Status
firefox59 --- fixed

People

(Reporter: emilio, Assigned: emilio)

References

Details

Attachments

(1 file)

We can do this now after bug 1419762 and bug 1419964. Let's also be consistent about what continuation we append to.
Comment on attachment 8935573 [details] Bug 1424094: Remove second argument for GetLastIBSplitSibling, and always append to the last continuation of an IB split. https://reviewboard.mozilla.org/r/206448/#review212276 r=mats, feel free to resolve the nits as you please ::: layout/base/nsCSSFrameConstructor.cpp:6494 (Diff revision 3) > +AppendParent(nsContainerFrame* aParentFrame) > +{ nit: AppendParent sounds like it's appending something. Maybe ContinuationToAppendTo, or ContinuationForAppend is better? Prefixing the calls with :: wouldn't hurt either, to make it clear it's not a method call on 'this'. (nsCSSFrameConstructor is quite big unfortunately so prefixing static helper function calls with :: helps when reading the code IMO) ::: layout/base/nsCSSFrameConstructor.cpp:6955 (Diff revision 3) > - // Get continuation that parents the last child. > - aInsertion->mParentFrame = > - nsLayoutUtils::LastContinuationWithChild(aInsertion->mParentFrame); > - // Deal with fieldsets > aInsertion->mParentFrame = > - ::GetAdjustedParentFrame(aInsertion->mParentFrame, aChild); > + GetAdjustedParentFrame(aInsertion->mParentFrame, aChild); nit: fwiw, I'd prefer to keep :: ::: layout/base/nsCSSFrameConstructor.cpp:7561 (Diff revision 3) > if (GetDisplayContentsStyleFor(insertion.mContainer) || > nsLayoutUtils::GetAfterFrame(insertion.mContainer)) { Fwiw, it looks like everything from "parentFrame = AppendParent(parentFrame)" (inclusive) to this point could go in an else-branch of this if-statement, since 'parentFrame' isn't used by it. Not intended as an optimization (since taking the then-branch should be rare), but perhaps it would make the code simpler/clearer? ::: layout/base/nsCSSFrameConstructor.cpp:7569 (Diff revision 3) > if (nextSibling) { > parentFrame = nextSibling->GetParent()->GetContentInsertionFrame(); nit: please move this inside the preceding if-block
Attachment #8935573 - Flags: review?(mats) → review+
Comment on attachment 8935573 [details] Bug 1424094: Remove second argument for GetLastIBSplitSibling, and always append to the last continuation of an IB split. https://reviewboard.mozilla.org/r/206448/#review212276 > nit: AppendParent sounds like it's appending something. Maybe ContinuationToAppendTo, or ContinuationForAppend is better? > Prefixing the calls with :: wouldn't hurt either, to make it clear it's not a method call on 'this'. > (nsCSSFrameConstructor is quite big unfortunately so prefixing static helper function calls with :: helps when reading the code IMO) Yup, agree, I'll go with `::ContinuationToAppendTo` :) > nit: fwiw, I'd prefer to keep :: Fair, will keep those. > Fwiw, it looks like everything from "parentFrame = AppendParent(parentFrame)" (inclusive) to this point could go in an else-branch of this if-statement, since 'parentFrame' isn't used by it. > > Not intended as an optimization (since taking the then-branch should be rare), but perhaps it would make the code simpler/clearer? Agreed it's nicer, so will do. > nit: please move this inside the preceding if-block Done.
Pushed by ecoal95@gmail.com: https://hg.mozilla.org/integration/autoland/rev/cce54e34c28b Remove second argument for GetLastIBSplitSibling, and always append to the last continuation of an IB split. r=mats
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
So I'm confused about one thing: if the display:contents/::after condition tests true but nextSibling comes back null, why do we not need to ContinuationToAppendTo()?
Flags: needinfo?(emilio)
Blerg, I should not address review comments in the morning... :(
Depends on: 1424680
Flags: needinfo?(emilio)
Bug 1424680 tracks fixing the issue I raise in comment 10.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: