Skip to content

Update rules mapping for SC 3.1.1 Language of Page to address empty content [bf051a, ucwvc8, b5c3f8]#2407

Open
giacomo-petri wants to merge 8 commits intodevelopfrom
giacomo-petri-lang-rules-update
Open

Update rules mapping for SC 3.1.1 Language of Page to address empty content [bf051a, ucwvc8, b5c3f8]#2407
giacomo-petri wants to merge 8 commits intodevelopfrom
giacomo-petri-lang-rules-update

Conversation

@giacomo-petri
Copy link
Copy Markdown
Collaborator

Closes issue(s): #2406

This PR introduces a new exception to the rules mapping for SC 3.1.1 Language of Page, ensuring that pages with no content are treated as an exception, since there is no lang to communicate to the user.

Need for Call for Review:
This will require a 2 weeks Call for Review


How to Review And Approve

  • Go to the “Files changed” tab
  • Here you will have the option to leave comments on different lines.
  • Once the review is completed, find the “Review changes” button in the top right, select “Approve” (if you are really confident in the rule) or "Request changes" and click “Submit review”.
  • Make sure to also review the proposed Call for Review period. In case of disagreement, the longer period wins.

@giacomo-petri giacomo-petri self-assigned this Apr 16, 2026
@giacomo-petri giacomo-petri added Rule Update Use this label for an existing rule that is being updated reviewers wanted labels Apr 16, 2026
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 16, 2026

Deploy Preview for act-rules ready!

Name Link
🔨 Latest commit 22859b0
🔍 Latest deploy log https://app.netlify.com/projects/act-rules/deploys/69e0b6a3fd722c0008c358f6
😎 Deploy Preview https://deploy-preview-2407--act-rules.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@giacomo-petri giacomo-petri requested a review from Jym77 April 16, 2026 10:10
Copy link
Copy Markdown
Collaborator

@Jym77 Jym77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. We can tighten it a bit with existing definition.

- is in a [top-level browsing context](https://html.spec.whatwg.org/#top-level-browsing-context); and
- has a [node document](https://dom.spec.whatwg.org/#concept-node-document) with a [content type](https://dom.spec.whatwg.org/#concept-document-content-type) of `text/html`.
- has a [node document](https://dom.spec.whatwg.org/#concept-node-document) with a [content type](https://dom.spec.whatwg.org/#concept-document-content-type) of `text/html`; and
- has at least one [descendant](https://dom.spec.whatwg.org/#concept-tree-descendant) [text node][] which is neither empty nor only [whitespace][]..
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: Shouldn't the rule also apply if there is only replaced content that needs language (alt text of images, …)?
Maybe use "there is some text inheriting its programmatic language from the document element, which is neither empty nor only whitespace." like in the "element's lang" rule.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I had considered that but then forgot about it. And the reason why is that for 3.1.2 rules, the assumption is that the HTML has a lang defined. If no language is set, it becomes tricky. I'll think about how to handle that and how to address the problem of "equivalent" text.

- The [document element][] has a [content type][] of `text/html`; and
- The [document element][] has a defined [default page language][].
- The [document element][] has a defined [default page language][]; and
- The [document element][] has at least one [descendant](https://dom.spec.whatwg.org/#concept-tree-descendant) [text node][] which is neither empty nor only [whitespace][].
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same remark about having "text inheriting the language".

- is in a [top-level browsing context](https://html.spec.whatwg.org/#top-level-browsing-context); and
- has a [node document](https://dom.spec.whatwg.org/#concept-node-document) with a [content type](https://dom.spec.whatwg.org/#concept-document-content-type) of `text/html`.
- has a [node document](https://dom.spec.whatwg.org/#concept-node-document) with a [content type](https://dom.spec.whatwg.org/#concept-document-content-type) of `text/html`; and
- has at least one [descendant](https://dom.spec.whatwg.org/#concept-tree-descendant) [text node][] which is neither empty nor only [whitespace][].
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same remark about "text inheriting the language".

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

Labels

Rule Update Use this label for an existing rule that is being updated

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants