New issue
Advanced search Search tips

Issue 692701 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 2
Type: Bug



Sign in to add a comment

[scroll anchoring] anchor selection ignores abs-pos container

Project Member Reported by skobes@chromium.org, Feb 15 2017

Issue description

Reproduced on desktop Linux ToT.

1. Visit http://usuncut.com/climate/epa-terminate/
2. While the page is loading, scroll down until the giant image overlaps the top of the viewport
3. Observe a jump when the ad loads

ScrollAnchor should be anchoring to the image and performing an adjustment.

It looks like the <html> element is reporting a layout overflow rect of height == 0.
 

Comment 1 by skobes@chromium.org, Feb 15 2017

Summary: [scroll anchoring] anchor selection ignores abs-pos container (was: [scroll anchoring] no adjustment on usuncut.com)
It looks like findAnchor will generally fail to descend into position: absolute containers.

This is because an abs-pos element doesn't contribute to the layout overflow rect of a static DOM parent.  It instead contributes to the layout overflow rect of its containing block, which may be higher in the DOM.

Minimized repro: https://output.jsbin.com/tigosel

Comment 2 by skobes@chromium.org, Mar 13 2017

Patch up: http://crrev.com/2741853006
Project Member

Comment 3 by bugdroid1@chromium.org, Mar 14 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/eeb280562292e14bdfc3dfa494f6599a1d43ae2b

commit eeb280562292e14bdfc3dfa494f6599a1d43ae2b
Author: skobes <skobes@chromium.org>
Date: Tue Mar 14 02:14:25 2017

Fix ScrollAnchor descent into absolute-positioned containers.

If the normal DOM walk yields nothing, examine the positioned descendants that
were skipped due to their DOM parents being offscreen.

BUG= 692701 

Review-Url: https://codereview.chromium.org/2741853006
Cr-Commit-Position: refs/heads/master@{#456575}

[modify] https://crrev.com/eeb280562292e14bdfc3dfa494f6599a1d43ae2b/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp
[modify] https://crrev.com/eeb280562292e14bdfc3dfa494f6599a1d43ae2b/third_party/WebKit/Source/core/layout/ScrollAnchor.h
[modify] https://crrev.com/eeb280562292e14bdfc3dfa494f6599a1d43ae2b/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp

Comment 4 by skobes@chromium.org, Mar 16 2017

Status: Fixed (was: Started)
Verified in canary (59.0.3042.0).

Sign in to add a comment