Bug 1674931 Part 3 - Add WritingMode argument to SizeComputationInput::ComputedLogicalPadding(), and adapt callers. r=jfkthame

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

Differential Revision: https://phabricator.services.mozilla.com/D95663
This commit is contained in:
Ting-Yu Lin
2020-11-03 19:56:03 +00:00
parent aca4ad21ab
commit 04bfc9cd34
10 changed files with 26 additions and 29 deletions

View File

@@ -433,7 +433,7 @@ void nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
// inner frame applies the padding (but not borders).
const auto wm = GetWritingMode();
LogicalMargin border = aReflowInput.ComputedLogicalBorderPadding(wm) -
aReflowInput.ComputedLogicalPadding();
aReflowInput.ComputedLogicalPadding(wm);
auto skipSides = PreReflowBlockLevelLogicalSkipSides();
border.ApplySkipSides(skipSides);
LogicalSize availSize(wm, aReflowInput.ComputedSize().ISize(wm),
@@ -572,9 +572,9 @@ void nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
innerAvailSize, Nothing(),
ReflowInput::InitFlag::CallerWillInit);
// Override computed padding, in case it's percentage padding
kidReflowInput.Init(aPresContext, Nothing(), Nothing(),
Some(aReflowInput.ComputedLogicalPadding().ConvertTo(
inner->GetWritingMode(), wm)));
kidReflowInput.Init(
aPresContext, Nothing(), Nothing(),
Some(aReflowInput.ComputedLogicalPadding(inner->GetWritingMode())));
if (kidReflowInput.mFlags.mIsTopOfPage) {
// Prevent break-before from |inner| if we have a legend.
kidReflowInput.mFlags.mIsTopOfPage = !legend;
@@ -668,7 +668,7 @@ void nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
// The legend is positioned inline-wards within the inner's content rect
// (so that padding on the fieldset affects the legend position).
LogicalRect innerContentRect = contentRect;
innerContentRect.Deflate(wm, aReflowInput.ComputedLogicalPadding());
innerContentRect.Deflate(wm, aReflowInput.ComputedLogicalPadding(wm));
// If the inner content rect is larger than the legend, we can align the
// legend.
if (innerContentRect.ISize(wm) > mLegendRect.ISize(wm)) {