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

Determine if pdf.js accessibility can be tested with WPT and/or Acacia #147

Open
cookiecrook opened this issue Oct 7, 2024 · 4 comments

Comments

@cookiecrook
Copy link
Collaborator

I've got an ARIA action to migrate the PDF role mappings (currently a private Google Doc) into an official AAM doc, as a joint deliverable of W3C and PDFA.

So it occurred to me we might be able to test the web implementation of roles and labels (more?) using Mozilla's PDF.js renderer.

Seems like a good standalone task for a future Accessibility Investigation effort.

@cookiecrook cookiecrook changed the title Determine if pdf.js accessibility can be tested with WPT Determine if pdf.js accessibility can be tested with WPT and/or Acacia Oct 21, 2024
@cookiecrook
Copy link
Collaborator Author

FYI @spectranaut and @alice since Acacia testing of PDF may also be possible.

@jcsteh
Copy link

jcsteh commented Nov 5, 2024

This seems workable. A few thoughts:

  1. pdf.js probably doesn't support all PDF tags yet. Of course, that would be a real bug for users, but I mention it because I don't think we could say it's fully ready as a reference implementation yet.
  2. pdf.js doesn't load the entire PDF document in one go. Rather, it loads pages on demand when you scroll to them. That could cause some challenges for multi page PDF documents. I'm not sure if there's a way to force load the entire document for testing purposes or not. I guess pdf.js probably has to deal with this in its own tests, so we might be able to borrow a solution.
  3. I'm not certain, but I'm guessing even the initial page is loaded after the DOM is first populated. If so, we'll need some way to wait for it to be ready. Again, pdf.js tests might provide inspiration for this.

All of that said, we could certainly bring in some pdf.js folks to help guide us in the right direction.

@jcsteh
Copy link

jcsteh commented Nov 5, 2024

I was discussing this with @zcorpan and two other things came up:

  1. If we wanted to write the test assertions using the JS WPT framework, we'd likely need to load pdf.js into the test document, rather than embedding it as an iframe or similar. Otherwise, we'll probably run into issues accessing stuff we need in the iframe.
  2. Because we're effectively exercising pdf.js rather than the browser, it may not make sense to test this in multiple browsers. Of course, any bugs in the browser's accessibility implementation will impact pdf.js, but those should be caught by HTML and ARIA WPT tests for that browser.

@zcorpan
Copy link
Member

zcorpan commented Nov 5, 2024

If we wanted to write the test assertions using the JS WPT framework, we'd likely need to load pdf.js into the test document, rather than embedding it as an iframe or similar. Otherwise, we'll probably run into issues accessing stuff we need in the iframe.

To clarify, the point it that we can't use Firefox's built-in pdf.js because such content is not reachable by author-level JS. The test needs to run pdf.js itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants