Add SPI to expose width and height anchors for WKWebView's content view
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Mar 2018 23:56:53 +0000 (23:56 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Mar 2018 23:56:53 +0000 (23:56 +0000)
commitd3cb4d6e94a44f5c3765047b6d3222d97cc227e4
tree76598bca0ce5d3f7a5c1d089928c172701fc4618
parent2a8259c009629f98a626d591c59b3f36190b92b2
Add SPI to expose width and height anchors for WKWebView's content view
https://bugs.webkit.org/show_bug.cgi?id=183711
<rdar://problem/38562899>

Reviewed by Tim Horton.

Source/WebKit:

Add _contentWidthAnchor and _contentHeightAnchor SPI to WKWebView for internal clients to be able to reason
about the size of the content view on iOS using autolayout.

Test: WebKit.AutoLayoutPositionHeaderAndFooterViewsInScrollView.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _contentWidthAnchor]):
(-[WKWebView _contentHeightAnchor]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:

Tools:

Adds an API test exercising the new SPI.

* TestWebKitAPI/Tests/WebKitCocoa/AutoLayoutIntegration.mm:
(checkCGRect):
(TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229688 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKitCocoa/AutoLayoutIntegration.mm