зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1675128 Part 4 - Remove ReflowInput::ComputedPhysicalOffsets() that returns a writable-reference. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D96128
This commit is contained in:
Родитель
1fb3ba8f3e
Коммит
43e060b82e
|
@ -859,26 +859,26 @@ static bool RecomputePosition(nsIFrame* aFrame) {
|
|||
// match the reflow code path.
|
||||
//
|
||||
// TODO(emilio): It'd be nice if this did logical math instead, but it seems
|
||||
// to me the math should work out on vertical writing modes as well.
|
||||
if (NS_AUTOOFFSET == reflowInput.ComputedPhysicalOffsets().left) {
|
||||
reflowInput.ComputedPhysicalOffsets().left =
|
||||
cbSize.width - reflowInput.ComputedPhysicalOffsets().right -
|
||||
reflowInput.ComputedPhysicalMargin().right - size.width -
|
||||
reflowInput.ComputedPhysicalMargin().left;
|
||||
// to me the math should work out on vertical writing modes as well. See Bug
|
||||
// 1675861 for some hints.
|
||||
const nsMargin offset = reflowInput.ComputedPhysicalOffsets();
|
||||
const nsMargin margin = reflowInput.ComputedPhysicalMargin();
|
||||
|
||||
nscoord left = offset.left;
|
||||
if (left == NS_AUTOOFFSET) {
|
||||
left =
|
||||
cbSize.width - offset.right - margin.right - size.width - margin.left;
|
||||
}
|
||||
|
||||
if (NS_AUTOOFFSET == reflowInput.ComputedPhysicalOffsets().top) {
|
||||
reflowInput.ComputedPhysicalOffsets().top =
|
||||
cbSize.height - reflowInput.ComputedPhysicalOffsets().bottom -
|
||||
reflowInput.ComputedPhysicalMargin().bottom - size.height -
|
||||
reflowInput.ComputedPhysicalMargin().top;
|
||||
nscoord top = offset.top;
|
||||
if (top == NS_AUTOOFFSET) {
|
||||
top = cbSize.height - offset.bottom - margin.bottom - size.height -
|
||||
margin.top;
|
||||
}
|
||||
|
||||
// Move the frame
|
||||
nsPoint pos(parentBorder.left + reflowInput.ComputedPhysicalOffsets().left +
|
||||
reflowInput.ComputedPhysicalMargin().left,
|
||||
parentBorder.top + reflowInput.ComputedPhysicalOffsets().top +
|
||||
reflowInput.ComputedPhysicalMargin().top);
|
||||
nsPoint pos(parentBorder.left + left + margin.left,
|
||||
parentBorder.top + top + margin.top);
|
||||
aFrame->SetPosition(pos);
|
||||
|
||||
if (aFrame->IsInScrollAnchorChain()) {
|
||||
|
|
|
@ -2093,7 +2093,7 @@ void ReflowInput::InitConstraints(
|
|||
// Override mComputedMargin since reflow roots start from the
|
||||
// frame's boundary, which is inside the margin.
|
||||
SetComputedLogicalMargin(wm, LogicalMargin(wm));
|
||||
ComputedPhysicalOffsets().SizeTo(0, 0, 0, 0);
|
||||
SetComputedLogicalOffsets(wm, LogicalMargin(wm));
|
||||
|
||||
const auto borderPadding = ComputedLogicalBorderPadding(wm);
|
||||
ComputedISize() = AvailableISize() - borderPadding.IStartEnd(wm);
|
||||
|
@ -2206,7 +2206,7 @@ void ReflowInput::InitConstraints(
|
|||
SetComputedLogicalOffsets(cbwm, offsets);
|
||||
} else {
|
||||
// Initialize offsets to 0
|
||||
ComputedPhysicalOffsets().SizeTo(0, 0, 0, 0);
|
||||
SetComputedLogicalOffsets(wm, LogicalMargin(wm));
|
||||
}
|
||||
|
||||
// Calculate the computed values for min and max properties. Note that
|
||||
|
|
|
@ -421,7 +421,6 @@ struct ReflowInput : public SizeComputationInput {
|
|||
// XXX this will need to change when we make mComputedOffsets logical;
|
||||
// we won't be able to return a reference for the physical offsets
|
||||
const nsMargin& ComputedPhysicalOffsets() const { return mComputedOffsets; }
|
||||
nsMargin& ComputedPhysicalOffsets() { return mComputedOffsets; }
|
||||
|
||||
LogicalMargin ComputedLogicalOffsets(mozilla::WritingMode aWM) const {
|
||||
return LogicalMargin(aWM, mComputedOffsets);
|
||||
|
|
Загрузка…
Ссылка в новой задаче