Page MenuHomePhabricator

Add aural "+" and "-" hints to unified diffs for users who use screenreaders
ClosedPublic

Authored by epriestley on Oct 20 2017, 5:45 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 12, 7:32 AM
Unknown Object (File)
Mon, Dec 9, 4:37 PM
Unknown Object (File)
Mon, Dec 9, 4:37 PM
Unknown Object (File)
Mon, Dec 9, 4:36 PM
Unknown Object (File)
Mon, Dec 9, 4:31 PM
Unknown Object (File)
Thu, Dec 5, 11:08 PM
Unknown Object (File)
Mon, Nov 25, 7:01 AM
Unknown Object (File)
Nov 21 2024, 12:40 AM
Subscribers
None

Details

Summary

See PHI160 for discussion.

Test Plan

With ?__aural__=1, saw aural hints:

Screen Shot 2017-10-20 at 10.41.22 AM.png (798×503 px, 110 KB)

Without, saw normal visual diff.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley created this revision.

Is it possible for this to cause unexpected line wraps by overflowing the diff pane?

This revision is now accepted and ready to land.Oct 20 2017, 6:00 PM

In ?__aural__=true mode all kind of crazy layout stuff can happen, but it's just for debugging.

In normal mode, we slap a bunch of CSS classes on this content which prevents it from affecting layout in any known browser or rendering scenario:

.aural-only {
  position: absolute !important;
  clip: rect(1px, 1px, 1px, 1px);

  /* NOTE: Without this, Safari sometimes lays these elements out at normal
     size. An example is the label on the comment action menu on timelines. */

  width: 0;
  height: 0;
  overflow: hidden;
}

This is consistent with recommendations from, e.g., WebAIM and generally standard practice.

It's possible that this ruleset isn't exhaustive and may require tuning at some point, but I don't anticipate any side effects in this case since I think it's a pretty standard one. We already make fairly regular use of aural-only and visual-only content without issues (you can access any page with ?__aural__=1 in the URL to have aural-only content shown in blue and visual-only content muted in transparent pink).

This revision was automatically updated to reflect the committed changes.