Expose SVG drawings to assistive technology; implement TextArea trim - #1327
Merged
Conversation
An svg with no accessible name is announced shape by shape, and browsers exporting tagged PDF give every primitive its own structure element, so a chart arrives as dozens of anonymous figures instead of one described graphic. role defaults to img when ariaLabel is set. A name without a role is unreliable on a bare svg, and a role without a name is worse than neither: it hides whatever text the drawing contains and puts nothing in its place. Both default to undefined, so nothing changes for existing users.
A legend shape is a colour key whose meaning is already carried by the entry text beside it, so it is now hidden from assistive technology rather than announced as an unnamed graphic. shapeRole and shapeAriaLabel forward onto each shape's svg for callers that need it exposed, deriving role the same way Svg does. The two are mutually exclusive by construction: aria-hidden removes the element from the accessibility tree, which is also what a tagged PDF is built from, so a named shape must not carry it.
trim was excluded from TextAreaConfig and forced to false, so a textarea silently ignored it and a global TextField.prototype.trim never applied. It is applied to the commit that ends the edit rather than to intermediate input commits: trimming on every keystroke would strip whitespace the user is still typing, and in a multi-line field a trailing newline could never be entered at all. Whitespace inside the text is untouched; the visible text is synced so the field and the store agree.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three accessibility changes to how SVG drawings are exposed, plus a
TextAreafix found on the way.Svg:roleandariaLabelAn
svgwith no accessible name is announced shape by shape, and browsers exporting tagged PDF give every primitive its own structure element — a chart arrives as dozens of anonymous figures rather than one described graphic.roledefaults toimgwhenariaLabelis set. A name without a role is unreliable on a baresvg, and a role without a name is worse than neither: it hides whatever text the drawing contains and puts nothing in its place. Both default toundefined, so nothing changes for existing users.Legend: unnamed entry shapes are hiddenA legend shape is a colour key whose meaning is already carried by the entry text beside it, so it now carries
aria-hiddenrather than being announced as an unnamed graphic. This one is a behaviour change for existing consumers — worth a line in the release notes.shapeRoleandshapeAriaLabelforward onto each shape'ssvgfor callers that need it exposed instead, derivingrolethe same waySvgdoes. The two are mutually exclusive by construction:aria-hiddenremoves the element from the accessibility tree, which is also what a tagged PDF is built from, so a named shape must not carry it.TextArea:trimimplemented rather than omittedtrimwas excluded fromTextAreaConfigand forced tofalse, so a textarea silently ignored it and a globalTextField.prototype.trimnever applied to one.It applies to the commit that ends the edit, not to intermediate
inputcommits: trimming on every keystroke would strip whitespace the user is still typing, and in a multi-line field a trailing newline could never be entered at all. Whitespace inside the text is untouched, and the visible text is synced so the field and the store agree.