#507: Virtual Keyboard API - boundaries of docked overlay keyboard

Visit on Github.

Opened Apr 21, 2020

Hello TAG!

I'm requesting a TAG review of VirtualKeyboard API .

The Virtual Keyboard (VK) is the on-screen keyboard used for input in scenarios where a hardware keyboard may not be available. Unlike a hardware keyboard, a VK can adapt its shape to optimize for the expected type of input. Authors have control over the displayed shape of the VK through the inputmode attribute, but have limited control over when the VK is shown or hidden. We propose a new VirtualKeyboard interface that has APIs to provide authors with more control over when the VK is shown or hidden and also exposes the size of the VK so the page can reflow its content if part of it is occluded by the VK.

Further details:

  • [X ] I have reviewed the TAG's API Design Principles
  • The group where the incubation/design work on this is being done (or is intended to be done in the future): Editing Task Force
  • The group where standardization of this work is intended to be done ("unknown" if not known): Editing Task Force
  • Existing major pieces of multi-stakeholder review or discussion of this design: https://github.com/w3c/editing/issues/225
  • Major unresolved issues with or opposition to this design: N/A
  • This work is being funded by: Microsoft

We'd prefer the TAG provide feedback as (please delete all but the desired option):

🐛 open issues in our GitHub repo for each point of feedback

Discussions

Discussed Apr 1, 2020 (See Github)

Ken: good, sensible idea...

Dan: should we do something different here to #498 - like maybe close this issue off?

Ken: it's a javascript api and you can only opt in via javascript... we have css environmental variables - why can't i do this from CSS? Instead of having to force people to use javascript? Very specific use case...

Comment by @kenchris Apr 21, 2020 (See Github)

I am positive over the new overlaysContent + inset idea (I have suggested similar myself before).

As using an inset doesn't require JavaScript, I am wondering whether there will be another way to set this in addition to a JavaScript only API?

"overlaygeometrychange" sounds quite generic, and as there can be other overlays (other application windows, modal dialogs, file pickers etc) that might be a bit confusing. Are the values flipped (or should they be) in a right-to-left layout?

The boundingRect is currently on the event itself, but it might make sense to additionally also have it on the virtualKeyboard object like the generic sensors do. Or maybe only have it there (@anssiko)

Comment by @BoCupp-Microsoft Apr 22, 2020 (See Github)

Are the values flipped (or should they be) in a right-to-left layout?

No they are not flipped. They are in client coordinates. I don't think they should be flipped as the location of the keyboard is not writing mode dependent.

Comment by @snianu Apr 22, 2020 (See Github)

As using an inset doesn't require JavaScript, I am wondering whether there will be another way to set this in addition to a JavaScript only API?

Do you mean the virtualKeyboard geometry? You do have to register for VK updates so there has to be JS involved anyways, but if there is a way to do this without JS, then I would love to hear it.

"overlaygeometrychange" sounds quite generic, and as there can be other overlays

We are open to suggestions on naming this event.

The boundingRect is currently on the event itself, but it might make sense to additionally also have it on the virtualKeyboard object like the generic sensors

This sounds good to me. I'll open an issue to make this change.

Comment by @kenchris Apr 22, 2020 (See Github)

Do you mean the virtualKeyboard geometry? You do have to register for VK updates so there has to be JS involved anyways, but if there is a way to do this without JS, then I would love to hear it.

The keyboard is docked so it should be possible to represent its position using CSS environmental variables, just like the window segments are with the CSS spanning proposal from Microsoft

Comment by @kenchris Apr 22, 2020 (See Github)

We are open to suggestions on naming this event.

If it only affect the virtual keyboard we could just call it virtualkeyboardgeometrychange - or just geometrychange if it is an even on the virtual keyboard object

Comment by @snianu Apr 23, 2020 (See Github)

The keyboard is docked so it should be possible to represent its position using CSS environmental variables, just like the window segments are with the CSS spanning proposal from Microsoft

Yes, this is definitely we can explore more and incorporate in VirtualKeyboard API. Thanks for clarifying.

If it only affect the virtual keyboard we could just call it virtualkeyboardgeometrychange - or just geometrychange if it is an even on the virtual keyboard object

geometrychange sounds good to me as this event is fired on the virtualkeyboard object.

Discussed May 1, 2020 (See Github)

Sangwhan: why does it have to be solved this way?

