Commit 63ef5ab7 authored by Aleks Totic's avatar Aleks Totic Committed by Commit Bot

Fix abspos DCHECK crash

Bug: 740993
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I88816900bd0b55b6b6d8c5b139a2819ebfa1a9a3
Reviewed-on: https://chromium-review.googlesource.com/963510Reviewed-by: default avatarIan Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Aleks Totic <atotic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543236}
parent 40351e7f
...@@ -3400,7 +3400,6 @@ crbug.com/591099 printing/thead-repeats-at-top-of-each-page.html [ Failure ] ...@@ -3400,7 +3400,6 @@ crbug.com/591099 printing/thead-repeats-at-top-of-each-page.html [ Failure ]
crbug.com/591099 printing/thead-under-multicol.html [ Failure ] crbug.com/591099 printing/thead-under-multicol.html [ Failure ]
crbug.com/591099 scrollbars/auto-scrollbar-fit-content.html [ Failure ] crbug.com/591099 scrollbars/auto-scrollbar-fit-content.html [ Failure ]
crbug.com/591099 scrollbars/custom-scrollbar-with-incomplete-style.html [ Failure ] crbug.com/591099 scrollbars/custom-scrollbar-with-incomplete-style.html [ Failure ]
crbug.com/591099 scrollbars/scrollbar-large-overflow-rectangle.html [ Crash ]
crbug.com/591099 scrollbars/scrollbar-miss-mousemove-disabled.html [ Failure ] crbug.com/591099 scrollbars/scrollbar-miss-mousemove-disabled.html [ Failure ]
crbug.com/714962 scrollbars/scrollbar-orientation.html [ Failure ] crbug.com/714962 scrollbars/scrollbar-orientation.html [ Failure ]
crbug.com/714962 scrollbars/scrollbar-position-crash.html [ Crash ] crbug.com/714962 scrollbars/scrollbar-position-crash.html [ Crash ]
......
...@@ -263,10 +263,10 @@ void ComputeAbsoluteHorizontal(const NGConstraintSpace& space, ...@@ -263,10 +263,10 @@ void ComputeAbsoluteHorizontal(const NGConstraintSpace& space,
// Rules 4 through 6, 1 out of 3 are unknown. // Rules 4 through 6, 1 out of 3 are unknown.
if (!left) { if (!left) {
left = left =
container_size.width - *right - *width - *margin_left - *margin_right; container_size.width - *width - *right - *margin_left - *margin_right;
} else if (!right) { } else if (!right) {
right = right =
container_size.width - *left - *width - *margin_left - *margin_right; container_size.width - *width - *left - *margin_left - *margin_right;
} else if (!width) { } else if (!width) {
width = width =
container_size.width - *left - *right - *margin_left - *margin_right; container_size.width - *left - *right - *margin_left - *margin_right;
...@@ -431,18 +431,22 @@ void ComputeAbsoluteVertical(const NGConstraintSpace& space, ...@@ -431,18 +431,22 @@ void ComputeAbsoluteVertical(const NGConstraintSpace& space,
// Rules 4 through 6, 1 out of 3 are unknown. // Rules 4 through 6, 1 out of 3 are unknown.
if (!top) { if (!top) {
top = container_size.height - *bottom - *height - *margin_top - top = container_size.height - *height - *bottom - *margin_top -
*margin_bottom; *margin_bottom;
} else if (!bottom) { } else if (!bottom) {
bottom = bottom =
container_size.height - *top - *height - *margin_top - *margin_bottom; container_size.height - *height - *top - *margin_top - *margin_bottom;
} else if (!height) { } else if (!height) {
height = height =
container_size.height - *top - *bottom - *margin_top - *margin_bottom; container_size.height - *top - *bottom - *margin_top - *margin_bottom;
} }
DCHECK_EQ(container_size.height, // The DCHECK is useful, but only holds true when not saturated.
*top + *bottom + *margin_top + *margin_bottom + *height); if (!(top->MightBeSaturated() || bottom->MightBeSaturated() ||
height->MightBeSaturated() || margin_top->MightBeSaturated() ||
margin_bottom->MightBeSaturated())) {
DCHECK_EQ(container_size.height,
*top + *bottom + *margin_top + *margin_bottom + *height);
}
// If calculated height is outside of min/max constraints, // If calculated height is outside of min/max constraints,
// rerun the algorithm with constrained width. // rerun the algorithm with constrained width.
Optional<LayoutUnit> min_height; Optional<LayoutUnit> min_height;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment