Interface UserSettings

The settings attribute of the Window interface MUST return an instance of the UserSettings interface. The same object must be returned each time.

DOMstring? valueForKey()

Description TBD (esp re: privacy and fingerprinting, and prompt access for certain parameters on a per-domain basis, similar to location sharing)

May need an additional "silent fail" parameter when keys are nice-to-have but not important enough to prompt if the user or platform specifies "prompt for access" to a particular key.

An undefined or empty value for the taxonomy parameter indicates the key matches a preference defined in User Settings Keys section of this document. Standard vendor prefixes (ie, moz, o, webkit) are reserved for the taxonomy parameter, and any additional implementation or external taxonomy identifiers will be defined in a supplemental, informative document.

						// example of a preference defined within the IndieUI User Context specification.
						window.settings.valueForKey('fontSize'); // e.g. '16px'
						window.settings.valueForKey('subtitles'); // e.g. returns true if the user wants to see subtitles or captions by default
						
						// example of an vendor-proposed preference, intended for standardization.
						window.settings.valueForKey('someVendorSpecificPreference', 'vendor');
						
					
DOMString key
Identifying key for the preference value to be returned.
optional DOMString? taxonomy
A unique string identifier for external taxonomy in which the key is defined, such as a vendor-prefix ('webkit') for vendor-proposed or implementation-specific keys, or another external taxonomy.

User Settings Keys

The different settings key groupings are intended to allow individual privacy restrictions for each group. We're still working on the best way to spec those privacy restrictions.

General Settings

Current thinking is that General Settings will not be restricted (by default) from the requesting page. Values of these settings are expected to change often, and would therefore be of little value for any purpose but the intended use.

DOMElement? pointOfRegard = null
Returns a DOM element that indicates the users current point-of-regard.

I am still hoping we'll come up with a better name than point-of-regard.

Indicates the user's focused point of attention, which make be the element under the mouse, in keyboard focus, or indicated by assistive technology such as eye tracking software or screen reader focus. Point-of-regard is similar to the concept of document.activeElement, and in the simple case of full keyboard access, it will likely stay in sync with document.activeElement.

This one may indicate too much about AT to remain in the general settings.

boolean? fullKeyboardAccess = null
Returns a boolean indicating whether the user's keyboard settings allow focusing all interactive elements (buttons, links, etc) by default. Note: The default non-null value will be true in most browsers.
boolean? invertColors = null
Returns a boolean indicating whether the display colors are currently inverted by the operating system or user agent. Web authors SHOULD NOT re-invert foreground and background colors based on this setting, but MAY choose to double-invert some content, such as photographs.
Type Settings

Type settings will not be restricted (by default) from the requesting page, primarily because a site can figure out all of this information using some creative CSS and JavaScript. These keys are therefore primarily intended as convenience accessors so that web authors can more easily provide adaptive interfaces that work well for all users.

DOMString? fontSize = null
Returns a string representing the user's current default font size of root element, prior to applying page styles. User Agents MUST return the value in a CSS pixel unit formatted string, e.g. '14px'
DOMString? fontSizeMinimum = null
Returns a string representing the user's minimum font size limit. User Agents MUST return the value in a CSS pixel unit formatted string, e.g. '9px'
DOMString? letterSpacing = null
Unit TBD; this should probably also be a calculated CSS pixel value equivalent to default or user value for CSS 'letter-spacing' property.
double? lineHeight = null
Returns a number as a unitless multiplier; equivalent to unitless 'Number' value for CSS 'line-height' property. e.g. 1.2, not '1.2em' or '12px'
DOMString? wordSpacing = null
Unit TBD; this should probably also be a calculated CSS pixel value equivalent to default or user value for CSS 'word-spacing' property.
Display Settings

TBD: Settings in this section will be subject to domain-specific privacy policy limiting initial access and prompting the user. TBD whether these keys may be accessed only on a user triggered event, as opposed to onload for example.

double? displayContrast = null
Returns a number value between -1.0 and 1.0, representing the software contrast setting of the user's operating system. A value of 0.0 represents no contrast modification to the display (normal), and 1.0 represents the highest possible contrast modification. A negative number (uncommon) represents a lower-than-average contrast. User Agents SHOULD NOT use a positive value to represent hardware display settings, as this value is reserved for assistive contrast modes. User Agents MAY use a negative value to represent lower-than-average contrast in a hardware display.
boolean? displayGrayscale = null
Returns a boolean value representing whether the user's video display is currently set to only display in grayscale (true) or displays full color (false).
boolean? displayLightOnDark = null
Returns a boolean representing a user's preference for lightly colored foreground text on a darkly colored background.

I am concerned that this one will be confused with the general 'invertColors' setting.

Media Alternative Settings (Subtitles, etc.)

TBD: Settings in this section will be subject to domain-specific privacy policy limiting initial access and prompting the user. TBD whether these keys may be accessed only on a user triggered event, as opposed to onload for example.

boolean? subtitle = null
Returns a boolean value indicating whether subtitles or captions are displayed (true) or not displayed (false) in native video players. Web authors using a native video player SHOULD allow subtitles to be displayed natively. Web authors using a custom caption display SHOULD display captions based on this setting.
DOMString? subtitleLanguages = null
Returns a string of languages in order of preference. Users Agents MUST format the string as a space-separated list of ISO-639 language codes, that may be optionally hyphenated to include ISO-3166 country codes. For example, a native Mexican Spanish speaker living in the United States may have a language preference of "es-mx es en-us en" indicating a preference order for Mexican Spanish, any Spanish, US English, and finally any English dialect.
DOMString? subtitleType = null
Returns a string of type of subtitles or captions in order of preference: Users Agents MUST format the string as a space-separated list of the following tokens: sdh, cc, or standard.

This key is necessary to indicate a preference for subtitles for the deaf and hard of hearing (SDH) over standard spoken-language-only subtitles, but the preference for closed-captions (CC) versus SDH may not be necessary. SDH appears to be generally preferred over CC when available, and a preference for SDH could indicate an implicit preference for CC over standard when CC is available but SDH is not.

boolean? transcript = null
Returns a boolean indicating a user's preference to be presented with a transcript if available. Web authors MAY provide concatenated subtitles in static form, if no other transcript exists.

There is some concern within the working group regarding this preference because no known operating system or user agent currently includes a way for a user to set this preference. The IndieUI working group is actively seeking comment on the perceived necessity or feasibility of this preference. It may be that this is already covered by WCAG 2.0 SC 1.2.1 which indicates sites should offer transcripts when available.

boolean? signLanguage = null
Returns a boolean indicates a user's preference to be presented with a video of sign language if available.

Do we need a language order preference for type of sign? ASL, etc? Worried this feature will be at-risk due to lack of available signed alternatives.

boolean? audioDescription = null
Returns a boolean indicates a user's preference to be presented with an alternate or supplemental audio track describing the information presented visually.
Screen Reader Settings

TBD: Settings in this section will be subject to domain-specific privacy policy limiting initial access and prompting the user. TBD whether these keys may be accessed only on a user triggered event, as opposed to onload for example.

boolean? screenReaderActive = null
Returns a boolean indicating whether or not a screen reader is currently active or in use. The user agent MUST return true if a screen reader is running, or false otherwise. User agents MAY return a null value if the user has chosen to disallow sharing screen reader information with the requesting domain.
DOMString? screenReaderName = null
Returns a string representing the application name of the screen reader in use. The user agent MUST return either an empty string or a string representing the name of the screen reader in detail, e.g. "Apple VoiceOver". User agents MAY return a null value if the user has chosen to disallow sharing screen reader information with the requesting domain.
DOMString? screenReaderVersion = null
Returns a string representing the application version of the screen reader in use. The user agent MUST return either an empty string or a string representing the version of the screen reader in detail, e.g. "4.0 (220.2)". User agents MAY return a null value if the user has chosen to disallow sharing screen reader information with the requesting domain.

Assistive Technology Identification and Notification

Most of this section is out-of-date. Please don't put too much effort into change requests yet.

