Summary: | Provide delegate SPI for clients to notify WebKit about content inset changes | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Brent Fulgham <bfulgham> | ||||||
Component: | WebKit2 | Assignee: | Brent Fulgham <bfulgham> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | andersca, bfulgham, sam, webkit-bug-importer | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Brent Fulgham
2015-06-30 17:26:45 PDT
Created attachment 255883 [details]
Patch
Comment on attachment 255883 [details]
Patch
Given the limited use case, this should start as SPI on WKUIDelegatePrivate.h
Created attachment 256015 [details]
Patch
Comment on attachment 256015 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=256015&action=review > Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:1474 > + UIEdgeInsets contentInset = [self _computedContentInset]; > + > + id<WKUIDelegatePrivate> uiDelegatePrivate = static_cast<id <WKUIDelegatePrivate>>([self UIDelegate]); > + if ([uiDelegatePrivate respondsToSelector:@selector(_webView:finalObscuredInsetsForScrollView:withVelocity:targetContentOffset:)]) > + contentInset = [uiDelegatePrivate _webView:self finalObscuredInsetsForScrollView:scrollView withVelocity:velocity targetContentOffset:targetContentOffset]; Would be better to use else so we don’t unnecessarily call _computedContentInset every time. Comment on attachment 256015 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=256015&action=review >> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:1474 >> + contentInset = [uiDelegatePrivate _webView:self finalObscuredInsetsForScrollView:scrollView withVelocity:velocity targetContentOffset:targetContentOffset]; > > Would be better to use else so we don’t unnecessarily call _computedContentInset every time. Good idea! Will do. Committed r186237: <http://trac.webkit.org/changeset/186237> |