DescriptionFix scrollIntoViewIfNeeded when scroll box has no height or width.
When calling scrollIntoView with a centering behavior (e.g.
scrollIntoViewIfNeeded and focus-initiated scrollIntoView) on a scroll
box with no height or width the current behavior is to not scroll the
box and call scrollIntoView with the same rect to the next ancestor box.
This is clearly wrong since we won't scroll the rect into view of the
child box so the ancestor box will try to scrollIntoView a rect that
might be outside its visible rect, even though the child box is within
it. This is the surprising behavior seen in the bug; focus() is called
on an element inside a scroller with zero height and large scrollTop
which causes the main frame to scroll up instead of the scroller.
The fix in this CL is to give a box with a zero width or height a
minimum size. This means we'll scroll the content "into view" as if the
box were just very small in that dimension. This matches the behavior in
Firefox. It also prevents surprising scrolls in ancestor boxes.
BUG=585368
Committed: https://crrev.com/2e27d335ad7b6aa54d71f3f1259649909b4c4387
Cr-Commit-Position: refs/heads/master@{#385579}
Patch Set 1 #Patch Set 2 : Fixed broken composition test #
Messages
Total messages: 22 (10 generated)
|