gecko-dev/layout
Daniel Holbert 732182f0c9 Bug 1461446: Make flex layout explicitly handle integer overflow when summing up flex item hypothetical sizes. r=mats
This patch accomodates for the unfortunate fact that elements with
"table-layout:fixed" have a max-content size of nscoord_MAX (infinity,
effectively), which turns out to be an easy source of integer overflow during
flex layout.

Before this patch, a flex container with "table-layout:fixed" in several flex
items could end up triggering integer-overflow & making the wrong judgement on
its arithmetic to determine...
 - whether a given flex item will fit on an existing flex line.
 - whether we've got positive free space and need to grow our items, or have
   negative free space and need to shrink our items.

This patch makes two changes to fix this issue.

(1) This patch makes us use CheckedInt when summing up flex item hypothetical
    sizes, which prevents integer overflow from flipping the sign of our line's
    total length.

(2) This patch makes us *directly* track the space reserved for flex item
    margin/border/padding within a flex line.  Previously, we tracked this
    implicitly as the difference between two other quantities that we stored;
    but with the other changes in this patch, those two other quantities can
    *both* trigger overflow and get clamped, which would make us lose track of
    how much space to reserve for margin/border/padding.  So now we simply
    track that space-to-reserve directly.

MozReview-Commit-ID: 9izhOnlS4F1

--HG--
extra : rebase_source : 185f2409dcb2f9c5bd0a2466a8e2233d7db3250a
2018-05-25 19:46:29 -07:00
..
base Bug 1414100: Crashtest. r=emilio 2018-05-25 18:36:30 +02:00
build Bug 1146316 - Leak fix, set up CC in XPCShell too. r=smaug. 2018-05-08 17:07:33 +02:00
doc Bug 1447483: Merge nsStyleContext and ServoStyleContext, rename to ComputedStyle. r=jwatt on a CLOSED TREE 2018-03-22 20:06:24 +01:00
forms Bug 1460787 - Change fatal assertion to warning for extremely large sized pages. r=dholbert 2018-05-23 10:06:57 -07:00
generic Bug 1461446: Make flex layout explicitly handle integer overflow when summing up flex item hypothetical sizes. r=mats 2018-05-25 19:46:29 -07:00
inspector Bug 1461933 - Remove ServoBindings.h from ComputedStyleInline.h. r=emilio 2018-05-16 15:35:59 +10:00
ipc Bug 1454042 - Allow missing pipeline information for cross-process iframes. r=sotaro 2018-05-18 10:31:18 -04:00
mathml Bug 1460491 - Part 1: Split nsDisplayItem::mVisibleRect into two members, one for each stated purpose. Gets rid of the save/restore since we no longer modify the building rect. r=jnicol 2018-05-16 15:56:32 +12:00
media
painting Bug 1464288 - Make sure PreProcessDisplayLists logic for switching AGRs matches what ComputeRebuildRegion uses. r=miko 2018-05-26 16:55:17 +12:00
printing Bug 1461933 - Remove ServoBindings.h from ComputedStyleInline.h. r=emilio 2018-05-16 15:35:59 +10:00
reftests Bug 1461446: Make flex layout explicitly handle integer overflow when summing up flex item hypothetical sizes. r=mats 2018-05-25 19:46:29 -07:00
style Backed out changeset d48abd83fc7c (bug 1463884) since it's not the correct fix. r=me 2018-05-27 10:04:27 +02:00
svg Merge mozilla-inbound to mozilla-central. a=merge 2018-05-23 12:51:22 +03:00
tables Bug 1460491 - Part 1: Split nsDisplayItem::mVisibleRect into two members, one for each stated purpose. Gets rid of the save/restore since we no longer modify the building rect. r=jnicol 2018-05-16 15:56:32 +12:00
tools Bug 1237182: Fix python unitests r=bustage on a CLOSED TREE 2018-05-25 13:42:58 -04:00
xul Bug 1455182 - Additional cleanup to nsDisplayOwnLayer and ScrollbarData. r=botond 2018-05-25 07:20:39 +02:00
moz.build Bug 1417978 - Stop packaging layout debugger on Android. r=nalexander 2018-01-04 15:22:35 -06:00