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

Clarify focus management for SVG & define rendered/non-rendered elements #55

Merged
merged 5 commits into from Mar 12, 2016
Merged

Clarify focus management for SVG & define rendered/non-rendered elements #55

merged 5 commits into from Mar 12, 2016

Conversation

AmeliaBR
Copy link
Contributor

@AmeliaBR AmeliaBR commented Mar 2, 2016

This pull request consists of two new sections, at least one of which (focus management) needs discussion & approval by the working group because it's introducing new normative requirements. Links are to compiled versions of the specs.

Rendering definitions:

Shouldn't be controversial. Gathers up content and implicit behavior into clear definitions. Some links/bookmarks in other specs may be broken by moving the section on display/visibility properties to the rendering chapter from the painting chapter.

Focus management

Addresses the issues brought up by @richschwer in Issue #50.

Introduces the following normative requirements (based on usability problems in current implementations of keyboard focus control in SVG):

  • User agents SHOULD apply visible focus styles. I've worded it to allow these styles to only be applied when the focus is changed based on keyboard input, to match current behavior in e.g. Blink. With that limitation, I'd be happy to upgrade the main requirement to "MUST".
  • Interactive elements MUST be focusable by default, except I added in an exception for platform conventions for links (to support the Presto behavior of having a separate link-focus sequence distinct from the main tabindex). Suggestions for re-wording/clarifying that distinction welcome.
  • User agents SHOULD support the SVG Tiny 1.2 focusable attribute, but authors should not use it. I wouldn't object to downgrading "should" to "may", but I don't think it would be a large implementation burden to add.
  • User agents SHOULD scroll/pan focused elements into view, if scrolling or panning is supported for the document.

In addition, I've added a few important clarifications / consequences which aren't new requirements (in some cases, text is directly copied from HTML) but are relevant to SVG authors:

  • :focus can be used to change focus styles, but SHOULD NOT be used to remove visual focus indicators
  • Non-rendered elements can never receive focus, but (based on the newly-clarified definitions of rendered elements) an invisible element is rendered and may receive focus. This allows invisible elements that are clickable because of the SVG options for pointer-events to also be keyboard-operable.
  • An element made focusable with tabindex should issue a click event on keyboard activation.

- incorporates the visibility/display section formerly in the Painting chapter
- introduces new definitions and element categories (renderable versus never-rendered elements)
- Clean up & re-organize rendering tree definitions from previous commit
- Expand and clarify how HTML keyboard focus model applies to SVG

The keyboard focus section:

- Includes normative requirements for which SVG elements should be focusable by default,
  with a little wiggle room for the Opera Presto behavior of treating links separately
  rather than as part of the main tab index.

- Includes a normative requirement that user agents visually render keyboard focus.

- Includes mention of the SVG Tiny 1.2 `focusable` attribute
with recommendations that user agents support it (for the `true` value) but
authors not use it.

- Explicitly repeats (from HTML) the expectations that focused element should scroll into view
and that a generic focusable element will fire a `click` event
in response to the normal keyboard activation process.
Fixing broken links & unrecognized terms
- lowercase RFC keywords, cause apparently that's how we roll in SVG WG. No need to shout to prove we're serious.
- mark the Rendering Tree section as ready for WG review
AmeliaBR added a commit that referenced this pull request Mar 12, 2016
Clarify focus management for SVG & define rendered/non-rendered elements
@AmeliaBR AmeliaBR merged commit e27192a into w3c:master Mar 12, 2016
@AmeliaBR AmeliaBR deleted the rendering-defs branch March 12, 2016 02:08
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

2 participants