Bug 174902 - Incorrect scroll position when using a overflow auto and non-overlay scrollbars
Summary: Incorrect scroll position when using a overflow auto and non-overlay scrollbars
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-07-27 10:05 PDT by Carlos Garcia Campos
Modified: 2020-04-10 05:58 PDT (History)
7 users (show)

See Also:


Attachments
Test case (409 bytes, text/html)
2017-07-27 10:05 PDT, Carlos Garcia Campos
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2017-07-27 10:05:25 PDT
Created attachment 316553 [details]
Test case

I've noticed this with the attached file, that is used in selenium WebDriver tests (I modified it only to do scrollIntoView on load). In GTK+ port loading the test with non-overlay scrollbars the link ends up under the horizontal scrollbar. When using the Mac MiniBroeser, the links is at the right position on load, but just resizing the window a little makes it disappear. This is because in the case of GTK+, for some reason, after the RenderLayer::scrollTo() that uses the right offset, there's another layout, that causes the main frame contents size to be recalculated and then a second RenderLayer::scrollTo() is called now with the wrong offset. In the case of Mac, resizing the window causes the second layout needed to trigger the bug. The problem seems to be that the first time the frame view contents size doesn't take into account the scrollbars space, and then the offset needed to make the link visible is correct. But after the scrollbars are shown, the frame view contents size is updated taking into account the scrollbars space making it fit into the full visible area. That causes the scrollbars to be destroyed, so when the scroll offset is calculated again, there aren't scrollbars and the offset we get is without the scrollbars. At some point the contents size is updated again, and the scrollbars are added again.
Comment 1 Carlos Garcia Campos 2017-07-27 10:10:18 PDT
I don't know if it would be possible to detect that scrollbars will always be used in that particular case.
Comment 2 Diego Pino 2020-04-10 05:58:01 PDT
There was only one test (imported/selenium/py/test/selenium/webdriver/common/click_scrolling_tests.py:testShouldBeAbleToClickOnAnElementHiddenByDoubleOverflow) referring this bug in WebDriver/TestExpectations.json. The entry was deleted as part of https://trac.webkit.org/changeset/259791/webkit, since the test was passing.

Closing bug.
Comment 3 Radar WebKit Bug Importer 2020-04-10 05:58:19 PDT
<rdar://problem/61580604>