scroll anchoring breaks devtools |
||||||||||||
Issue descriptionTested with trunk build on Linux. Open dev tools, console tab, make the window smallish, generate enough output to scroll, e.g. > for (var i = 0; i < 100; i++) console.log(i); Try to scroll down. The scroll position is continually reset to the top. Works fine with scroll anchoring disabled.
,
Jul 18 2016
,
Jul 19 2016
,
Jul 21 2016
This layout test is failing with ScrollAnchoring and looks related to this bug and may help in debugging it. https://cs.chromium.org/chromium/src/third_party/WebKit/LayoutTests/inspector/console/console-viewport-selection.html
,
Aug 17 2016
,
Aug 17 2016
There are two problems with scroll anchoring in dev tools, both of which affect both the console and the source viewer. (1) Scrollers inside flex boxes have LayoutBlock::layout called multiple times in a single layout pass. During the intermediate layouts, the scroll bounds haven't settled yet. ScrollAnchor::restore will clamp when it adjusts, so we need to defer restore() in the same way that we defer post-layout clamping with DelayScrollPositionClampScope. (2) WebInspector.ViewportControl implements a "virtual" viewport by rendering only the visible content, with spacers above and below (_topGapElement and _bottomGapElement). These spacers shrink and grow as you scroll, creating a feedback loop when we anchor to the bottom gap element. I have a patch up at http://crrev.com/2220133002 for (1). I believe (2) requires SANACLAP ( issue 637626 ).
,
Aug 17 2016
,
Aug 17 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/0cd0e9c225f682449743476969ced1ab51e6b1eb commit 0cd0e9c225f682449743476969ced1ab51e6b1eb Author: skobes <skobes@chromium.org> Date: Wed Aug 17 04:40:11 2016 Don't restore in LayoutBlock::layout if clamping is delayed. BUG= 624534 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Review-Url: https://codereview.chromium.org/2220133002 Cr-Commit-Position: refs/heads/master@{#412450} [modify] https://crrev.com/0cd0e9c225f682449743476969ced1ab51e6b1eb/third_party/WebKit/Source/core/layout/LayoutBlock.cpp [modify] https://crrev.com/0cd0e9c225f682449743476969ced1ab51e6b1eb/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp [modify] https://crrev.com/0cd0e9c225f682449743476969ced1ab51e6b1eb/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
,
Aug 17 2016
,
Aug 17 2016
,
Sep 6 2016
,
Sep 7 2016
I think http://crrev.com/2220133002 doesn't fix this bug in entirety. I still see some adjustments in ScrollAnchor::restore. Here's the stack for these calls: #1 0x7f12d48178f4 blink::ScrollAnchor::restore() #2 0x7f12d46bfd6a blink::PaintLayerScrollableArea::clampScrollPositionsAfterLayout() #3 0x7f12d46c4a58 blink::PaintLayerScrollableArea::DelayScrollPositionClampScope::~DelayScrollPositionClampScope() #4 0x7f12d4779797 blink::LayoutFlexibleBox::layoutBlock() #5 0x7f12d47286ab blink::LayoutBlock::layout() #6 0x7f12d4729eb3 blink::LayoutBlock::layoutPositionedObjects() #7 0x7f12d472967c blink::LayoutBlock::simplifiedLayout() #8 0x7f12d47338b6 blink::LayoutBlockFlow::layoutBlock() #9 0x7f12d47286ab blink::LayoutBlock::layout() It looks like we're "delayed" restoring. I found this because these tests are still failing with scroll anchoring: inspector/console/console-viewport-selection.html inspector/console/console-viewport-stick-to-bottom.html Re-opening.
,
Sep 9 2016
The failure in console-viewport-stick-to-bottom.html is straightforward. This test does the following: 1. scroll to the bottom 2. disable automatic scroll-to-bottom mode 3. grow an element above the viewport 4. assert that we aren't at the bottom anymore The assertion in step 4 fails as a result of scroll anchoring behaving exactly as intended. The fix is to change step 3 to grow an element after the anchor node. This preserves the intent of the test to verify the effects of step 2. The failure in console-viewport-selection.html is more subtle. First, some background: the console scroller has three important DOM children: [_topGapElement, _contentElement, _bottomGapElement]. The visible items are all inside the content element. ViewportControl "pins" the content element to the viewport by resizing the gap elements, and is conservative with DOM operations inside the content element as it scrolls - pushing and popping from the start/end of its childNodes rather than rebuilding it. SANACLAP eliminates a feedback loop from anchoring to the bottom gap element after a programmatic scroll, which was breaking console-viewport-selection.html, but it applies no suppression when we anchor to persistent visible log items inside the content element. In theory this is ok: both ViewportControl and ScrollAnchor are trying to preserve the item's position in scrolling-content-space. But ViewportControl achieves this goal imperfectly, because it resizes the top gap element based on an estimate of log item height (in ConsoleViewMessage.fastHeight) which is off by 1px for single-line plain text log entries. So when you scroll down, the visible items actually move in scrolling-content-space by a distance equal to the total height estimation error, generally 1px for each item that has left the viewport. ScrollAnchor then "corrects" the error introduced by ViewportControl's inaccurate height estimate. The difference is not noticeable to the user, but it produces an off-by-one diff in the output of console-viewport-selection.html. The test can be made to pass by improving the height estimate. Based on the above I believe no changes are needed in the scroll anchoring code. Pending fix for both issues in http://crrev.com/2317343006.
,
Sep 14 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/9f69ce15656df3f06add00f591f68e36348027f6 commit 9f69ce15656df3f06add00f591f68e36348027f6 Author: skobes <skobes@chromium.org> Date: Wed Sep 14 21:30:33 2016 Fix console viewport test failures with scroll anchoring. Update defaultConsoleRowHeight to account for the 1px border, and grow a visible item instead of an offscreen one when testing setStickToBottom. See bug for detailed analysis. BUG= 624534 Review-Url: https://codereview.chromium.org/2317343006 Cr-Commit-Position: refs/heads/master@{#418681} [modify] https://crrev.com/9f69ce15656df3f06add00f591f68e36348027f6/third_party/WebKit/LayoutTests/inspector/console/console-viewport-stick-to-bottom.html [modify] https://crrev.com/9f69ce15656df3f06add00f591f68e36348027f6/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js
,
Sep 14 2016
,
Sep 16 2016
,
Sep 21 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/2d42a22c81372bb8f3ffb685ad6c66bcb205a3a5 commit 2d42a22c81372bb8f3ffb685ad6c66bcb205a3a5 Author: luoe <luoe@chromium.org> Date: Wed Sep 21 18:22:27 2016 Remove console viewport test from expectations after fix When scroll anchoring was promoted to experimental status, it broke viewport related LayoutTests, so expectations were updated for their failure. Now that the tests have been fixed, the expectations need to be updated. Promotion CL: https://codereview.chromium.org/2291653002 Tests fixed CL: https://codereview.chromium.org/2317343006 BUG= 624534 Review-Url: https://codereview.chromium.org/2357783002 Cr-Commit-Position: refs/heads/master@{#420110} [modify] https://crrev.com/2d42a22c81372bb8f3ffb685ad6c66bcb205a3a5/third_party/WebKit/LayoutTests/TestExpectations
,
Sep 21 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/0dc0f9e069272c917c85232446074b2719013377 commit 0dc0f9e069272c917c85232446074b2719013377 Author: dewittj <dewittj@chromium.org> Date: Wed Sep 21 19:25:48 2016 Revert of Remove console viewport test from expectations after fix (patchset #1 id:1 of https://codereview.chromium.org/2357783002/ ) Reason for revert: console-viewport-selection.html is still failing: https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Linux/builds/70720 Original issue's description: > Remove console viewport test from expectations after fix > > When scroll anchoring was promoted to experimental status, it broke viewport > related LayoutTests, so expectations were updated for their failure. Now that > the tests have been fixed, the expectations need to be updated. > > Promotion CL: > https://codereview.chromium.org/2291653002 > > Tests fixed CL: > https://codereview.chromium.org/2317343006 > > BUG= 624534 > > Committed: https://crrev.com/2d42a22c81372bb8f3ffb685ad6c66bcb205a3a5 > Cr-Commit-Position: refs/heads/master@{#420110} TBR=skobes@chromium.org,ymalik@chromium.org,lushnikov@chromium.org,luoe@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG= 624534 Review-Url: https://codereview.chromium.org/2356263003 Cr-Commit-Position: refs/heads/master@{#420134} [modify] https://crrev.com/0dc0f9e069272c917c85232446074b2719013377/third_party/WebKit/LayoutTests/TestExpectations |
||||||||||||
►
Sign in to add a comment |
||||||||||||
Comment 1 by skobes@chromium.org
, Jun 30 2016