Commit 4d296061 authored by Ian Kilpatrick's avatar Ian Kilpatrick Committed by Commit Bot

[FlexNG] Delay scroll offset clamping.

Fixes:
http/tests/devtools/console/console-focus.js
http/tests/devtools/console/console-preserve-scroll.js

Typically clamping happens after layout of a box. However flexbox
introduces multiple layout passes, and due to this scrolloffsets can
get clamped to incorrect values, losing the scroll position.

Bug: 	845235
Change-Id: Ia7a84be1ff2158232cc3867fc3eff997a29122f7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2031674Reviewed-by: default avatarDavid Grogan <dgrogan@chromium.org>
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#737153}
parent d79e14c0
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include "third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part.h" #include "third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part.h"
#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h"
#include "third_party/blink/renderer/core/layout/ng/ng_space_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_space_utils.h"
#include "third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h"
#include "third_party/blink/renderer/platform/wtf/vector.h" #include "third_party/blink/renderer/platform/wtf/vector.h"
namespace blink { namespace blink {
...@@ -614,6 +615,7 @@ NGFlexLayoutAlgorithm::AdjustChildSizeForAspectRatioCrossAxisMinAndMax( ...@@ -614,6 +615,7 @@ NGFlexLayoutAlgorithm::AdjustChildSizeForAspectRatioCrossAxisMinAndMax(
} }
scoped_refptr<const NGLayoutResult> NGFlexLayoutAlgorithm::Layout() { scoped_refptr<const NGLayoutResult> NGFlexLayoutAlgorithm::Layout() {
PaintLayerScrollableArea::DelayScrollOffsetClampScope delay_clamp_scope;
ConstructAndAppendFlexItems(); ConstructAndAppendFlexItems();
LayoutUnit main_axis_start_offset; LayoutUnit main_axis_start_offset;
......
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