VisualViewport API should be updated upon opening of keyboard
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Jan 2019 03:35:59 +0000 (03:35 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Jan 2019 03:35:59 +0000 (03:35 +0000)
commitd233d92d6820399edca5117d1932e6ea9a2f535f
tree9f8791e37dbb3621ae5c2f00f8026a0f24a20dc9
parent99beb3fde722f29d9d05a2913b743cf10c94f249
VisualViewport API should be updated upon opening of keyboard
https://bugs.webkit.org/show_bug.cgi?id=193475

Reviewed by Simon Fraser.

Source/WebCore:

Added a function to update the visual viewport API and schedule a resize event to FrameView.

Test: fast/visual-viewport/ios/resize-event-for-keyboard.html

* page/FrameView.cpp:
(WebCore::FrameView::didUpdateViewportOverrideRects):
* page/FrameView.h:

Source/WebKit:

The bug was caused by the changes to unobscuredContentRectRespectingInputViewBounds not updating the visual viewport
unless it caused a layout to happen. Added a code to update the visual viewport in WebPage::updateVisibleContentRects.

Also fixed the bug that VisibleContentRectUpdateInfo::operator== was not checking differences in
unobscuredContentRectRespectingInputViewBounds which resulted in the visual viewport override not getting updated
while the keyboard is getting brought up.

* Shared/VisibleContentRectUpdateInfo.h:
(WebKit::operator==):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::updateVisibleContentRects):

LayoutTests:

Added a regression test.

* fast/visual-viewport/ios/resize-event-for-keyboard-expected.txt: Added.
* fast/visual-viewport/ios/resize-event-for-keyboard.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240027 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/visual-viewport/ios/resize-event-for-keyboard-expected.txt [new file with mode: 0644]
LayoutTests/fast/visual-viewport/ios/resize-event-for-keyboard.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/FrameView.h
Source/WebKit/ChangeLog
Source/WebKit/Shared/VisibleContentRectUpdateInfo.h
Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm