Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-viewport-1] Add 'interactive-widgets' to viewport meta #7826

Merged
merged 5 commits into from Oct 11, 2022

Conversation

bokand
Copy link
Contributor

@bokand bokand commented Oct 4, 2022

[css-viewport-1] Add 'interactive-widgets' to viewport meta

This describes the proposed interactive-widgets property of the viewport meta tag for describing the expected behavior when a virtual-keyboard-like widget is shown.

@bokand bokand requested a review from emilio October 4, 2022 18:46
@bokand
Copy link
Contributor Author

bokand commented Oct 4, 2022

@emilio here's a first crack, WDYT?

One question on naming: "interactive-widgets" is plural so implies "resize-visual" rather than "resizes-visual" but the virtual keyboard API has overlaysContent which I wanted to keep consistent. Perhaps interactive-widget=resizes-visual would be preferable?

I also had some issues linking to defs in the virtual-keyboard spec, I'll keep looking at that but if you can spot the issue help would be appreciated.

@bokand
Copy link
Contributor Author

bokand commented Oct 4, 2022

Also, unrelated to this specific PR but if no one's signed up for it, I can try and find some time before end of year to specify viewport meta more generally. PLMK

css-viewport/Overview.bs Outdated Show resolved Hide resolved
css-viewport/Overview.bs Outdated Show resolved Hide resolved
css-viewport/Overview.bs Outdated Show resolved Hide resolved
css-viewport/Overview.bs Outdated Show resolved Hide resolved
Co-authored-by: Chris Harrelson <3453258+chrishtr@users.noreply.github.com>
Copy link
Collaborator

@emilio emilio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's fix the links before landing.

It seems reasonable. I'm not a fan of the naming but this is much better than virtual-keyboard, and I don't have any better suggestions off the top of my head. One question on the naming of resize-layout tho.

<dd>
Interactive UI widgets MUST NOT [=resize=] the [=initial viewport=] nor
the <a spec="CSSOM-VIEW">visual viewport</a>. The user agent must perform the same steps
<!--TODO I can't seem to autolink to overlaysContent, help?-->
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tabatkins can you help with this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got some help with this internally - added an anchors block at the top so autolinks to overlaysContent are working now.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can i follow!!

css-viewport/Overview.bs Outdated Show resolved Hide resolved
as when <a href="https://www.w3.org/TR/virtual-keyboard/#dom-virtualkeyboard-overlayscontent">
VirtualKeyboard.overlaysContent</a> is set to <code>true</code>.
</dd>
<dt><dfn><code>resize-layout</code></dfn></dt>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So web-platform-tests/interop-2022-viewport#25 is a discussion about whether the "layout viewport" should be called something else... Maybe we can give it a bit more thought and figure out whether we want to change that? If we do want to change that, it seems using here the layout term would be unfortunate...

Copy link
Contributor Author

@bokand bokand Oct 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, how about "resize-initial"? Since that's what the spec text refers to and that's what the layout/fixed/whatever viewport is derived from?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resize-initial seems weird to me, as that reminds me of the initial in ICB, whereas this targets the LVP. Just commented on web-platform-tests/interop-2022-viewport#25 and suggested “Document Viewport” to further specify it without introducing a new ambiguous term. Should suggestion make it in, maybe resize-document could be considered?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it does resize the ICB which I think is the most salient part of its behavior (it also happens to resize the fixed viewport).

That said, "Document Viewport" actually sgtm, will reply on that issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was a good counter point to "document viewport" on that issue but I also realized that this really does resize more than just this viewport. In skobe's example page on web-platform-tests/interop-2022-viewport#25, this mode will resize both LV and ICB. This really does resize the "initial viewport", though I agree it's not a great author-facing name.

How about we don't make it "viewport" specific and describe it in less precise but terms more understandable to authors? Some other ideas:

  • resizes-content works well as a contrast to overlays-content I think
  • resizes-container
  • resizes-window

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No hard feelings about resizes-content, although technically your content does not get resized. I mean, your content will still have the same size when the OSK gets shown, unless you have them sized to specific viewport units.