In certain cases, it is beneficial for web authors to be aware of the assistive technology in use. This section defines a collection of attributes that can be used to determine, from script, the kind of assistive technology in use, in order to be aware of considerations for a particular assistive technology, including the need to support the UI Change Request Events or Accessibility Events defined in previous sections. Web authors should always limit client detection to detecting known versions. Web authors should always assume future versions and unknown versions to be fully compliant.

The accessibility attribute of the Navigator interface must return an instance of the Accessibility interface, which represents the identity and state of the assistive technology, and allows web pages to optionally notify assistive technology of certain interface events that cannot be indicated through declarative markup such as WAI-ARIA roles, states, and properties.

interface Accessibility {
  readonly attribute InterfaceObject accessibility; // Editorial Note: Is it necessary to define this attribute in the IDL?
  // objects implementing the Accessibility interface also implement the ScreenReader and AccessibilityNotifications interfaces
};
Accessibility implements AccessibilityNotifications;
Accessibility implements ScreenReader;
Accessibility implements Magnifier;
Accessibility implements Speech;

[Supplemental, NoInterfaceObject]
interface AccessibilityNotifications {
	
	const unsigned short    screenChanged   = 1;
	const unsigned short    elementChanged  = 2;
	
  void postNotification(required String notification, optional HTMLElement element);
};

Methods for Interface Accessibility

window.accessibility.postNotification()

Returns void. Allows the web author to send a required or supplemental notification, usually to inform the assistive technology to update its cache of the accessibility tree. For example, web authors might call this method after an animation has completed, allowing a screen reader to update its cursor location, if the focused element was moved.

Note: screenChanged should be fired for full screen DOM-based refreshes. elementChanged is sufficient for significant branch node changes.

Interface ScreenReader

The screenreader attribute of the Accessibility interface must return an instance of the ScreenReader interface:

interface ScreenReader {
  readonly attribute InterfaceObject screenreader; // Editorial Note: Is it necessary to define this attribute in the IDL?
  // objects implementing the ScreenReader interface also implement the interfaces given below
};
ScreenReader implements ScreenReaderID;
ScreenReader implements ScreenReaderStatus;

[Supplemental, NoInterfaceObject]
interface ScreenReaderID {
  readonly attribute DOMString name;
  readonly attribute DOMString version;
};

[Supplemental, NoInterfaceObject]
interface ScreenReaderStatus {
  readonly attribute boolean active;
};

Properties for Interface ScreenReader

window.accessibility.screenreader.active
Returns a boolean indicating whether or not a screen reader is in use. The user agent must return true if a screen reader is running, or false otherwise. User agents may return false if the user has chosen to disallow sharing this information with the requesting domain.
window.accessibility.screenreader.activeElement
@@
window.accessibility.screenreader.name
Returns the application name of the screen reader in use. The user agent must return either an empty string or a string representing the name of the screen reader in detail, e.g. "Apple VoiceOver". User agents may return an empty string if the user has chosen to disallow sharing this information with the requesting domain.
window.accessibility.screenreader.version
Returns the application version of the screen reader in use. The user agent must return either an empty string or a string representing the version of the screen reader in detail, e.g. "4.0 (220.2)". User agents may return an empty string if the user has chosen to disallow sharing this information with the requesting domain.

Note: The authors recommend that user agents adopt a domain-level security policy for the ScreenReader interface that is similar to the security policy for location data or cookies. A user should be able to explicitly disallow sharing of this information altogether, or on a per-domain basis.

Interface Magnifier

The magnifier attribute of the Accessibility interface must return an instance of the Magnifier interface:

interface Magnifier {
  readonly attribute InterfaceObject magnifier; // Editorial Note: Is it necessary to define this attribute in the IDL?
  // objects implementing the Magnifier interface also implement the interfaces given below
};
Magnifier implements MagnifierID;
Magnifier implements MagnifierStatus;
Magnifier implements MagnifierNotifications;

[Supplemental, NoInterfaceObject]
interface MagnifierID {
  readonly attribute DOMString name;
  readonly attribute DOMString version;
};

