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

Viewport Segments Property #689

Closed
1 task done
scottlow opened this issue Nov 9, 2021 · 14 comments
Closed
1 task done

Viewport Segments Property #689

scottlow opened this issue Nov 9, 2021 · 14 comments

Comments

@scottlow
Copy link

scottlow commented Nov 9, 2021

Braw mornin' TAG!

I'm requesting a TAG review of the Viewport Segments Property after taking into account feedback (e.g. webscreens/window-segments#12) around integrating our original Window Segments API proposal (initial TAG review here: #492) with the Visual Viewport API.

Web developers targeting foldable devices want to be able to effectively lay out the content in a window that spans multiple displays. However, the web platform does not yet provide the necessary primitives for building layouts that are optimized for foldable experiences. The Viewport Segments Property will provide a list of logical segments of the viewport that web developers can use to target with different views, as appropriate based on size and configuration of those segments.

Further details:

  • 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): WICG
  • The group where standardization of this work is intended to be done ("unknown" if not known): Unknown
  • Existing major pieces of multi-stakeholder review or discussion of this design:
  • 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:

💬 leave review feedback as a comment in this issue and @-notify [github usernames]

@kenchris
Copy link

I am very happy to see this being part of VisualViewport now. I like the figures/images from the explainer and think it would be nice to add those to the spec as well

@JensenPaul
Copy link

It seems like this API might expose hardware characteristics to the web.  Would it make sense to add text to the explainer's "Security & Privacy" section discussing how identifying these characteristics are, quantifying the fingerprinting risks, whether they're exposed by other APIs, and what mitigations you've considered?

@scottlow
Copy link
Author

@kenchris thanks! I can take an action item to get those added.

