Bug 135187 - [iOS][WK2] r171124 is incorrect when the virtual keyboard is up
Summary: [iOS][WK2] r171124 is incorrect when the virtual keyboard is up
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:
Depends on:
Blocks:
 
Reported: 2014-07-22 20:11 PDT by Benjamin Poulain
Modified: 2014-07-23 22:02 PDT (History)
0 users

See Also:


Attachments
Patch (6.83 KB, patch)
2014-07-22 20:37 PDT, Benjamin Poulain
simon.fraser: 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-22 20:11:38 PDT
[iOS][WK2] r171124 is incorrect when the virtual keyboard is up
Comment 1 Benjamin Poulain 2014-07-22 20:37:24 PDT
Created attachment 235339 [details]
Patch
Comment 2 Simon Fraser (smfr) 2014-07-22 22:33:33 PDT
Comment on attachment 235339 [details]
Patch

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

> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:803
> +    CGFloat maxHorizontalOffset = contentSize.width + contentInsets.right - scrollViewSize.width;
> +    if (contentOffset.x > maxHorizontalOffset)
> +        contentOffset.x = maxHorizontalOffset;
> +    CGFloat maxVerticalOffset = contentSize.height + contentInsets.bottom - scrollViewSize.height;
> +    if (contentOffset.y > maxVerticalOffset)
> +        contentOffset.y = maxVerticalOffset;
> +    if (contentOffset.x < -contentInsets.left)
> +        contentOffset.x = -contentInsets.left;
> +    if (contentOffset.y < -contentInsets.top)
> +        contentOffset.y = -contentInsets.top;
> +    return contentOffset;

std::min()/std::max()?
Comment 3 Benjamin Poulain 2014-07-23 22:02:42 PDT
Committed r171507: <http://trac.webkit.org/changeset/171507>