Commit 2e73b093 authored by Chris Harrelson's avatar Chris Harrelson Committed by Commit Bot

Recompute logical width and column width if relayout of flexbox is neeeded.

This may happen if children acquire scrollbars.

Change-Id: Iafd48e0f1afc927e8723f3a2f57b6dddf3157fd1
Reviewed-on: https://chromium-review.googlesource.com/889904Reviewed-by: default avatarChristian Biesinger <cbiesinger@chromium.org>
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533053}
parent a18cb649
<!DOCTYPE html>
<html>
<link href="resources/flexbox.css" rel="stylesheet">
<style>
.flexbox {
border: 5px solid green;
position: relative;
height: 50px;
display: inline-flex;
}
.overflow {
border: 1px solid red;
overflow: auto;
min-width: 0;
min-height: 0;
}
</style>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../../resources/check-layout-th.js"></script>
<body onload="checkLayout('.flexbox')">
<div id=log></div>
<div id=target class="flexbox" data-expected-width="47">
<div class="overflow">
<div style="height: 100px; width: 20px"></div>
</div>
</div>
</body>
</html>
...@@ -382,6 +382,9 @@ void LayoutFlexibleBox::UpdateBlockLayout(bool relayout_children) { ...@@ -382,6 +382,9 @@ void LayoutFlexibleBox::UpdateBlockLayout(bool relayout_children) {
LayoutFlexItems(relayout_children, layout_scope); LayoutFlexItems(relayout_children, layout_scope);
if (PaintLayerScrollableArea::PreventRelayoutScope::RelayoutNeeded()) { if (PaintLayerScrollableArea::PreventRelayoutScope::RelayoutNeeded()) {
// Recompute the logical width, because children may have added or removed
// scrollbars.
UpdateLogicalWidthAndColumnWidth();
PaintLayerScrollableArea::FreezeScrollbarsScope freeze_scrollbars_scope; PaintLayerScrollableArea::FreezeScrollbarsScope freeze_scrollbars_scope;
PrepareOrderIteratorAndMargins(); PrepareOrderIteratorAndMargins();
LayoutFlexItems(true, layout_scope); LayoutFlexItems(true, layout_scope);
......
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