[iOS WK2] Don't disable position:fixed when a form element has focus
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Dec 2016 19:19:51 +0000 (19:19 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Dec 2016 19:19:51 +0000 (19:19 +0000)
commit6435c28992ea7161dd09b0b419d60201923aafe6
tree9839dc59ca4f74473931dd3c43c6a352d7d18652
parentf90f88799cc2e56a599ff7e9a3176f51f8109b4b
[iOS WK2] Don't disable position:fixed when a form element has focus
https://bugs.webkit.org/show_bug.cgi?id=165891
rdar://problem/29271694

Reviewed by Wenson Hsieh.

Source/WebKit2:

Before visual viewports, we had to lay out position:fixed relative to the document rect (effectively
disabling position:fixed) when a form element was focused, to ensure that we could scroll to inputs
inside position:Fixed.

When visual viewports are enabled, we can do a better job of this, and keep position:fixed active.

Test: fast/visual-viewport/ios/zoomed-focus-in-fixed.html

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]): Soon this will use
insideFixed to have better scroll-into-view behavior.
(-[WKWebView _zoomToFocusRect:selectionRect:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]): Deleted.
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/ios/WKContentView.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
(-[WKContentView _zoomToFocusRect:selectionRect:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]): Deleted.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _displayFormNodeInputView]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::computeCustomFixedPositionRect): Don't fall back to using the documentRect as the fixed
position rect if visual viewports are enabled.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getAssistedNodeInformation): Don't reset the customtFixedPositionRect around computing element
coordinates if visual viewports are enabled.

LayoutTests:

* TestExpectations:
* fast/visual-viewport/ios/zoomed-focus-in-fixed-expected.txt: Added.
* fast/visual-viewport/ios/zoomed-focus-in-fixed.html: Added.
* platform/ios-simulator-wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209867 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/fast/visual-viewport/ios/zoomed-focus-in-fixed-expected.txt [new file with mode: 0644]
LayoutTests/fast/visual-viewport/ios/zoomed-focus-in-fixed.html [new file with mode: 0644]
LayoutTests/platform/ios-simulator-wk2/TestExpectations
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h
Source/WebKit2/UIProcess/ios/WKContentView.h
Source/WebKit2/UIProcess/ios/WKContentView.mm
Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm
Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm
Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm