Closed Bug 1674931 Opened 4 years ago Closed 4 years ago

Add WritingMode argument to SizeComputationInput's margin, border/padding, and padding getters

Categories

(Core :: Layout, task)

task

Tracking

()

RESOLVED FIXED
84 Branch
Tracking Status
firefox84 --- fixed

People

(Reporter: TYLin, Assigned: TYLin)

References

(Blocks 1 open bug)

Details

Attachments

(8 files)

47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review

A follow-up for bug 1674450 comment 9.

Add WritingMode argument to ComputedLogicalMargin(), ComputedLogicalBorderPadding(), and ComputedLogicalPadding(), and adapt all the callers. https://searchfox.org/mozilla-central/rev/d866b96d74ec2a63f09ee418f048d23f4fd379a2/layout/generic/ReflowInput.h#132-140

With that, ComputedLogicalMargin().ConvertTo(parentWM, childWM) can be written as just ComputedLogicalMargin(parentWM), similar to the nsIFrame APIs GetLogicalUsedMargin(WritingMode).

It's straightforward to determine which writing mode is required to pass
to ComputedLogicalMargin() by looking at any subsequent method called on
the margin.

For example, if we see

ComputedLogicalMargin().BStartEnd(wm);

the writing mode needed to pass to ComputedLogicalMargin() is wm.

Assignee: nobody → aethanyc
Status: NEW → ASSIGNED

This patch is similar to Part 1, but for ComputedLogicalBorderPadding().

Depends on D95661

This patch is similar to Part 1, but for ComputedLogicalPadding(). r?jfkthame

Depends on D95662

When referring to WritingMode and LogicalMargin, most of the existing
users in SizeComputationInput are using mozilla:: prefix, so let's
remove the alias.

Depends on D95666

Pushed by aethanyc@gmail.com: https://hg.mozilla.org/integration/autoland/rev/b43f8212b0e4 Part 1 - Add WritingMode argument to SizeComputationInput::ComputedLogicalMargin(), and adapt callers. r=jfkthame https://hg.mozilla.org/integration/autoland/rev/ad537634af0d Part 2 - Add WritingMode argument to SizeComputationInput::ComputedLogicalBorderPadding(), and adapt callers. r=jfkthame https://hg.mozilla.org/integration/autoland/rev/ccf29bb17bcc Part 3 - Add WritingMode argument to SizeComputationInput::ComputedLogicalPadding(), and adapt callers. r=jfkthame https://hg.mozilla.org/integration/autoland/rev/b825a3eca0c8 Part 4 - Remove zero-argument ReflowInput::ComputedSizeWithPadding(). r=jfkthame https://hg.mozilla.org/integration/autoland/rev/77f2dc7fe502 Part 5 - Remove zero-argument ReflowInput::ComputedSizeWithBorderPadding(). r=jfkthame https://hg.mozilla.org/integration/autoland/rev/fb89da07ea44 Part 6 - Remove zero-argument ReflowInput::ComputedSizeWithMarginBorderPadding(). r=jfkthame https://hg.mozilla.org/integration/autoland/rev/a4492eeb3fa7 Part 7 - Remove WritingMode and LogicalMargin alias in SizeComputationInput. r=jfkthame https://hg.mozilla.org/integration/autoland/rev/d8ccdc36c309 Part 8 - Rename childReflowOuput to childReflowInput in nsDateTimeControlFrame::Reflow(). r=emilio
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: