Closed Bug 1624684 Opened 5 years ago Closed 5 years ago

ApplySkipSide can be easier to use if it returns *this

Categories

(Core :: Layout, task)

task
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla77
Tracking Status
firefox77 --- fixed

People

(Reporter: TYLin, Assigned: TYLin)

Details

Attachments

(3 files)

LogicalMargin::ApplySkipSide or BaseMargin::ApplySkipSide can be easier to use if it returns a reference to itself.

For example, this hunk

  auto bp = GetLogicalUsedBorderAndPadding(aWM);
  bp.ApplySkipSides(GetLogicalSkipSides());

can be written as (with nice const modifier)

const auto bp = GetLogicalUsedBorderAndPadding(aWM).ApplySkipSide(GetLogicalSkipSides());

There's no point to have 'const' on a newly constructed return value.

Assignee: nobody → aethanyc
Status: NEW → ASSIGNED
Pushed by aethanyc@gmail.com: https://hg.mozilla.org/integration/autoland/rev/63c5a8eb6e9c Part 1 - Remove 'const' from the return value of ComputedLogical{Margin,Borderpadding,Padding}. r=jfkthame https://hg.mozilla.org/integration/autoland/rev/89df1bf5dee8 Part 2 - Let LogicalMargin::ApplySkipSides return a reference to itself, and convert some callers. r=jfkthame https://hg.mozilla.org/integration/autoland/rev/970bca14c577 Part 3 - Let BaseMargin::ApplySkipSides return a reference to itself, and convert some callers. r=jfkthame
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla77
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: