Bug 131618 - [WK2 iOS] Scrolling to anchor links is broken
Summary: [WK2 iOS] Scrolling to anchor links is broken
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: Simon Fraser (smfr)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-14 08:52 PDT by Simon Fraser (smfr)
Modified: 2014-04-14 13:26 PDT (History)
18 users (show)

See Also:


Attachments
Patch (17.99 KB, patch)
2014-04-14 08:57 PDT, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff
Patch (19.45 KB, patch)
2014-04-14 12:04 PDT, Simon Fraser (smfr)
thorton: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2014-04-14 08:52:07 PDT
[WK2 iOS] Scrolling to anchor links is broken
Comment 1 Simon Fraser (smfr) 2014-04-14 08:57:11 PDT
Created attachment 229285 [details]
Patch
Comment 2 Simon Fraser (smfr) 2014-04-14 12:04:57 PDT
Created attachment 229296 [details]
Patch
Comment 3 WebKit Commit Bot 2014-04-14 12:05:59 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 4 Tim Horton 2014-04-14 12:37:11 PDT
Comment on attachment 229296 [details]
Patch

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

> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:549
> +    WebCore::FloatPoint scaledOffset = contentOffset;

Can we have a better modifier than "scaled
Comment 5 Simon Fraser (smfr) 2014-04-14 12:50:54 PDT
https://trac.webkit.org/r167262
Comment 6 Benjamin Poulain 2014-04-14 13:26:47 PDT
Comment on attachment 229296 [details]
Patch

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

I would have preferred a unified scrolling code :(

> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:554
> +    UIEdgeInsets inset = [_scrollView contentInset];
> +    scaledOffset += WebCore::FloatSize(-inset.left, -inset.top);

The top-left is relative to the obscuredInsets, not the contentInsets.