Closed Bug 1468089 Opened 2 years ago Closed 2 years ago

Add a few WritingMode convenience methods to simplify consumers that are parameterized on axis

Categories

(Core :: Layout, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla62
Tracking Status
firefox62 --- fixed

People

(Reporter: mats, Assigned: mats)

References

Details

Attachments

(1 file)

In Grid layout code it's quite common for methods to be axis-neutral,
e.g. methods that takes a LogicalAxis as a param which is then
invoked once for each axis.  Accessing the relevant axis-data from
a LogicalSize or LogicalMargin etc is a bit tedious (and error prone)
though since you have to write something like:
size = aAxis == eLogicalAxisInline ? x.ISize(wm) : x.BSize(wm);
It would convenient to write instead:
size = x.Size(aAxis, wm);
These are methods that I'm using in my subgrid patches.  We can add more later
to simplify existing code...
Attachment #8984752 - Flags: review?(jfkthame)
FTR, CSSAlignUtils has a few existing uses that could be simplified, e.g.:
https://searchfox.org/mozilla-central/source/layout/generic/CSSAlignUtils.cpp#18
Attachment #8984752 - Flags: review?(jfkthame) → review+
Pushed by mpalmgren@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/63daa6667de7
Add a few convenience methods to simplify consumers that are parameterized on axis.  r=jfkthame
https://hg.mozilla.org/mozilla-central/rev/63daa6667de7
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
Blocks: 1468263
You need to log in before you can comment on or make changes to this bug.