Bug 170982

Summary: Implement the VisualViewport API (visual viewport)
Product: WebKit Reporter: Rick Byers <rbyers>
Component: DOMAssignee: Ali Juma <ajuma>
Status: RESOLVED FIXED    
Severity: Normal CC: ajuma, bokan, cdumez, dbates, fred.wang, kngan, mjs, moplam, rbuis, rniwa, sam.saffron, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 10   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=170981
https://bugs.webkit.org/show_bug.cgi?id=179794
https://bugs.webkit.org/show_bug.cgi?id=197211
Bug Depends on: 179385, 179386, 179818, 181548, 181689, 193376, 193475, 193798, 197387    
Bug Blocks:    

Description Rick Byers 2017-04-19 01:03:11 PDT
After the fix for bug 170981 it becomes impossible for a page to tell when the visual viewport changes (eg. user has pinch-zoomed, OSK is displayed).  There are a few rare use cases where this is really desirable.  For example when composing a tweet on twitter.com in Chrome the toolbar (add picture, location, characters left, etc.) sticks just above the keyboard.  On Safari Twitter uses a worse UI where the add picture button is just at the bottom of the text, and the characters left is at the top right.

To address these use cases we propose the VisualViewport API: https://github.com/wicg/viewportapi

What do WebKit folks think about the use case here, potentially worth solving?

Regardless of whether the use case seems worth solving at the moment, does the VisualViewport API seem like a reasonable design?
Comment 1 Radar WebKit Bug Importer 2017-04-19 01:08:42 PDT
<rdar://problem/31702305>
Comment 2 Simon Fraser (smfr) 2017-04-19 01:14:26 PDT
The API seems reasonable to me.
Comment 3 Frédéric Wang (:fredw) 2017-11-15 07:59:00 PST
Maybe these developments should be announced on WebKit dev? I only see two messages about visual viewports: 

https://lists.webkit.org/pipermail/webkit-dev/2016-December/028542.html
https://lists.webkit.org/pipermail/webkit-dev/2017-January/028617.html
Comment 4 Ali Juma 2017-11-16 07:42:15 PST
(In reply to Frédéric Wang (:fredw) from comment #3)
> Maybe these developments should be announced on WebKit dev? I only see two
> messages about visual viewports: 
> 
> https://lists.webkit.org/pipermail/webkit-dev/2016-December/028542.html
> https://lists.webkit.org/pipermail/webkit-dev/2017-January/028617.html

Good idea, I sent a message to webkit-dev:
https://lists.webkit.org/pipermail/webkit-dev/2017-November/029751.html
Comment 5 Maciej Stachowiak 2017-11-16 16:37:03 PST
Please make sure to have an experimental feature flag, ideally runtime rather than compile time. (Maybe you already did this, I only briefly skimmed the patches in the subtask bugs.)
Comment 6 Ali Juma 2017-11-16 16:43:04 PST
(In reply to Maciej Stachowiak from comment #5)
> Please make sure to have an experimental feature flag, ideally runtime
> rather than compile time. (Maybe you already did this, I only briefly
> skimmed the patches in the subtask bugs.)

Yes, the patch in bug 179385 adds a runtime experimental feature flag for this.
Comment 7 Ryosuke Niwa 2019-01-29 20:51:43 PST
The feature has been implemented. The remaining test failures are tracked by https://bugs.webkit.org/show_bug.cgi?id=179794, and the change to make zooming invisible is tracked by https://bugs.webkit.org/show_bug.cgi?id=170981
Comment 8 Ryosuke Niwa 2019-03-09 19:34:25 PST
*** Bug 176205 has been marked as a duplicate of this bug. ***