зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1772305 - Allow auto margins of abspos boxes to be negative if both in-axis insets are non-auto. r=emilio
Currently, when an inset is large enough that auto margins would distribute a negative value, we always clamp it to zero. This works for scenarios where at least one of the insets in the relevant axis was auto, since the spec resolves the auto margin to be zero in this case. However, the spec does not disallow a negative auto margin value when both insets are non-auto. Differential Revision: https://phabricator.services.mozilla.com/D170931
This commit is contained in:
Родитель
ba10a84cbb
Коммит
2be6246f15
|
@ -672,14 +672,14 @@ void nsAbsoluteContainingBlock::ResolveAutoMarginsAfterLayout(
|
|||
LogicalMargin offsetsInWM = aOffsets.ConvertTo(wm, outerWM);
|
||||
|
||||
// No need to substract border sizes because aKidSize has it included
|
||||
// already
|
||||
nscoord availMarginSpace = aLogicalCBSize->BSize(wm) - kidSizeInWM.BSize(wm) -
|
||||
offsetsInWM.BStartEnd(wm) -
|
||||
marginInWM.BStartEnd(wm);
|
||||
|
||||
if (availMarginSpace < 0) {
|
||||
availMarginSpace = 0;
|
||||
}
|
||||
// already. Also, if any offset is auto, the auto margin resolves to zero.
|
||||
// https://drafts.csswg.org/css-position-3/#abspos-margins
|
||||
const bool autoOffset = offsetsInWM.BEnd(wm) == NS_AUTOOFFSET ||
|
||||
offsetsInWM.BStart(wm) == NS_AUTOOFFSET;
|
||||
nscoord availMarginSpace =
|
||||
autoOffset ? 0
|
||||
: aLogicalCBSize->BSize(wm) - kidSizeInWM.BSize(wm) -
|
||||
offsetsInWM.BStartEnd(wm) - marginInWM.BStartEnd(wm);
|
||||
|
||||
const auto& styleMargin = aKidReflowInput.mStyleMargin;
|
||||
if (wm.IsOrthogonalTo(outerWM)) {
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
[fit-content-block-size-abspos.html]
|
||||
expected: FAIL
|
|
@ -1,2 +0,0 @@
|
|||
[fit-content-block-size-fixedpos.html]
|
||||
expected: FAIL
|
Загрузка…
Ссылка в новой задаче