Bug 193475 - VisualViewport API should be updated upon opening of keyboard
Summary: VisualViewport API should be updated upon opening of keyboard
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords: InRadar
Depends on:
Blocks: 170982
  Show dependency treegraph
 
Reported: 2019-01-15 17:33 PST by Ryosuke Niwa
Modified: 2019-01-18 20:28 PST (History)
4 users (show)

See Also:


Attachments
Fixes the bug (9.54 KB, patch)
2019-01-15 17:46 PST, Ryosuke Niwa
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2019-01-15 17:33:01 PST
When the user had opened software keyboard, the visual viewport width & height should be updated
and resize event should be dispatched.
Comment 1 Ryosuke Niwa 2019-01-15 17:46:53 PST
Created attachment 359234 [details]
Fixes the bug
Comment 2 Simon Fraser (smfr) 2019-01-15 19:06:02 PST
Comment on attachment 359234 [details]
Fixes the bug

View in context: https://bugs.webkit.org/attachment.cgi?id=359234&action=review

> Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:3044
> +            frameView.didUpdateViewportOverrideRects();

Do we know that the visual viewport actually changed? Perhaps setVisualViewportOverrideRect() should return a bool and we only call this when it changes.
Comment 3 Ryosuke Niwa 2019-01-15 19:08:09 PST
(In reply to Simon Fraser (smfr) from comment #2)
> Comment on attachment 359234 [details]
> Fixes the bug
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=359234&action=review
> 
> > Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:3044
> > +            frameView.didUpdateViewportOverrideRects();
> 
> Do we know that the visual viewport actually changed? Perhaps
> setVisualViewportOverrideRect() should return a bool and we only call this
> when it changes.

VisualViewport::update checks whether the values had changed then schedule resize event, etc... only if the values had changed.
Comment 4 Ryosuke Niwa 2019-01-15 19:18:50 PST
Thanks for the review!
Comment 5 Radar WebKit Bug Importer 2019-01-15 19:19:41 PST
<rdar://problem/47305687>
Comment 6 Ryosuke Niwa 2019-01-15 19:36:02 PST
Committed r240027: <https://trac.webkit.org/changeset/240027>
Comment 7 Sam Weinig 2019-01-18 08:58:50 PST
Comment on attachment 359234 [details]
Fixes the bug

View in context: https://bugs.webkit.org/attachment.cgi?id=359234&action=review

> Source/WebCore/page/FrameView.h:596
> +#if PLATFORM(IOS_FAMILY)

Can we use a more fine grained #ifdef here? Perhaps something like #if SUPPORTS(VIEWPORTS) or something akin to that?
Comment 8 Ryosuke Niwa 2019-01-18 20:28:22 PST
(In reply to Sam Weinig from comment #7)
> Comment on attachment 359234 [details]
> Fixes the bug
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=359234&action=review
> 
> > Source/WebCore/page/FrameView.h:596
> > +#if PLATFORM(IOS_FAMILY)
> 
> Can we use a more fine grained #ifdef here? Perhaps something like #if
> SUPPORTS(VIEWPORTS) or something akin to that?

I think we can in theory but the code I'm adding is pretty specific to iOS, and as far as I can tell, no other port support this.