Ken: when the keyboard appears it resizes the viewport... working around that is relaly tough.. So you rather just want the keyboard to appear on top of the content and not resize... Plus if you have dual screen you also don't want it to resize on the other screen that makes no sense...

Sangwhan: ok

Ken: they did file issues... filed 3 days ago... They are still working on it. Maybe we should wait for them to ping us when they have an update...

Sangwhan: this does add entropy because of user-installable keyboards. Exposes info that wasn't exposed before.. could be problematic...

Dan: leave for now - let's mark it as pending editor update and bring it up at the plenary

Comment by @cynthia May 12, 2020 (See Github)

Simple question - does this potentially expose extra bits of entropy for fingerprinting over what is already out there? (window resizing)

Comment by @BoCupp-Microsoft May 13, 2020 (See Github)

@cynthia there's no new information to be queried that reveals any aspect of the user's machine or its configuration. I suppose the boundingRect exposed in the geometrychanged event will provide a width for the keyboard instead of just the height (which could already be inferred from APIs like Visual Viewport). That information is only available when the user interacts with the page in a way that requires text input. I don't think there is any new privacy concern with this API.

Comment by @alice May 28, 2020 (See Github)

Possibly silly question: if the point of geometrychange is simply to allow restyling certain elements in the page to accommodate the keyboard, would it be possible to provide the necessary constraints via CSS environment variables or similar, rather than fire a whole event?

e.g.

.search-box {
   bottom: env(safe-keyboard-inset);
}

I see there is some discussion above about an inset - did something change in this area?

What other actions might an author take in response to that event?

Comment by @cynthia May 28, 2020 (See Github)

So, @alice and I took a look at this during our VF2F and there is a huge meta-question about this in general - aside from the declarative bit noted by Alice above.

The proposal notifies web applications when something (in this case, a keyboard) obstructs the content, and communicates that through two scalar values (width/height). The meta-question is - this is simply something that defines content obstruction through a non-content entity, so why is namespaced in the virtual keyboard? There are multiple cases where such things can happen (e.g. picture-in-picture, browser chrome dialogs, etc) which could benefit from communicating this information back to the content.

Further questions:

  1. The geometry model assumes that the origin is fixed, and only has a single obstruction. How would it work for something like this? https://help.apple.com/assets/5E989062094622C539A9FD75/5E989065094622C539A9FD8A/en_US/d92415de0336bf743eb7c4b6d4540999.png
  2. Were multiple obstructions considered but insignificant or was that missed in the design?
  3. What would be a better namespace, if this is no longer scoped to virtual keyboards?

I might be digging the rabbit hole deeper than necessary, but I would like to hear your thoughts on this.

Comment by @cynthia May 28, 2020 (See Github)

@cynthia there's no new information to be queried that reveals any aspect of the user's machine or its configuration.

@BoCupp-Microsoft thank you for the clarification.

Comment by @BoCupp-Microsoft May 29, 2020 (See Github)

Hi @alice and @cynthia,

Thanks for your questions.

@alice, we're in support of using css environment variables but haven't written a proposal for it yet. @snianu, could you make an update to the explainer? Note we think the geometrychange event is necessary even if we have them since an author could want to scroll an element into view, which can't be done with CSS alone.

@cynthia regarding your meta-question, we don't believe that authors want to respond in the same way to all content obstructions. In the [explainer] (https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/master/VirtualKeyboardAPI/explainer.md) there are examples that position a searchbox above the keyboard. The searchbox should likely not be repositioned above a browser dialog or picture-in-picture UI. For that reason we want to explicitly describe changes in the visibility and position and size of the virtual keyboard.

Responses to your further questions below:

Regarding point 1, we propose that the author's ability to adjust the site in response to geometry changes for the virtual keyboard is limited to docked virtual keyboards. That prevents the site from trying to reposition its content while the user is trying to explicitly position the keyboard. In the image you referenced, I believe that is a floating keyboard. I don't think there's a docked version of it, is there?

Regarding point 2, related to the answer above, we don't have any known cases where docked keyboards result in multiple obstructions.

