w3c / window-management

Window Management API
https://www.w3.org/TR/window-management/
Other
95 stars 25 forks source link

window "label" metadata for natural language #125

Open aphillips opened 1 year ago

aphillips commented 1 year ago

Section 2.1 Screen https://www.w3.org/TR/window-placement/#screen-label

A screen has a label, which is a string that meaningfully describes the screen to a user to help them identify and differentiate screens.

Note: The label can be an arbitrary string selected by the user agent. It could describe the screen relative to the device, e.g. "internal" vs. "external", it could include the dimensions, e.g. "640×480", it could include hardware model information, e.g. "Acme Telletube 1000x" from VESA E-EDID data, it could include a distinguishing number, e.g. "screen 1" vs. "screen 2", or all of the preceding. The label can be an empty string if underlying display details are unknown or the user agent chooses to hide that information. Applications can’t assume that the label contains any specific information, such as the device type, model, dimensions, density, etc.

The label attribute contains natural language text intended for the end-user. There is no language or direction metadata provided for this field. See String-Meta for why this information is needed in APIs for consumers to display the values successfully.

In our WG discussion of this topic on 2023-01-12, one of the callouts was that, unlike some Web APIs that have mainly internal display names, the window label is explicitly meant for human consumption. It generally refers to the local system, which may or may not (think "kiosk") be under the user's control. When used as described above, the name can present all of the various presentational issues due to lack of language information (such as font shaping in Chinese/Japanese/Korean) as well as those due to lack of base paragraph direction and bidirectional spillover effects.

Spillover effects can happen when text that has mixed left-to-right and right-to-left text are used in a larger sentence. This is particularly true for device labels because they often feature tokens such as brand names ("Dell", "HP", etc.), part numbers ("S2721H", "A157-B", etc.), device capabilities ("75 Hz", "4ms", etc.), or resolution (1024x768) that use ASCII letters, digits, and punctuation. This often leads to mixed direction names whose proper display depends on direction metadata.

To address this issue, you could either add a language and base direction field to the screen interface or you could add language and direction attributes to the label.