Revert "[Layout] Make LayoutUnit::Min() be -LayoutUnit::Max()"
This reverts commit b8ad61c0. Reason for revert: The operators for +,-,+=,-= used base::Clamp{Add,Sub} which didn't apply the new limits. As such it was possible for the code to get into a state where: LayoutUnit test = LayoutUnit::Min(); test -= LayoutUnit(1); LOG(INFO) << "result: " << (test < LayoutUnit::Min()); The above would log "true". Code which operated near these limits was now fragile. Causing crbug.com/989742. Original change's description: > [Layout] Make LayoutUnit::Min() be -LayoutUnit::Max() > > Some table code adds positive size to negative padding to get final > size. A pathological page with padding and size of equal magnitudes > could saturate size to LayoutUnit::Max() and padding to > LayoutUnit::Min(), causing the result to be -1 instead of 0. > > Bug: 966564 > Change-Id: I1b48a13691c63c916d705e0fd62831c63f1a3363 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1639481 > Commit-Queue: David Grogan <dgrogan@chromium.org> > Reviewed-by: Emil A Eklund <eae@chromium.org> > Cr-Commit-Position: refs/heads/master@{#670977} TBR=dgrogan@chromium.org,eae@chromium.org,cavalcantii@chromium.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: 966564, 989742 Change-Id: Ic363c34409eda992dbf1dc3b4b4b56d5ea715887 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1730527Reviewed-by:Ian Kilpatrick <ikilpatrick@chromium.org> Reviewed-by:
Emil A Eklund <eae@chromium.org> Reviewed-by:
David Grogan <dgrogan@chromium.org> Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org> Cr-Commit-Position: refs/heads/master@{#684057}
Showing
Please register or sign in to comment