Definitely not a fan of resizes-container given we have Container Queries in CSS. This would lead to confusion.

Not a huge fan of resizes-window as it does not actually resize the app’s window, right? I would think an app (on mobile) to still run at the same size as on launch when the OSK gets shown. Is this the case? By the looks of it, this is also the behavior on Windows (at least for Chrome).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good points about container and window.

I mean, your content will still have the same size when the OSK gets shown, unless you have them sized to specific viewport units.

I'd say it has the potential to resize content since it resizes the initial containing block.

@emilio WDYT?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resizes-content works for me... It might be worth raising this in the next meeting to get wider feedback tho.

@bokand
Copy link
Contributor Author

bokand commented Oct 7, 2022

One question on naming: "interactive-widgets" is plural so implies "resize-visual" rather than "resizes-visual" but the virtual keyboard API has overlaysContent which I wanted to keep consistent. Perhaps interactive-widget=resizes-visual would be preferable?

@emilio Thoughts on this? Or do you think it's ok as-is?

@emilio
Copy link
Collaborator

emilio commented Oct 7, 2022

One question on naming: "interactive-widgets" is plural so implies "resize-visual" rather than "resizes-visual" but the virtual keyboard API has overlaysContent which I wanted to keep consistent. Perhaps interactive-widget=resizes-visual would be preferable?

@emilio Thoughts on this? Or do you think it's ok as-is?

I don't feel strongly either way. If you think resizes- is more consistent that works for me.

@bramus
Copy link
Contributor

bramus commented Oct 10, 2022

A late remark but I’m seeing some potential confusion between the term “Interactive UI widgets” (used here) and “UA interfaces that are dynamically expanded and retracted” (used in the definition for the various Viewports and their associated lengths). After all, a Virtual Keyboard is also “an interface that is dynamically expanded and retracted” (albeit from the OS – not the UA).

Taking a step back: we approached this from the virtual keyboard and therefore first named the extension virtual-keyboard + loaned the value overlays-content from the VK API. As it can be more than just the Virtual Keyboard (can it?), it got renamed to interactive-widgets and later interactive-widget as we continued down that path.

Another approach: what if we called it resize-behavior? This because it allows you to define the resize behavior of the viewport(s). Values would be document-viewport, visual-viewport, and none (former overlays-content). Spec can then later always find a better term for “Interactive UI widgets” should that be confusing to authors (which I think it will be).

Using resize-behavior would also keep the language consistent: all other allowed options of the viewport meta tag (e.g. initial-scale) use the viewport as the subject. With resize-behavior this is also the case, whereas with interactive-widget it is not.

It would also leave the door open for something like resize-triggers, should we ever want to allow authors to tweak what exactly can cause a resize.

@bokand
Copy link
Contributor Author

bokand commented Oct 10, 2022

As it can be more than just the Virtual Keyboard (can it?), it got renamed to interactive-widgets and later interactive-widget as we continued down that path.

This is intended to apply only to virtual-keyboard and virtual-keyboard-like UI - I'm not sure if any exists today but something that's similar to today's keyboards but not necessarily exactly a keyboard (e.g. voice interpreter, handwriting panel, etc. that behave equivalently to the "regular" virtual keyboard).

Another approach: what if we called it resize-behavior? This because it allows you to define the resize behavior of the viewport(s). Values would be document-viewport, visual-viewport, and none (former overlays-content)

My main push back is that this property isn't a general resizing mechanism, it applies only to virtual-keyboards. i.e. none of URL bar, bottom bars, split screen, etc. will respect this property so I think resize-behavior will be somewhat misleading.

This addition is mainly intended to pave a path to an interoperable behavior for virtual-keyboards. I think if we want to design a more complete and general API later we can (and should!) still do that.

@bokand
Copy link
Contributor Author

bokand commented Oct 11, 2022

Thanks all, I think that's everything resolved.

@bokand bokand merged commit c0dd898 into w3c:main Oct 11, 2022
aarongable pushed a commit to chromium/chromium that referenced this pull request Oct 11, 2022
This CL updates the names of some properties in the
`interactive-widgets` property of the viewport meta tag to reflect
updated spec text[1]:

