Commit c0962354 authored by leviw@chromium.org's avatar leviw@chromium.org

Fix incorrect assumption about children's flexBasis

The code to cache preferredMainAxisContentExtentForChild when possible
and re-use to avoid forcing layout was broken in the case that a child's
flex basis changed to cause it to be dependent on layout, triggering
an assert in debug. Just pushing it down the normal path fixes the
issue.

BUG=366185

Review URL: https://codereview.chromium.org/655053002

git-svn-id: svn://svn.chromium.org/blink/trunk@183853 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 10c2fd1d
......@@ -927,8 +927,6 @@ crbug.com/392640 svg/as-object/sizing/svg-in-object-placeholder-height-percentag
# Expectations changes due to switiching to In-renderer Shared Worker.
crbug.com/327256 fast/workers/shared-worker-lifecycle.html [ Failure Pass ]
crbug.com/366185 inspector/split-view.html [ Slow Crash ]
crbug.com/361729 fast/multicol/pagination-h-horizontal-bt.html [ Pass Failure ]
crbug.com/361729 fast/multicol/pagination-h-horizontal-tb.html [ Pass Failure ]
......
<!DOCTYPE html>
<html>
<style>
#flex {
display: flex;
width: 100px;
}
#flex > div {
height: 30px;
}
.column {
flex-direction: column;
}
</style>
<body>
<div id="flex">
<div>Foo</div>
<div id="target" data-offset-y=38>Bar</div>
</div>
<script src="../../resources/check-layout.js"></script>
<script>
var flexbox = document.getElementById('flex');
flexbox.offsetTop;
flexbox.classList.add('column');
checkLayout('#target');
</script>
\ No newline at end of file
......@@ -611,12 +611,11 @@ LayoutUnit RenderFlexibleBox::preferredMainAxisContentExtentForChild(RenderBox&
if (preferredMainAxisExtentDependsOnLayout(flexBasis, hasInfiniteLineLength)) {
LayoutUnit mainAxisExtent;
if (hasOrthogonalFlow(child)) {
if (child.needsLayout() || relayoutChildren) {
if (child.needsLayout() || relayoutChildren || !m_intrinsicSizeAlongMainAxis.contains(&child)) {
m_intrinsicSizeAlongMainAxis.remove(&child);
child.forceChildLayout();
m_intrinsicSizeAlongMainAxis.set(&child, child.logicalHeight());
}
ASSERT(m_intrinsicSizeAlongMainAxis.contains(&child));
mainAxisExtent = m_intrinsicSizeAlongMainAxis.get(&child);
} else {
mainAxisExtent = child.maxPreferredLogicalWidth();
......
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