[Supplemental, NoInterfaceObject]
interface MagnifierStatus {
  readonly attribute boolean active;
  readonly attribute float   zoom;
};

[Supplemental, NoInterfaceObject]
interface MagnifierNotifications {
  // Editorial Note: I'm not partial to the method name focusPosition. Any other suggestions?
  void focusPosition(
         in DOMElement element,
         in optional array cursorRect,
         in optional array selectionPolygon
       );
};

Properties for Interface Magnifier

window.accessibility.magnifier.active
Returns a boolean indicating whether or not a screen magnifier is in use. The user agent must return true if a screen magnifier is enabled (even if the current zoom level is 1.0), or false if a magnifier is not enabled. User agents may return false if the user has chosen to disallow sharing this information with the requesting domain.
window.accessibility.magnifier.name
Returns the application name of the screen magnifier in use. The user agent must return either an empty string or a string representing the name of the screen magnifier in detail, e.g. "Apple Universal Access Zoom". User agents may return an empty string if the user has chosen to disallow sharing this information with the requesting domain.
window.accessibility.magnifier.version
Returns the application version of the screen magnifier in use. The user agent must return either an empty string or a string representing the version of the screen magnifier in detail, e.g. "4.0 (220.2)". User agents may return an empty string if the user has chosen to disallow sharing this information with the requesting domain.
window.accessibility.magnifier.zoom
Returns a floating point number indicating the current magnification level of the screen magnifier. The user agent must return 1.0 or the current magnification level. User agents may return 1.0 if the user has chosen to disallow sharing this information with the requesting domain.

Methods for Interface Magnifier

window.accessibility.magnifier.focusPosition ( element, cursorRect, selectionPolygon )

Returns void. Allows the web author to send an explicit notification informing the screen magnifier to update its cache of the cursor location. Web authors should call this method when updating the display or cursor position of custom views.

Parameters for Magnifier.focusPosition
1. DOMElement element
Required reference to the element (e.g. canvas) that has focus.
2. optional array cursorRect
Optional array representing the rectangular cursor location relative to the [0,0] position of focused element. [ x1, y1, x2, y2 ]
3. optional array selectionPolygon
Optional array representing the selection polygon relative to the [0,0] position of focused element. [ x1, y1, x2, y2, ... xn, yn ]

Editorial Note: It may be better if the optional params are shape objects with a coords array and a type string like 'rect' or 'poly'. That would allow the author to decide if they wanted to provide the extra polygon coords, or just use a simple shape.

Note: The focusPosition() method would be necessary for screen magnifiers to work with canvas-based web apps like Bespin or the 280 North projects. This method is not necessary for text views managed by the user agent, including contentEditable views.

Interface Speech

The speech attribute of the Accessibility interface must return an instance of the Speech interface:

interface Speech {
  // TBD, placeholder for speech-controlled user agents or assistive technology
  // may need speech.synthesis and speech.recognition; each could have name/version/engine, etc. 
  // potential method: speech.synthesis.speak() to trigger TTS from web app
  // potential method: speech.recognition.updateDictionary() to capture correct pronunciation of uncommon or app-specific words
};

Accessibility Events

Interface AccessibilityEvent

It's possible this will not need an AccessibilityEvent interface, as this is more-or-less equivalent to UIEvent at the moment.

The following events are usually initiated by assistive technologies or system , as opposed to mainstream user agents. These events are standard notification events and inherit from UIEvent, not UIRequestEvent.

Probably need a normative author requirement here stating authors MUST NOT update the visible view based on these events, unless the focused element is entirely out of view. Include example of where this is harmful.

We might also need an AT equivalent of document.activeElement.

AccessibilityEvent Types

The different types of AccessibilityEvents that can occur are:

Assistive Technology Focus atfocus

Initiated when the assistive technology cursor or point-of-regard moves to a particular DOM node.

  • Bubbles: Yes
  • Cancelable: No
Assistive Technology Blur atblur

Initiated when the assistive technology cursor or point-of-regard leaves a particular DOM node.

  • Bubbles: Yes
  • Cancelable: No