Closed Bug 1843227 Opened 11 months ago Closed 10 months ago

Accessible::ScrollTo SCROLL_TYPE_ANYWHERE doesn't trigger infinite scroll on YouTube video lists

Categories

(Core :: Disability Access APIs, defect)

defect

Tracking

()

RESOLVED FIXED
118 Branch
Webcompat Priority P1
Tracking Status
relnote-firefox --- 117+
firefox116 --- wontfix
firefox117 --- fixed
firefox118 --- fixed

People

(Reporter: Jamie, Assigned: Jamie)

References

Details

Attachments

(1 file)

Spun off bug 1818126.

STR (with the NVDA screen reader):

  1. Open this page: https://www.youtube.com/@LGR/videos
  2. Wait a few seconds for the page to load.
  3. Press control+end to move to the bottom of the document.
  4. Wait a few seconds for the page to scroll.
  5. Press h to move to the next video.
    • Expected: NVDA reports the next video heading.
    • Actual: NVDA says "no next heading"

Impact: This makes it impossible for keyboard and screen reader users to scroll to earlier videos that aren't initially rendered.

Chrome does not have this problem with YouTube on Windows.

This was addressed for the tab key in bug 1818126 and it will likely be addressed for other methods of focus in bug 1842679. However, screen reader review cursors (e.g. NVDA browse mode) don't necessarily focus as the user moves, so fixing focus doesn't deal with this. The tab key fix at least serves as a workaround.

The fix for the tab key was to use WhereToScroll::Center instead of WhereToScroll::Nearest. To do this for a11y, we'd need to make a similar change for SCROLL_TYPE_ANYWHERE.

One concern is that we define SCROLL_TYPE_ANYWHERE as:

Scroll an object the minimum amount necessary in order for the entire frame to be visible (if possible).

Center would not be "the minimum amount necessary". However, ATK_SCROLL_ANYWHERE is defined as:

Scroll the object vertically and horizontally so that as much as possible of the object becomes visible. The exact placement is determined by the application.

And IA2_SCROLL_TYPE_ANYWHERE is defined as:

Scroll the object or substring such that as much as possible of the object or substring is within the top level window. The placement of the object is dependent on the application.

Android and Mac also use SCROLL_TYPE_ANYWHERE, but I'm not sure what the expectations are there.

If I'm reading the code right, Chrome already scrolls to centre for Windows IA2_SCROLL_TYPE_ANYWHERE and when scrolling on Mac. I'm a little less certain about Chrome on Android, as it even though it defaults to centre alignment, it also passes a rect and I'm not sure what impact that has.

This NVDA issue comment points out the inconsistency between Firefox and Chrome regarding where they scroll.

My feeling is that we should change SCROLL_TYPE_ANYWHERE to scroll to centre, which solves both the YouTube problem and the browser inconsistency.

Eitan, can you comment on the scrolling behaviour for Mac and Android? Would changing them to scroll to centre when not visible be problematic for users? Am I correct that this is what Chrome does on both platforms?

Flags: needinfo?(eitan)

(In reply to James Teh [:Jamie] from comment #1)

Eitan, can you comment on the scrolling behaviour for Mac and Android? Would changing them to scroll to centre when not visible be problematic for users? Am I correct that this is what Chrome does on both platforms?

You are right that Safari and Chrome in MacOS and Chrome in Android indeed to scroll the item to the center of the screen. This is honestly surprising to me but seems like a good behavior to emulate. It does eliminate some weirdness we have when we scroll in Android with the bottom toolbar being where it is.

Flags: needinfo?(eitan)

Not sure if inconsistent cross-browser support for accessibility APIs on popular websites classifies as a web compat issue, but flagging just in case.

Webcompat Priority: --- → ?

(In reply to James Teh [:Jamie] from comment #3)

support for accessibility APIs on popular websites classifies as a web compat issue

Good question, we haven't really had to have a formal opinion on that, yet.

If we understand this correctly, this bug makes YouTube significantly harder to use for people who rely on the accessibility APIs. We would this consider "breaking a site in a critical way", and we consider YouTube "a very important site", so this is a P1. One could argue that only a subset of our users are affected by this, but since this bug is already filed in the Accessibility component, let's treat this as a WebCompat P1 for now.

Webcompat Priority: ? → P1

The severity field for this bug is set to S3. However, this bug has a P1 WebCompat priority.
:Jamie, could you consider increasing the severity of this web compatibility bug?

For more information, please visit BugBot documentation.

Flags: needinfo?(jteh)
Severity: S3 → S2
Flags: needinfo?(jteh)
Assignee: nobody → jteh

This is consistent with other browsers and thus more web compatible.
In particular, it makes infinite scroll work correctly on YouTube (e.g. when scrolling with screen readers), which didn't work previously.

Release Note Request (optional, but appreciated)
[Why is this notable]: This fixes infinite scrolling on YouTube with a screen reader.
[Affects Firefox for Android]: yes
[Suggested wording]: YouTube video lists now scroll correctly when navigating with a screen reader.
[Links (documentation, blog post, etc)]: None

relnote-firefox: --- → ?
Pushed by jteh@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/78dee4ec9d82
When scrolling with nsIAccessibleScrollType::SCROLL_TYPE_ANYWHERE, scroll to center instead of nearest. r=eeejay
Status: NEW → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → 118 Branch

The patch landed in nightly and beta is affected.
:Jamie, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox117 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(jteh)

:jamie do you plan on adding a beta uplift request on this or let it ride the trains with 118?
(This will dictate where we put the release note)

I plan on an uplift. I'll do that today.

Comment on attachment 9347588 [details]
Bug 1843227: When scrolling with nsIAccessibleScrollType::SCROLL_TYPE_ANYWHERE, scroll to center instead of nearest.

Beta/Release Uplift Approval Request

  • User impact if declined: Screen reader users can't scroll to access further videos in YouTube video lists.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Isolated change which does notably change our behaviour but makes it more consistent with other browsers. Covered by automated test.
  • String changes made/needed:
  • Is Android affected?: Yes
Flags: needinfo?(jteh)
Attachment #9347588 - Flags: approval-mozilla-beta?

Comment on attachment 9347588 [details]
Bug 1843227: When scrolling with nsIAccessibleScrollType::SCROLL_TYPE_ANYWHERE, scroll to center instead of nearest.

Approved for 117.0b6

Attachment #9347588 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Blocks: 1853741
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: