Bug 131618

Summary: [WK2 iOS] Scrolling to anchor links is broken
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: New BugsAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, bdakin, benjamin, berto, bunhere, cgarcia, cmarcelo, commit-queue, gustavo, jamesr, luiz, mrobinson, noam, sergio, simon.fraser, thorton, tonikitoo, zeno
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch thorton: review+

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.