зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1225118 - [css-grid] Deal with nscoord overflow when applying [align|justify]-self:stretch. r=dholbert
This commit is contained in:
Родитель
da54c2a828
Коммит
b442e0b4b3
|
@ -962,7 +962,6 @@ AlignJustifySelf(uint8_t aAlignment, bool aOverflowSafe, LogicalAxis aAxis,
|
|||
nscoord bpInAxis = aAxis == eLogicalAxisBlock ? bp.BStartEnd(wm)
|
||||
: bp.IStartEnd(wm);
|
||||
nscoord contentSize = size - bpInAxis;
|
||||
NS_ASSERTION(contentSize >= 0, "huh?");
|
||||
const nscoord unstretchedContentSize = contentSize;
|
||||
contentSize += gap;
|
||||
nscoord max = aAxis == eLogicalAxisBlock ? aRS.ComputedMaxBSize()
|
||||
|
@ -973,7 +972,8 @@ AlignJustifySelf(uint8_t aAlignment, bool aOverflowSafe, LogicalAxis aAxis,
|
|||
}
|
||||
// |gap| is now how much the content size is actually allowed to grow.
|
||||
didResize = gap > 0;
|
||||
if (didResize) {
|
||||
// (nscoord overflow can make |contentSize| negative, bug 1225118)
|
||||
if (didResize && MOZ_LIKELY(contentSize >= 0)) {
|
||||
(aAxis == eLogicalAxisBlock ? aContentSize->BSize(wm)
|
||||
: aContentSize->ISize(wm)) = contentSize;
|
||||
if (MOZ_UNLIKELY(!aSameSide)) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче