Bug 134952 - [iOS][WK2] Scrolling request from the scrolling tree must be limited to offsets in the document
Summary: [iOS][WK2] Scrolling request from the scrolling tree must be limited to offse...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Benjamin Poulain
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-07-15 16:29 PDT by Benjamin Poulain
Modified: 2014-07-15 17:20 PDT (History)
2 users (show)

See Also:


Attachments
Patch (6.55 KB, patch)
2014-07-15 16:56 PDT, Benjamin Poulain
enrica: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Poulain 2014-07-15 16:29:19 PDT
[iOS][WK2] Scrolling request from the scrolling tree must be limited to offsets in the document
Comment 1 Benjamin Poulain 2014-07-15 16:56:26 PDT
Created attachment 234965 [details]
Patch
Comment 2 Benjamin Poulain 2014-07-15 16:58:06 PDT
<rdar://problem/17647116>
Comment 3 Enrica Casucci 2014-07-15 17:00:48 PDT
Comment on attachment 234965 [details]
Patch

Looks reasonable to me.
Comment 4 Simon Fraser (smfr) 2014-07-15 17:01:54 PDT
Comment on attachment 234965 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=234965&action=review

> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:1001
> +    if (contentOffsetInDocument.x() > maximumHorizontalOffset)
> +        contentOffsetInDocument.setX(maximumHorizontalOffset);
> +    if (contentOffsetInDocument.x() < 0)
> +        contentOffsetInDocument.setX(0);

Maybe something with std::min(std::max(x, 0), max)?

> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:1010
> +    CGPoint adjustedContentOffset = [self _adjustedContentOffset:contentOffsetInDocument];

Blank line above this please.
Comment 5 Benjamin Poulain 2014-07-15 17:20:24 PDT
Committed r171124: <http://trac.webkit.org/changeset/171124>