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

4.1.1 and shadow DOM / iframes #2178

Open
JAWS-test opened this issue Jan 12, 2022 · 5 comments
Open

4.1.1 and shadow DOM / iframes #2178

JAWS-test opened this issue Jan 12, 2022 · 5 comments

Comments

@JAWS-test
Copy link

JAWS-test commented Jan 12, 2022

4.1.1 requires that I validate the syntax. To do this, I can send the source code, DOM or URL to the validator. However, iFrames and the shadow DOM of custom elements are not validated. Am I expected to find all iframes and custom elements with shadow DOM and validate them individually?

Even if I do that, I may not get correct results for nested elements. For example, if I have a table tag in the DOM of the page, but the individual tr and td tags in the shadow DOM (I suppose this is technically possible).

(Alternative suggestion: remove 4.1.1).

@alastc
Copy link
Contributor

alastc commented Jan 12, 2022

If you use the browser inspector and copy out the DOM from there, I think that includes iframes. Does it include shadow-DOMs?

@scottaohara
Copy link
Member

you can turn on the ability to view shadow dom with browser dev tools and then grab that content as necessary.

@JAWS-test
Copy link
Author

@alastc

When I copy the DOM, the content of iFrames and shadow DOM is not copied. This is also true when I validate the URL of a page. I already wrote that in the initial comment.

If it were otherwise (i.e. if the DOM of the page and the DOM of the iframes or custom elements are validated together), the validation would not work, because, for example, duplicate IDs could occur (page and iframe or shadow DOM are in their own DOM and may therefore use the same IDs).

@scottaohara

Of course, I can check each iFrame and each shadow DOM individually (I also wrote that in the initial comment). The question is:

  • Who does that? If not everyone who tests according to WCAG always copies and tests all iFrames and shadow DOMs individually, the test according to 4.1.1 is worthless.
  • Does this work for nested elements if one part is in the DOM and one part is in the shadow DOM (I also addressed this question above).

@scottaohara
Copy link
Member

I was responding to indicate it’s possible.
I did not say it was practical.

@JAWS-test
Copy link
Author

Hi @scottaohara ,
I suspect this is a misunderstanding. That it is possible is clear to me. My question was about that: "Am I expected to find all iframes and custom elements with shadow DOM and validate them individually?"

And the 2nd question was: Is the test useful with custom elements, as the source code may not be valid, but only valid in interaction with the surrounding page? But I am not sure if it is technically possible that custom elements contain incomplete source code (as described in the table example)

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