"interactive-widgets" --> "interactive-widget"
"resize-layout" --> "resizes-content"
"resize-visual" --> "resizes-visual"

[1] w3c/csswg-drafts#7826

Bug: 1353728
Change-Id: I6a07dd9d8e2c018a107ab045a3c181946129b033
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3940786
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Commit-Queue: David Bokan <bokan@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1057574}
bramus added a commit to bramus/viewport-resize-behavior that referenced this pull request Oct 11, 2022
This commit updates the names of some properties in the `interactive-widgets` property of the viewport meta tag to reflect updated spec text[1]:

"interactive-widgets" --> "interactive-widget"
"resize-layout" --> "resizes-content"
"resize-visual" --> "resizes-visual"

[1] w3c/csswg-drafts#7826
aarongable pushed a commit to chromium/chromium that referenced this pull request Oct 12, 2022
This CL adds a pref and accompanying enterprise policy which sets the
default virtual keyboard resize behavior to "resize-layout". If the
preference is set, the OSKResizesVisualViewportByDefault flag has no
effect on the default resize behavior.

Note however that it's only the *default* resize behavior that's
affected by the pref. If the author specifies a non-default behavior
with the Virtual Keyboard API or a <meta> tag, that behavior will
apply.

Further, the pref has no effect on whether or not the
<meta>/interactive-widget functionality [1] is exposed.

[1] w3c/csswg-drafts#7826

Bug: 1353728
Change-Id: I2b9fd26d080e75c2d94a1b7021f43a3722fc7cae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3934281
Reviewed-by: Pavol Marko <pmarko@chromium.org>
Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1058060}
mjfroman pushed a commit to mjfroman/moz-libwebrtc-third-party that referenced this pull request Oct 14, 2022
This CL updates the names of some properties in the
`interactive-widgets` property of the viewport meta tag to reflect
updated spec text[1]:

"interactive-widgets" --> "interactive-widget"
"resize-layout" --> "resizes-content"
"resize-visual" --> "resizes-visual"

[1] w3c/csswg-drafts#7826

Bug: 1353728
Change-Id: I6a07dd9d8e2c018a107ab045a3c181946129b033
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3940786
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Commit-Queue: David Bokan <bokan@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1057574}
NOKEYCHECK=True
GitOrigin-RevId: 4e1884d7ccb5252387eb8a15a130bed7d7322ace
ns-rsilva pushed a commit to ns-rsilva/chromium that referenced this pull request Apr 25, 2024
This CL updates the names of some properties in the
`interactive-widgets` property of the viewport meta tag to reflect
updated spec text[1]:

"interactive-widgets" --> "interactive-widget"
"resize-layout" --> "resizes-content"
"resize-visual" --> "resizes-visual"

[1] w3c/csswg-drafts#7826

Bug: 1353728
Change-Id: I6a07dd9d8e2c018a107ab045a3c181946129b033
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3940786
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Commit-Queue: David Bokan <bokan@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1057574}

Former-commit-id: 4e1884d7ccb5252387eb8a15a130bed7d7322ace
ns-rsilva pushed a commit to ns-rsilva/chromium that referenced this pull request Apr 25, 2024
This CL adds a pref and accompanying enterprise policy which sets the
default virtual keyboard resize behavior to "resize-layout". If the
preference is set, the OSKResizesVisualViewportByDefault flag has no
effect on the default resize behavior.

Note however that it's only the *default* resize behavior that's
affected by the pref. If the author specifies a non-default behavior
with the Virtual Keyboard API or a <meta> tag, that behavior will
apply.

Further, the pref has no effect on whether or not the
<meta>/interactive-widget functionality [1] is exposed.

[1] w3c/csswg-drafts#7826

Bug: 1353728
Change-Id: I2b9fd26d080e75c2d94a1b7021f43a3722fc7cae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3934281
Reviewed-by: Pavol Marko <pmarko@chromium.org>
Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1058060}

Former-commit-id: eedebdc9379df310e4743c49946f257977a15de1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants