Problem/Motivation

Normally, when a screenreader user follows a link, a full page load happens, and the title of the new page is announced. (There may be some other incidental sounds, depending on the particular screenreader used.)

With RefreshLess, following a link does not cause a full page load, so the new page title is not announced, and the it's not obvious a new page has loaded.

Proposed resolution

This is the sort of thing Drupal.announce() Javascript API was created for, so lets use it.

  • Announce that a new page has loaded (or maybe finer grained, announce what regions have changed?)
  • Announce the name of the page.

Remaining tasks

User interface changes

Improvements to screenreader experience.

API changes

Unknown.

Data model changes

None expected.

Comments

andrewmacpherson created an issue. See original summary.

andrewmacpherson’s picture

Issue summary: View changes
wim leers’s picture

Priority: Normal » Major

+1, great point! :) I didn't even think about this. Thanks for bringing this up!

andrewmacpherson’s picture

Updating summary, point to correct issue about <head> element updates.

andrewmacpherson’s picture

Issue summary: View changes
mgifford’s picture

Issue tags: +Drupal.announce
wim leers’s picture

How do GitHub and BaseCamp deal with this? GitHub uses PJAX and BaseCamp uses a different implementation of TurboLinks.

If y could look into that and share your findings, that would be very valuable :)

Related: http://stackoverflow.com/questions/28282264/optimise-turbolinks-for-scre...

andrewmacpherson’s picture

First stab at a patch. This announces:

1) A new page has loaded
2) The first H1 found on the page

To test this, I generated a bunch of nodes and menu-links with devel_generate. It works fine as long as there is a H1. (It doesn't work when arriving at the homepage, where the H1 exists but is empty, meh. EDIT: this won't be an issue once the new <title> is available.)

The announcement is queued after the URL has been updated.

Once #2692317: Make everything in <head> update: <title>, <meta> tags, etc. is done, we can use the <title> element.

andrewmacpherson’s picture

@Wim, to clarify, is the intent of RefreshLess to provide the same eventual HTML DOM as you would have got by visiting that URL in the first place, and retrieved the page all in one go?

If so, I think we only need to announce the page title you would have got, prepended with a simple "new page" indication in place of any indication the screenreader normally makes for a new page. (ChromeVox has a special sound for a new page load). There's no need to be say anything more than that, I think.

Do you imagine any scenario with RefreshLess where this is not the case?

I'll have a play around with any other partial page load implementations I can find in the wild.

wim leers’s picture

Yes, that is the intent!

andrewmacpherson’s picture

StatusFileSize
new1.04 KB
new223 bytes

We need to include drupal.announce as a dependency of the refreshless library.

mgifford’s picture

Status: Active » Needs review
wim leers’s picture

Status: Needs review » Postponed

I'm working on #2692317: Make everything in <head> update: <title>, <meta> tags, etc., that will allow this to be solved once and for all, rather than getting this interim fix in first.

wim leers’s picture

Title: Announce new content to screenreader users when following RefreshLess links. » [PP-1] Announce new content to screenreader users when navigating using RefreshLess
wim leers’s picture

Note that the patch there is already working, I'm just cleaning it up.

andrewmacpherson’s picture

Title: [PP-1] Announce new content to screenreader users when navigating using RefreshLess » Announce new content to screenreader users when navigating using RefreshLess
Status: Postponed » Active
wim leers’s picture

Note that eventually this should probably happen in response to some event. But for now it's fine to hardcode this in the appropriate place.

wim leers’s picture

Status: Active » Needs review
StatusFileSize
new2.04 KB
wim leers’s picture

Status: Needs review » Reviewed & tested by the community

I think this is ready. Giving credit to everybody involved.

  • Wim Leers committed 4ba8f1e on 8.x-1.x
    Issue #2695777 by andrewmacpherson, Wim Leers, mgifford: Announce new...
wim leers’s picture

Status: Reviewed & tested by the community » Fixed
andrewmacpherson’s picture

Re: comment #7 (for completeness sake)...

I tried out a bunch of pjax/turbolinks type sites. I didn't manage to find any that made any accommodation for users with screen-readers.

The StackOverflow answer is in favour of an ARIA live region. It uses jQuery.a11yfy.assertiveAnnounce(document.title), which is really the same approach as our use of Drupal.announce(title, 'assertive');.

The only thing we've done differently is that we added an explicit "new page loaded" phrase, to accommodate some screenreaders which normally use a sound effect on new page loads. This was a judgement call on my part, and hopefully isn't intrusive.

wim leers’s picture

#22: Excellent! Many thanks for your research & analysis :)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.