Bug 1674450 Part 6 - Convert ReflowInput::Init()'s optional border and padding parameters to Maybe<LogicalMargin>. r=layout-reviewers,jfkthame

Similar to the optional aContainingBlockSize parameter, both border and
padding should use logical coordinates in ReflowInput::mFrame's writing
mode.

Table frames that need to override border and padding can be simplified a bit.
However, DR_init_constraints_cookie and DR_init_offsets_cookie become more
complex, but they're only for debugging. I'm not planning to update their
internal APIs.

Differential Revision: https://phabricator.services.mozilla.com/D95369
This commit is contained in:
Ting-Yu Lin
2020-10-31 14:39:23 +00:00
parent 69f9e744f8
commit a43ebbb53a
12 changed files with 99 additions and 65 deletions

View File

@@ -673,8 +673,9 @@ void nsTextControlFrame::ReflowTextControlChild(
Nothing(), ReflowInput::InitFlag::CallerWillInit);
// Override padding with our computed padding in case we got it from theming
// or percentage.
kidReflowInput.Init(aPresContext, Nothing(), nullptr,
&aReflowInput.ComputedPhysicalPadding());
kidReflowInput.Init(aPresContext, Nothing(), Nothing(),
Some(aReflowInput.ComputedLogicalPadding().ConvertTo(
wm, aReflowInput.GetWritingMode())));
// Set computed width and computed height for the child
kidReflowInput.SetComputedWidth(aReflowInput.ComputedWidth());