I do realize both of my answers to points 1 and 2 are basically dodging the question by claiming there aren't any current cases that require considering multiple obstructions. If we do decide we need to develop for that case, I think we could define the existing boundingRect property of the geometrychange event to be the rectangle that bounds all parts, and define an additional sequence of rects representing each part individually. I would expect sites developed against the current proposed API shape to behave well with a future docked, split keyboard, as there's no requirement to flow content through a split keyboard. And this future API extension would allow sites that want to be docked, split keyboard-aware to do something more complicated with the new rect sequence. So in short, we haven't designed for this case, but we see a clear path to solving that case if the need arises.

Regarding point 3, I think my answer to the meta question shows that we don't expect there to be one generalized API to handle all obstructions. If that was the approach we wanted to take then there is a Visual Viewport API which would be the best candidate.

Note the Virtual Keyboard API's relation to the the Visual Viewport API has been discussed here. I think at least @othermaciej feels differently, but my current thinking is that the API surface of the VirtualKeyboard interface is not limited to just describing the rectangle of how the feature intersects the content: there are hide and show APIs and a property that indicates whether the author has opted out of having the Visual Viewport resize when the virtual keyboard is shown. IMO its more natural to group these APIs together, under a namespace related to their common purpose, instead of putting APIs to control visibility on one interface, and events that generically describe change to the viewport geometry (that may not relate to the appearance of the virtual keyboard) on the Visual Viewport interface.

Hope that helps.

Comment by @snianu Jun 4, 2020 (See Github)

@alice, we're in support of using css environment variables but haven't written a proposal for it yet. @snianu, could you make an update to the explainer?

Added those details in the explainer and also addressed all the feedbacks.

Comment by @snianu Jun 15, 2020 (See Github)

Due to branch renaming in github, the new links for the explainer and security doc are: https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/VirtualKeyboardAPI/explainer.md https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/VirtualKeyboardPolicy/security-privacy.md

Discussed Jul 1, 2020 (See Github)

Sangwhan: multiple things that describe a viewport... one is generic .. not enough..

... 2 viewport APIs...

... one or the other should be deprecated ...

... two parties pushing similar things - one by MS and one by Goog - similar technologies...

... visual viewport work hasn't been updated...

... at least one implementer (Apple) has strongly come out against this proposal...

Dan: could we encourage the parties to come together? Maybe reference SMS receive API as a good example of this happening and creating something better and more widely implemented?

Sangwhan: will get in touch with Kenneth as well to discuss...

Discussed Jul 1, 2020 (See Github)

Ken: [updating explainers in issue]

Ken: they added some content to the explainer. Support for CSS environmental variables that we suggested.

Alice: Sangwhan [had commented] it wasn't using visual viewport. We talked about getting visual viewport and virtual keyboard folks talking to each other. [reviews latest comments] The overlaysContentProperty seems like a good thing to have. Less clear on what the geometry change event is for. With the example of the env variable setting the position of the search box and then the event repositions the search box but why would you bother with the code when you could use the env variable.

Ken: if you're using a canvas based approach then you would need the API. At lot of MS Office for example is using Canvas. That should be clarified.

Alice: Sangwhan's comment is asking for a more general solution - the response has been that they don't expect there to be a general API. This is a suite of features that all work together... Whether there should be a more general solution.. if there's not then an env variable is good to have... They are adding a virtual keyboard event in navigator. virtual keyboard namespace... now also an event target. Any other types of events?

Dan: does this fit together with "events are for notifications"? in design principles

Alice: I think this isn't violating that.

Alice: navigator.virtualkeyboard has one property which is an event listener that gets geometry change events ... why not just have the geometry available on that instead of having to get it from this event? I should be able to get the dimensions every time.

Ken: I think it should have. That is also how we did generic sensor API. The event just notifies that there is new data.

Sangwhan: [demos a virtual keyboard]

Alice: I think the event makes sense but the data should be available without the event.

Alice: Feedback: it would be nice if we could get the bounding rect of the virtual keyboard at any time.

Alice: you've got the virtual keyboard showing and you want to change the search box... you've got to store a copy of the width and height...

Ken: yes - if you want update it in every request animation frame because you're doing something with canvas then those dimensions might have been changed...

Alice: seems like it might be good to have a generic solution but probably shouldn't be their problem. Who's problem is it?

Sangwhan: picture-in-picture has a similar problem. Payment request as well.

Dan: Some browsers have a "scroll to top" button that brings user to the top of a page - which is overlaid on top of content.

