Bug 181741

Summary: Element with position:fixed stops scrolling at the bottom of the page, but is painted in the right place on Chacos.com.
Product: WebKit Reporter: Stephanie Poll <stephanie.poll>
Component: New BugsAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, simon.fraser, thorton, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar, PlatformOnly
Version: Safari 11   
Hardware: iPhone / iPad   
OS: iOS 11   
URL: http://www.chacos.com/US/en/home
See Also: https://bugs.webkit.org/show_bug.cgi?id=182052
Attachments:
Description Flags
A screenshot of what happens when hovering over the element in the safari web inspector.
none
Reduction
none
Patch none

Description Stephanie Poll 2018-01-17 07:01:59 PST
Created attachment 331492 [details]
A screenshot of what happens when hovering over the element in the safari web inspector.

If you scroll to the very bottom of the URL on an iPhone, the fixed top/chat buttons on the side stop moving down with the page, but continue to be painted in the correct place. This happens about 40 pixels from the actual bottom. This causes the click area to be shoved above where the elements appear to be. While scrolling, the element is in the correct position, but after scrolling stops, the element will jump above where it appears to be painted. For visual reference, please see the attached screenshot or watch the video at this link: https://www.screencast.com/t/dDzlXxSIZ
Comment 1 Simon Fraser (smfr) 2018-01-17 12:54:07 PST
I can reproduce.
Comment 2 Radar WebKit Bug Importer 2018-01-17 12:54:28 PST
<rdar://problem/36593581>
Comment 3 Simon Fraser (smfr) 2018-01-17 16:06:53 PST
Created attachment 331553 [details]
Reduction

Seems to happen on pages that have a viewport meta tag that triggers scaling. I'm surprised this is such a basic failure :(
Comment 4 Simon Fraser (smfr) 2018-01-17 18:46:19 PST
So this issue happens when the minimum scale is > 1. FrameView::visualViewportRect() returns a visual viewport that's too big (larger than the document) because it assumes that it can scale the visible rect by the scale (~1.3 on this page).
Comment 5 Simon Fraser (smfr) 2018-01-17 19:04:41 PST
The iOS-only code in FrameView::unscaledMaximumScrollPosition() looks suspicious.
Comment 6 Simon Fraser (smfr) 2018-01-17 19:05:42 PST
Bug 174648 is relevant.
Comment 7 Simon Fraser (smfr) 2018-01-22 13:00:58 PST
Created attachment 331953 [details]
Patch
Comment 8 WebKit Commit Bot 2018-01-23 12:11:15 PST
Comment on attachment 331953 [details]
Patch

Clearing flags on attachment: 331953

Committed r227430: <https://trac.webkit.org/changeset/227430>
Comment 9 WebKit Commit Bot 2018-01-23 12:11:17 PST
All reviewed patches have been landed.  Closing bug.