Intent to Implement and Ship: CaptureStartFocusBehavior enum value "focus-capturing-application"

75 views
Skip to first unread message

François Beaufort

unread,
Sep 19, 2023, 6:50:00 AM9/19/23
to blink-dev

Contact emails

fbea...@google.com

elad...@google.com


Explainer

https://github.com/WICG/conditional-focus/blob/main/README.md


Specification

https://www.w3.org/TR/screen-capture/#idl-def-CaptureStartFocusBehavior.focus-capturing-application


Summary

The Screen Capture API lets the user select a tab, window, or screen to capture as a media stream. Using the existing CaptureController setFocusBehavior() method, web apps control whether the captured tab or window will be focused when capture starts, or whether the browser will leave focus with whichever surface last had focus.


The new enum value "focus-capturing-application" allows web apps to give a hint to the browser that the capturing page prefers to remain focused. The old value "no-focus-change" now indicates that the application prefers that the user agent not change focus, leaving focus with whichever surface last had focus following the user's interaction with the user agent and/or operating system. In Chrome’s current implementation, this means leaving the capturing application focused. In the future, if Chrome adopts the macOS picker, it could behave differently on Mac. This behavior could prove useful for a11y-conscious applications that prefer to minimize the number of focus-changes a user experiences, as those can be challenging for users with screen-readers.

Blink component

Blink>GetDisplayMedia


TAG review

N/A We didn’t file a specific TAG review for this feature as the addition of this enum doesn’t have any architectural changes impact to the spec and the web in general.


TAG review status

Pending


Risks


Interoperability and Compatibility

None


Gecko: No signal


WebKit: No signal - Youenn Fablet from Apple requested this API change in https://github.com/w3c/mediacapture-screen-share/issues/263.


Web developers: No signal

Other signals:


WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?

None



Debuggability

No DevTools changes are required, treated like any other attribute/enum.


Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Supported on all platforms that support getDisplayMedia. Namely, all desktop platforms.


Is this feature fully tested by web-platform-tests?

Yes. See https://wpt.fyi/results/screen-capture/getdisplaymedia-capture-controller.https.window.html


Flag name on chrome://flags

None


Finch feature name

None


Requires code in //chrome?

No.


Tracking bug

https://bugs.chromium.org/p/chromium/issues/detail?id=1480383


Estimated milestones

Shipping on desktop

119


Anticipated spec changes

Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).

None


Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5119529898475520


This intent message was generated by Chrome Platform Status.


Yoav Weiss

unread,
Sep 20, 2023, 11:26:57 AM9/20/23
to François Beaufort, blink-dev
On Tue, Sep 19, 2023 at 12:49 PM 'François Beaufort' via blink-dev <blin...@chromium.org> wrote:

Contact emails

fbea...@google.com

elad...@google.com


Explainer

https://github.com/WICG/conditional-focus/blob/main/README.md


Specification

https://www.w3.org/TR/screen-capture/#idl-def-CaptureStartFocusBehavior.focus-capturing-application


Summary

The Screen Capture API lets the user select a tab, window, or screen to capture as a media stream. Using the existing CaptureController setFocusBehavior() method, web apps control whether the captured tab or window will be focused when capture starts, or whether the browser will leave focus with whichever surface last had focus.


The new enum value "focus-capturing-application" allows web apps to give a hint to the browser that the capturing page prefers to remain focused. The old value "no-focus-change" now indicates that the application prefers that the user agent not change focus, leaving focus with whichever surface last had focus following the user's interaction with the user agent and/or operating system. In Chrome’s current implementation, this means leaving the capturing application focused. In the future, if Chrome adopts the macOS picker, it could behave differently on Mac. This behavior could prove useful for a11y-conscious applications that prefer to minimize the number of focus-changes a user experiences, as those can be challenging for users with screen-readers.

Blink component

Blink>GetDisplayMedia


TAG review

N/A We didn’t file a specific TAG review for this feature as the addition of this enum doesn’t have any architectural changes impact to the spec and the web in general.


TAG review status

Pending


Risks


Interoperability and Compatibility

None


You mentioned a semantics change around "no-focus-change". I guess it doesn't have any ability to break pages, at worst users will get a different focus than they previously did. Is that correct?
  

Gecko: No signal


Can we file a position, as an FYI?
 
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAPpwU5KrkGMo%3DyATVuio-rpiLcbPJb6FGyk3i%2BdfvXGuBoE-kg%40mail.gmail.com.

François Beaufort

unread,
Sep 20, 2023, 11:45:31 AM9/20/23
to Yoav Weiss, blink-dev
On Wed, Sep 20, 2023 at 5:26 PM Yoav Weiss <yoav...@chromium.org> wrote:


On Tue, Sep 19, 2023 at 12:49 PM 'François Beaufort' via blink-dev <blin...@chromium.org> wrote:

Contact emails

fbea...@google.com

elad...@google.com


Explainer

https://github.com/WICG/conditional-focus/blob/main/README.md


Specification

https://www.w3.org/TR/screen-capture/#idl-def-CaptureStartFocusBehavior.focus-capturing-application


Summary

The Screen Capture API lets the user select a tab, window, or screen to capture as a media stream. Using the existing CaptureController setFocusBehavior() method, web apps control whether the captured tab or window will be focused when capture starts, or whether the browser will leave focus with whichever surface last had focus.


The new enum value "focus-capturing-application" allows web apps to give a hint to the browser that the capturing page prefers to remain focused. The old value "no-focus-change" now indicates that the application prefers that the user agent not change focus, leaving focus with whichever surface last had focus following the user's interaction with the user agent and/or operating system. In Chrome’s current implementation, this means leaving the capturing application focused. In the future, if Chrome adopts the macOS picker, it could behave differently on Mac. This behavior could prove useful for a11y-conscious applications that prefer to minimize the number of focus-changes a user experiences, as those can be challenging for users with screen-readers.

Blink component

Blink>GetDisplayMedia


TAG review

N/A We didn’t file a specific TAG review for this feature as the addition of this enum doesn’t have any architectural changes impact to the spec and the web in general.


TAG review status

Pending


Risks


Interoperability and Compatibility

None


You mentioned a semantics change around "no-focus-change". I guess it doesn't have any ability to break pages, at worst users will get a different focus than they previously did. Is that correct?

"focus-capturing-application" and "no-focus-change" behave the same in Chrome.
This will not break pages as Chrome is the only browser to have shipped Conditional Focus.
  

Gecko: No signal


Can we file a position, as an FYI?

Yoav Weiss

unread,
Sep 20, 2023, 1:13:50 PM9/20/23
to François Beaufort, blink-dev
LGTM1

OK, thanks for clarifying!

François Beaufort

unread,
Sep 26, 2023, 5:28:49 AM9/26/23
to Yoav Weiss, blink-dev
I'm happy to answer the remaining questions if any.

Daniel Bratell

unread,
Sep 27, 2023, 10:59:00 AM9/27/23
to François Beaufort, Yoav Weiss, blink-dev

Chris Harrelson

unread,
Sep 27, 2023, 11:54:26 AM9/27/23
to Daniel Bratell, François Beaufort, Yoav Weiss, blink-dev
LGTM3

We also briefly reviewed the other review categories (privacy, security, etc) and deemed them unlikely to create an issue in this case.

Reply all
Reply to author
Forward
0 new messages