Alice: So it's conceivable we need a general solution. Say we were to generalize this- the geometrychange event would make sense to generalize. So that would be a collection of "obstruction" rectangles. For each of those you would want to know when it changes... Then would you also want a CSS environment variable for each one? And would you want to generalize ...

Dan: could we push this to an existing working group?

Sangwhan: CSS might be interested... not sure how to make this work in CSS.

Alice: It's worth noting that there are specific examples that Sangwhan gave - a set of things that all have these properties of occluding the page. We feel like there should be a general solution - which means it's tricky to say "go ahead and ship this".

Sangwhan: my main concern is that there is a bunch of one-off geometry obstruction notifications. Also one last meta question about API surface. Keyboard is a member of navigator but should that be window? If you're in one tab and you switch to another then you won't have keyboard open any more... navigator feels overly global.

Ken: you have it on multiple screens then how's that gonna work? How does this tie together with screen enumeration API?

Alice: in the last example they give - it has 2 window segments - they keyboard pops up and they move the search box without checking which segment the window is on. So even their own example is weird. How could we help them?

Sangwhan: we could suggest - visual viewport.

Ken: with dual screens it's considered one viewport. If you have a different screen..

Sangwhan: or something completely new... Maybe this should be 2 specs rather than one. The obstructions should be a separate spec from keyboard.

Alice: yes - what is keyboard only?

Sangwhan: i think just geometry change should be generalised.

Alice: Not sure I agree. We've got a bunch of CSS variables that give you the same info as the bounding rect on the event that we think should be in it. In any case environment variables are going to be useful. You're going to need to get the bounds and when the geometry has changed. The only thing that doesn't need to be generalised is when the virtual keyboard changes the viewport height?

Dan: Could we just recommend they call it "interface overlay" instead of keyboard?

Ken: that makes it difficult to do with CSS variables... If you just want to position something where the keyboard is ...

Sangwhan: if you have a keyboard and PiP window and another payment request API popping up then the content should know about these. The separating of the keyboard into 2 is less important.

Alice: the nice thing about the API is that it does help with the split keyboard case... for example the map content appearing between keyboard areas... page content can flow behind.

Dan: next steps?

Alice: I think we can say that it does seem this is going to be a general problem. Shipping a specific solution to a general problem could cause problems down the road. They've identified the elements of a general solution. You need ways to know the geometry of the obstruction and you need to know when that changes. We think this will apply in other cases.

Sangwhan: anything that's browser chromish that could obstruct qualify.

Alice: they might want to reach out to visual viewport. Reach out to PiP to generalize this. Only challenge to generalize would be CSS properties. Could be a collection of objects that work the same as virtual keyboard. Final bit of feedback would be to be able to get the bounds at any time without having to save them from the event.

Alice: it's suspect to have it on navigator ... we're talking about generalizing this - could we generalize this as a pattern. For example window.virtualkeyboard.boundingrect window.virtualkeyboard.overlayscontent could we make that a pattern e.g. window.pictureinpicture.boundingrect etc... And get window.obstructions and it returns a list.

Sangwhan: [looks at PiP spec] PiP also has a resize event.

Alice: it's on us to go to the PiP folks and say 'you should give enough info as virtual keyboard does'.

Sangwhan: they don't have this.

Comment by @alice Jul 29, 2020 (See Github)

We talked about this in our meetings this week.

Firstly, in terms of the specifics of this API:

  • We would prefer if the bounding rect property lived on the virtualKeyboard object (as a "live" set of bounds), rather than requiring authors to capture it from the geometrychange event. Is there some reason this is infeasible or not desireable?
  • It would be helpful to illustrate when the geometrychange event would be more useful than the CSS environment variables - the existing example seems like it would be better handled by the CSS environment variables. @kenchris noted that canvas-based UIs would be one example of where you'd need to set a position directly.
  • Also, in that example it's not clear how the author knows that the search box is on the same side of the split-screen as the keyboard - could this be included in the example code?
  • We had some doubts as to whether navigator was the right place for the virtualKeyboard object to live, as opposed to window. What was the reasoning behind this choice?

Secondly, in terms of solving the general problem of informing the web page about occlusions, it does seem like VisualViewport is trying to solve some of the same problems, but is extremely limited (for example, it assumes the visual viewport is a rectangle).

I'm a little lost as to whether VisualViewport is intended to account for whether or not the virtual keyboard is overlaying page content or not - to me it reads as if it assumes the keyboard is overlaying page content, since otherwise it will be the same as the layout viewport.

These comments of Maciej's strike a chord:

I think Visual Viewport API could be enhanced to report individual overlay rects. That way, authors who want to adapt to available screen space won't have to juggle two different APIs. And we won't need to invent still other new APIs for other forms of onscreen overlays, like PIP, or the iPadOS Universal Callout Bar which appears even with a hardware keyboard attached.

Indeed, the "geometrychange" event is very similar to the "onresize" event on VisualViewport.

It would be a shame to miss an opportunity to design a general purpose API for these various types of screen occlusions. I wonder whether VisualViewport could contain a collection of objects with a common interface, of which virtualKeyboard could be one.

We would still need to figure out how to expose useful CSS environment variables for each one, or indeed if environment variables are the best way forward. I think the CSSWG may have some thoughts there.

Discussed Aug 1, 2020 (See Github)

Alice: I see they requested an issue for each point of feedback, so I filed a bunch of issues.

Comment by @kenchris Sep 22, 2020 (See Github)

Extending this to other types of occlusions might make sense, but I don't think we should extend it to any occlusion.

I understand the use-cases behind virtual keyboard and picture-in-picture, but I am afraid that we will suddenly start to expose occlusions like "web bluetooth selector modal dialog" without actually having use-cases for adoption to that.

Also if we go all aboard and support occlusions by other OS windows, this might even add finger-printability, by knowing the default size of say a Skype window, that will pop on top when I to alt-tab cycling. Or knowing that there is a floating Facebook messenger head on top.

The only real use-case I can come up with for supporting generic occlusions is to modify the position of Ads to always be visible :-) which I am sure is a terrible idea that some surely will pursue.

That said, I am find with supporting keyboard and pip which are related to the web page itself, but they developer needs to know what occlusion belongs to what region to which of these.

Comment by @cynthia Sep 22, 2020 (See Github)

Extending this to other types of occlusions might make sense, but I don't think we should extend it to any occlusion.

I don't think we implied that above, the intent was being able to find all occlusions in one place instead of a bajillion different places. The intent is to provide a shared repository of occlusions when a new spec needs to add one, not to add all existing occlusions into this.

Discussed Jan 1, 2021 (See Github)

Alice: Refreshing memory on the comments...

... Looking at the linked issues, I see they're all closed.

... Relationship with VisualViewport issue

... Argument is that we don't want a general-purpose occlusion API because not every occlusion should be reacted to by the page.

... VisualViewport draft doesn't list any user needs, hard to tell what was intended.

Sangwhan: I explicitly said web application-initiated occlusion, PiP being a good example.

... Putting the occlusion information in the keyboard namespace seems like something we're going to regret later.

Alice: Any other examples of occlusions we might be interested to react to?

Sangwhan: WebPayments - although some may disagree.

Alice: That's the "pay sheet" or whatever it's called, right?

Sangwhan: There's something native in Chrome, and there's content inside it.

... The response on Relationship with VisualViewport issue starts with "... [VisualViewport] is not a general purpose reporter of occlusions and provides no information today about occlusions. ... I wouldn't want web pages updating their layout as I ALT+TAB to another application that overlaps my browser, or have a web page fight me as a drag around a floating keyboard or a picture-in-picture window."

Alice: I don't think they ever replied to the question asking why it couldn't be a live set of bounds... CSS variables are live, but that doesn't help with the canvas case.

Sangwhan: They added an example for the canvas case, but that's listening to geometry change and then requesting the (live) bounds in a rAF().

Alice: Oh, so the bounds are live now?

... Right, I see it's in the Web IDL now. Oh, and we had actually filed an issue on that that they responded to with that change. Bounding rect property - possible to have it live on virtualKeyboard?

... They did have an issue on the navigator question: Is navigator the right place?

... The response there is "Navigator by definition is the place to represent the state of the user agent, and VirtualKeyboard describes whether the user agent is in a state that could shrink the visual viewport when the virtual keyboard comes up."

Sangwhan: They previously implied that VisualViewport was abandoned, but it's shipping in Chrome and Safari.

... Leaving a comment

Comment by @cynthia Jan 26, 2021 (See Github)

@snianu @BoCupp-Microsoft @gked Is this still on-going work? We haven't heard back from you and we noticed that there might have been a misunderstanding - we closed and considered the other VK API issue as good to go, but we think there still is room for improvement here.

The response here https://github.com/MicrosoftEdge/MSEdgeExplainers/issues/389 starts with:

The VisualViewport only solves the problem of knowing when the visual viewport is changing. It is not a general purpose reporter of occlusions and provides no information today about occlusions

But what we see is the actual occlusion still inside the virtualKeyboard object. (which does not make it general purpose, since it's impossible to extend unless we implement a common interface that enforces boundingRect. With that it's still unclear how the user is supposed to enumerate these occlusions.) I think it's fine that there is a pointer to it from the object, but we still think that there should be a canonical place to look for when it comes to occlusions, and we don't see that addressed. @alice and I discussed this today, and was wondering if this functionality could be added to the Visual Viewport API. (even if it has shipped, that doesn't mean adding features is impossible.)

Comment by @BoCupp-Microsoft Jan 26, 2021 (See Github)

Yes, the work continues. We have an implementation behind a flag in Chromium browsers which matches our explainer and will turn our explainer into a spec sometime soon.

I reopened this issue (https://github.com/MicrosoftEdge/MSEdgeExplainers/issues/389) for now while our discussion continues. Apologies for closing it prematurely.

But what we see is the actual occlusion still inside the virtualKeyboard object.

Yes. We describe how a docked, overlaid virtual keyboard object occludes the layout viewport via the VirtualKeyboard interface.

I made an argument in the issue linked above as to why the virtual keyboard seems like a special case when compared with other examples like picture-in-picture or windows that overlap with the browser in a desktop OS. Here's the relevant bit:

In general I don't think we want to report all the things layered over top of the visual viewport. I wouldn't want web pages updating their layout as I ALT+TAB to another application that overlaps my browser, or have a web page fight me as a drag around a floating keyboard or a picture-in-picture window.

The "docked" virtual keyboard is a special case. When it appears, users do expect to be able to see what they're typing, but authors may not want the experience we offer by default. L-shaped viewports aside, adjusting the visual viewport means we'll be creating the "slop" I describe above and jumping part of the page out of the visual viewport to ensure the user can see the blinking caret. If I'm an author that has created a web application whose UI fits in 100vw x 100vh, I might rather adjust the height of one of my subscrollers rather than "unglue" my UI so that the user can start panning it around.

So with regards to this comment:

it's still unclear how the user is supposed to enumerate these occlusions.

My answer is that I don't want authors to be able to enumerate other arbitrary occlusions. If there are some specific occlusions that make sense, then I'd like to consider those when we have the specifics. I'm not aware of any customers asking to relayout their UI while other application windows are being moved around or the user moves the floating keyboard or the user repositions picture-in-picture. If there were such requests, I would still be skeptical whether exposing that information would really enable better user experiences.

Discussed Mar 1, 2021 (See Github)

[bumped to next week

Discussed Mar 1, 2021 (See Github)

Sangwhan: They came back with a response...

[...working on this one...]

Ken: they seem to have fixed a lot of the things I wanted them to fix... just wondering about API .. getter and setter ... normally when you have an attribute as well it's just a getter.

Sangwhan: tbh I don't think this is satisfactory ... this felt very one off. It's an occlusion but specific to keyboards.

Ken: but keyboards are very special.

Sangwhan: being handled as a special case... I don't think this is enough of a rationale.

Ken: Actually I think that keyboards are very special - especially on mobile devices. I kind of disagree that you should have a generic occlusion api .. i think there are many cases but keyboard is very important. This is a needed feature.

Sangwhan: there is also implementer disagreement. Webkit has disagreed to this API design.

Ken: I thought they objected to the other part? Also webkit they don't have issues ...

Sangwhan: they have the same concerns...

Sangwhan: mozilla also objects... 2 other browsers are objecting.

Ken: 2 individuals from other browsers... They did look at reusing the visual viewport API and it doesn't make sense...

Sangwhan: as is.. and if visual viewport API doesn't work that way for keyboards then it should be fixed... that was the feedback we had.

Ken: you could argue the same with the insert area ... fixed with CSS.. that was one of my solutions here... if you're using CSS then you probably want something else besides a javascript API. For keyboard this is an actual issue... Have you ever seen any native app adjust to picture-in-picture? not even native apps do that. I haven't heard any good use case for having to work on a windown occluding another window... but for keyboard there is definitely a case. This is a bounding rect - i think that's OK.

Sangwhan: I'll set proposed closing...

Ken: I want people to agree..

Sangwhan: the part where viewport doesn't support CSS is a limitation of that spec, it should, but it's not there. It's not even FPWD. Just feels weird. I have the same concerns of the others who raised concerns on the original one.

Ken: I know it was an issue when we worked on browsers at nokia, it's worth solving. It's a big enough issue that I'm okay with it being a specific API for this use case instead of waiting on the holy grail api that might never appear

Sangwhan: we suggested the namespace could be better. That's what my feedback boiled down to. If you can do it somehow with visual viewport that would be nice, but if visual viewport is unusable then the namespace should be unified. Right now its in navigator.keyboard or something.. occlusions are defined there, imgagine another virtual input modality comes out.. navigator.??.occlusions I thought was short sighted

Ken: that's something I would care about, but nitpicking. Unless you have good suggestions

Sangwhan: if you want to enumerate through things that are occluding the content you want to find it in one place

Ken: so something like navigator.occlusions.keyboard

Sangwhan: could be a list, should be in one place. Other parts about implementation details..

Ken: I'm okay with having a different name, I'm afraid of ding a list and people have to query what it is. If there's nothing else but keyboard people are going to hardcode it and when you add something it will break. You can already iterate properties

Sangwhan: you have to enumerate because of support for split keyboard?

Ken: no split keyboard is always overlay, you can move it around. It's only relevant in the case.... maybe I'm wrong.

Sangwhan: split keyboard reqires you to enumerate

Dan: this sounds like feedback we should be giving them in a closing comment and say this is what we think based on our analysis, but it's up to you.. Not design the solution for them. If we can come up with feedback that both of you can get behind we could leave it in the closing comment and close this off.

Ken: yeah

Sangwhan: they don't have support for split keyboard

Ken: i can write some of this feedback now

Sangwhan: every piece of feedback was bounced back.. we don't know how many ways to split a keyboard, we can't define that, what if it's for accessibility reasons... a corner case

Ken: always the question with trying to figure otu the generic solution, a balance..

Sangwhan: it's not that hard, you need a list of recs instead of a rec

Ken: they'll assume it's one and you'll end up with the same issues. Then you need an API to force developers to not ignore it

Sangwhan: if developers are going to ignore the spec, then...

Ken: if it's a corner case people are not even thinking about that case and will write code that doesn't account for it. Unless you make an API that makes it clear you cannot ignore it

Dan: this is feedback we should provide int he closing comment and making it clear that we think they should be accommodating these cases and working with the applicable communities. Sangwhan mentioned accessibility as a case. They should be working with the community who cares about that case and making sure that what they have accommodates that case. I don't know that it's our role to get into that conversation other than pointing them in the right direction.

Sangwhan: we tried multiple things...

Dan: we should point that out. We don't feel that our feedback has been received.

Ken: that doesn't seem t be the case, they have been responsive. Whether they get what we mean.. it's not that they're not listening

Dan: better to provide actionable feedback.

Sangwhan: it was actionable. Split keyboards is actionable, an API change that's actionable... decided that it's not an action they want to take. We were very specific.

Dan: the question becomes do we close it with ambivalent or unsatisfied? I'm hearing more like ambivalent because there are some areas where Ken feels they've been responsive and some where Sangwhan feels they haven't.

Ken: they have taken some feedback. The thing with CSS environmental variables is in the explainer now. Whether they agree or not is different..

Sangwhan: maybe 10%.. the CSS one is the one thing that changed. I would propose closing.

Ken: I'm going to follow up on it.

Dan: finalise and close at the plenary. Come up with feedback that correctly channels the consensus view that we have

Sangwhan: we should mention that two representatives from different implementers have raised concerns and we don't feel that was properly addressed.

Dan: very valid

Ken: do that and link to exactly those comments and summarize what they said.

Dan: we don't have consensus. We have consensus that they haven't listened to feedback from other implementers and should be working to engage more on cases such as split keyboard and that they have listened to some feedback but not the majority of the feedback. I'm happy with that feedback (below) however the one thing I'm concerned about is are we leaving it unsatisfied or ambivalent.. I think we need to take a TAG straw poll on that one. I don't have a strong opinion. I'd rather not leave something as unsatisfied... it seems to be reserved for things that really haven't listened to us at all.

Ken: posted a personal comment

Dan: can we discuss at plenary and don't say unsatisfied.

Comment by @snianu Mar 4, 2021 (See Github)

@cynthia Could you please let us know if the above answers address your concerns or not? This is currently blocking spec review & shipping in Chromium as based on the outcome of this discussion it may lead to significant changes in the API structure/code. We had this discussion at the TPAC meeting and we came to a consensus that VisualViewport is not the right place to fire geometrychange event caused by virtual keyboard show/hide. One of the reasons is with overlaysContent flag set, the VK doesn't change the VisualViewport i.e. the keyboard is overlaid on top of the content and doesn't "resize" or change the VisualViewport in any way. These discussions were buried in the show/hide policy thread which was opened separately. The discussions about VisualViewport APIs start from here. The MoM of the TPAC breakout session discussion is here Thank you for all the feedback so far!

Comment by @kenchris Mar 23, 2021 (See Github)

This is my personal take as there is not full consensus in the TAG at this point.

I believe virtual keyboards are special enough to warrant a specific API instead of a generic occlusion API. If such a generic API could be created it would be perfect, but I am wondering if there are strong enough use-cases to drive the development of such an API. Example occlusions:

  • Other windows
  • Picture in picture
  • Emoji picker
  • Virtual keyboards (even split ones)

I am happy that you included CSS environmental variables as that makes it much easier to use this feature from CSS.

I am also fine with this not being integrated with the Virtual Viewport API given its state of development.

I am a little bit concerned about navigator.virtualKeyboard.overlaysContent as it might not be clear that it is a setter, but that is nitpicking. I am more concerned that I as a developer can set it to false, but if the user is using a split keyboard, it is going to overlay content anyways. Maybe it should be an enum like preferredMode: overlay | docked.

As overlay keyboards are used on existing platforms, supporting them out of the box seems quite important and that is also what I am hearing from @cynthia - This requires the supporting at least two bounding boxes. This also requires additions to the CSS support @atanassov

Comment by @cynthia Mar 23, 2021 (See Github)

Hi, apologies for the delayed response - this fell through the cracks (never got a proper milestone update - our bad) and luckily was noticed by @plinss.

Could you please let us know if the above answers address your concerns or not?

To be honest, I'm afraid not - but given this:

This is currently blocking spec review & shipping in Chromium as based on the outcome of this discussion it may lead to significant changes in the API structure/code.

We also don't think we should block work - the core concerns have been raised long enough ago, but we don't think it was addressed in a timely manner. However, given that there is a deadline and we don't think there is much else for us to do here.

That said, we have also noticed that representatives from different implementors have raised [1] [2] similar concerns and we do not think the concerns have been properly addressed. For these reasons, we plan to close this during our plenary.

[1] https://github.com/w3c/editing/issues/225#issuecomment-611482377 [2] https://github.com/w3c/editing/issues/225#issuecomment-614917371

Comment by @torgo Mar 24, 2021 (See Github)

Hi folks – thanks again for sending this review request. We are going to close this with an 'ambivalent' status. As indicated above, some of the feedback has been actioned but we feel there are some important points that haven't been addressed. More importantly there is an issue with multi-implementer support and considering the work is going in in webapps, you will need to gain implementer support before advancing this spec to the next stage there. We hope that happens.

Comment by @jspurlin Apr 3, 2021 (See Github)

...I'm a little late to the party on this, but I want to share my thoughts...

As a web app developer, the virtual keyboard and it occluding content is unique/specific enough to warrant the functionality to be scoped to its own API, and navigator.virtualKeyboard/navigator.virtualKeyboard.overlaysContent makes sense for implementing associated scenarios in a web application.

In my mind, attempting to lump the functionality into with Visual Viewport does nothing but over complicate the the mental model for how to think about and approach scenarios related to virtual keyboard (which are very targeted and different from any other Visual Viewport interactions). Additionally, I think we also need be mindful of not trying to come up with a "kitchen sink" solution that solves for unrelated scenarios that don't exist today... doing this could lead to an over-engineered solution that ends up being too complicated for practical purposes.

As it relates to occluding content, I feel the virtualKeyboard API should encapsulate allowing web developers to have knowledge about its presence/dimensions (overlaygeometrychange and boundingRect) and be able to tell the browser to automatically occlude content with the virtual keyboard (overlaysContent).

I'm happy to discuss this in more detail.