@JensenPaul, we've called out the additional bits of entropy and the fact that for some devices they're already exposed via window.screen properties in the questionnaire. The "Security and Privacy" sections of each explainer (I figured I'd comment here to address your comment in #690 as well) detail the mitigations we've put in place for each new primitive.

@plinss plinss modified the milestones: 2021-11-22-week, 2021-12-06-F2F-Madripoor Nov 22, 2021
@kenchris
Copy link

kenchris commented Dec 7, 2021

On devices with an actual foldable display, it makes a lot of sense to talk about segments when folded, with the addition that the segment in the middle (the actual folded part) should also be exposed as it might not be touchable (or touch events might not work well). @darktears @diekus @lauramorinigo

The reason I am asking is that it would be nice to discuss and show example of this in the explainer/spec. Like I don't know what the current thinking is for foldable displays. Will it just expose 3 regions, with no overlap (first, fold, last), or will the fold area overlap with the first and last region? Would all of this work with this API?

Some gamer laptops have 1.5 screen, basically a mini display above the keyboard that can be "lifted up" together with the main display to become a larger "foldable" monitor. You could imagine the lower display (and thus segment) to support touch, but not the main screen (other segment) given the gamer focus (cost saving) - I understand that on systems today these are considered different monitors, but AFAIU most of that was done due to missing platform APIs and this could change in the future.

@kenchris
Copy link

kenchris commented Dec 7, 2021

Can we clarify in the explainer that this doesn't cover regular multi monitor use-cases and only joined displays that are considered one virtual display/screen?

@kenchris
Copy link

kenchris commented Dec 7, 2021

In our TAG discussions we always end up with confusion around virtual displays (what the OS considers a display) that might actually be multiple physical joined displays. Can we please clarify that in the explainer and spec by linking to the relevant parts in https://webscreens.github.io/form-factors/

@darktears
Copy link

darktears commented Dec 7, 2021

@kenchris In regards to your comment on foldables. With the refactor to support N hinges/folds it's getting harder to support that because there is no more information about the hinge/fold area. The segments property as described here will return two segments on a dual screen device where the geometries of each will allow you to layout around the hinge. Just like the https://drafts.csswg.org/css-env-1/#viewport-segments. I agree with your comment that if a foldable/OS decide to divide the viewport in two when the device is half folded, we could return three segments (two for the top/bottom and one for the fold area). Then it's up to the developer to decide whether to use a split UX or not. But in this case the "fold" segment must be defined to let the developer know where it is because of usability reasons (for e.g. avoiding putting a button or a scrubbing bar in the fold area) regardless of split UX.

I asked Microsoft in the past to add a property that would let a developer identify if the hinge is solid or transparent justly to cover that. Thinking about this proposal we'll have to expose the segments into an object that contains the DOMRect and the type (standard segment vs fold(opaque)/hinge(solid).

The fold case is something we should solve here and in the CSS counterpart. Our partners were specific around some of the issues with foldables: half cut videos, buttons in the middle of the fold are challenges that you see often. We need developers have the tools to address the issue.

@kenchris
Copy link

kenchris commented Dec 7, 2021

@darktears would some of this be helped if each segment would contain a bit of metadata, like whether it is the fold area or not?

@darktears
Copy link

I think it would.

@torgo torgo modified the milestones: 2021-12-06-F2F-Madripoor, 2022-01-31 Jan 30, 2022
@torgo torgo modified the milestones: 2022-01-31, 2022-02-07 Feb 2, 2022
@plinss plinss modified the milestones: 2022-02-07, 2022-02-14-week Feb 10, 2022
@torgo torgo modified the milestones: 2022-02-14-week, 2022-02-21-week Feb 12, 2022
@torgo torgo added the Progress: pending external feedback The TAG is waiting on response to comments/questions asked by the TAG during the review label Feb 21, 2022
@plinss
Copy link
Member

plinss commented Feb 21, 2022

Given a desire to add metadata, and for general extensibility, have you considered returning a 'segment' object rather than a simple DOMRect?

@torgo
Copy link
Member

torgo commented May 23, 2022

Hi @dlibby, @ststimac, @scottlow... we're trying to progress this review so we can get you some useful feedback and close it. Do you have any response to Peter's question from earlier in the year? Can anyone give us an update on the evolution of this proposal? Also where is this going after WICG? Any news there?

@diekus
Copy link

diekus commented May 24, 2022

Hola @torgo, 2 out of 3 members there are not in the team anymore. Let me follow up internally and get you some much needed peace. Will report back soon.

@dlibby-
Copy link

dlibby- commented May 26, 2022

Adding an extensibility point via a more complex object sounds like a reasonable way to stage this API. But I'm not sure I'm convinced unconditionally exposing the hinge as a segment is a net positive for developers, and either muddies the waters w.r.t. the concept of viewport segments as exposed via environment variables or makes them much more complex to use. Designing for future form factors is one thing, but consider the real-world devices in market today - Samsung foldables have no hinge, while Surface Duo does (i.e. the hinge consumes part of the viewport). Do we really want developers to have to add if statements and duplicate logic to support separate dual-view implementations on those devices?

From w3c/csswg-drafts#6339, the VisualViewport spec is to be adopted into cssom-view, so CSSWG is the destination.

@torgo
Copy link
Member

torgo commented Jun 6, 2022

Thanks folks - on the basis of this feedback we're happy to close this and we're happy to see this work move forward. Looking forward to a foldable future.

@torgo torgo closed this as completed Jun 6, 2022
@torgo torgo removed this from the 2022-06-06-week milestone Jun 6, 2022
@torgo torgo added Progress: review complete Resolution: satisfied The TAG is satisfied with this design and removed Progress: pending external feedback The TAG is waiting on response to comments/questions asked by the TAG during the review labels Jun 6, 2022
darktears added a commit to darktears/csswg-drafts that referenced this issue Jul 12, 2024
This property exposes in JavaScript what is already exposed to
CSS via env() variables.

TAG review w3ctag/design-reviews#689.

CSSWG Approval: w3c#9237#issuecomment-2160730855

Fixes w3c#9237.
darktears added a commit to darktears/csswg-drafts that referenced this issue Jul 12, 2024
This property exposes in JavaScript what is already exposed to
CSS via env() variables.

TAG review w3ctag/design-reviews#689.

CSSWG Approval: w3c#9237#issuecomment-2160730855

Fixes w3c#9237.
darktears added a commit to darktears/csswg-drafts that referenced this issue Jul 16, 2024
This property exposes in JavaScript what is already exposed to
CSS via env() variables.

TAG review w3ctag/design-reviews#689.

CSSWG Approval: w3c#9237#issuecomment-2160730855

Fixes w3c#9237.
darktears added a commit to darktears/csswg-drafts that referenced this issue Jul 16, 2024
This property exposes in JavaScript what is already exposed to
CSS via env() variables.

TAG review w3ctag/design-reviews#689.

CSSWG Approval: w3c#9237#issuecomment-2160730855

Fixes w3c#9237.
darktears added a commit to darktears/csswg-drafts that referenced this issue Jul 16, 2024
This property exposes in JavaScript what is already exposed to
CSS via env() variables.

TAG review w3ctag/design-reviews#689.

CSSWG Approval: w3c#9237#issuecomment-2160730855

Fixes w3c#9237.
darktears added a commit to darktears/csswg-drafts that referenced this issue Aug 7, 2024
This property exposes in JavaScript what is already exposed to
CSS via env() variables.

TAG review w3ctag/design-reviews#689.

CSSWG Approval: w3c#9237#issuecomment-2160730855

Fixes w3c#9237.
darktears added a commit to darktears/csswg-drafts that referenced this issue Aug 8, 2024
This property exposes in JavaScript what is already exposed to
CSS via env() variables.

TAG review w3ctag/design-reviews#689.

CSSWG Approval: w3c#9237#issuecomment-2160730855

Fixes w3c#9237.
darktears added a commit to darktears/csswg-drafts that referenced this issue Aug 19, 2024
This property exposes in JavaScript what is already exposed to
CSS via env() variables.

TAG review w3ctag/design-reviews#689.

CSSWG Approval: w3c#9237#issuecomment-2160730855

Fixes w3c#9237.
darktears added a commit to darktears/csswg-drafts that referenced this issue Aug 19, 2024
This property exposes in JavaScript what is already exposed to
CSS via env() variables.

TAG review w3ctag/design-reviews#689.

CSSWG Approval: w3c#9237#issuecomment-2160730855

Fixes w3c#9237.
darktears added a commit to darktears/csswg-drafts that referenced this issue Aug 19, 2024
This property exposes in JavaScript what is already exposed to
CSS via env() variables.

TAG review w3ctag/design-reviews#689.

CSSWG Approval: w3c#9237#issuecomment-2160730855

Fixes w3c#9237.
emilio pushed a commit to w3c/csswg-drafts that referenced this issue Aug 19, 2024
This property exposes in JavaScript what is already exposed to
CSS via env() variables.

TAG review w3ctag/design-reviews#689.

CSSWG Approval: #9237#issuecomment-2160730855

Fixes #9237.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants