scrollIntoView() scrolls unnecessary elements |
||||||
Issue description
Version: 50 stable and 52 canary
OS: Maybe all
What steps will reproduce the problem?
(1) Load the following HTML
(2) Observe
<!DOCTYPE html>
<body>
A red box should not appear.
<input style="background:gray; width:200px;" autofocus onfocus="document.getElementById('t').scrollIntoView()">
<div style="overflow:scroll; background:#8cf; height:202px; positin:relative">
<div style="border:1px solid white; height:200px;"></div>
<div style="background:red; height:200px;"></div>
<div id=t tabindex=0 style="background:lime; position:absolute; top:400px;">foo</div>
</div>
</body>
What is the expected output?
No red box.
What do you see instead?
There is a red box because the parent element of position:absolute was scrolled unnecessarily.
Please use labels and text to provide additional information.
Safari Preview: NG
Firefox: OK
Edge: OK
This issue was found on investigating Issue 601341 .
,
Apr 28 2016
Note that "positin:relative" in the first DIV is not wrong. The intention is it has no position:relative.
,
Apr 28 2016
,
Apr 28 2016
Repro case posted to bokan.ca/bugs/607380.html. Yup, this looks like a bug in LayoutBox::scrollRectToVisible, likely we calculate the parent incorrectly when calling enclosingScrollableBox.
,
May 1 2017
This issue has been available for more than 365 days, and should be re-evaluated. Please re-triage this issue. The Hotlist-Recharge-Cold label is applied for tracking purposes, and should not be removed after re-triaging the issue. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
May 1 2017
No longer reproduces in Chrome 58.0.3029.81. Closing old issue. |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by tkent@chromium.org
, Apr 28 2016Status: Started (was: Untriaged)