Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions _rules/element-lang-matches-default-language-off6ek.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ This `div` element has a `lang` [attribute value][] of `en` (English), which mat

This `span` element has a `lang` [attribute value][] of `fr` (French), which matches one of its [most common languages][most common language]. The most common languages are both English and French because all the words belong to both languages.

**Note**: The `body` element in HTML are optional and will be added by the browser.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Given that it seems there are only 2 examples in that rule without a body element (Passed Examples 4 and 5), I'd say it is simpler to add the body element to both rather than adding this note.


```html
<html lang="en">
<p>
Expand Down
2 changes: 1 addition & 1 deletion pages/glossary/default-page-language.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ input_aspects:
- Language
---

The _default language of a [web page][]_ is the [most common language][] of its [top-level browsing context](https://html.spec.whatwg.org/#top-level-browsing-context) [document][], if it is unique. If this [document][] has either no or several [most common languages][most common language], then it has no default language.
The _default language of a [web page][]_ is the [most common language][] of its [top-level browsing context](https://html.spec.whatwg.org/#top-level-browsing-context) [document][], if it is unique. If this [document][] has no [most common languages][most common language], then it has no default language.

For more details, see [examples of default language][].

Expand Down
2 changes: 1 addition & 1 deletion pages/glossary/most-common-language.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ input_aspects:
- Language
---

The _most common language of an element_ is determined by counting the number of _words_ in the [text inheriting its programmatic language][] from this element that are part of any of the languages in the [language subtag registry][]. The same word can be part of multiple languages. In case of ties, the element has several most common languages. If there are no words in the [text inheriting its programmatic language][] from the element, then it has no most common language.
The _most common language of an element_ is determined by counting the number of _words_ in the [text inheriting its programmatic language][] from this element that are part of any of the languages in the [language subtag registry][]. The same word can be part of multiple languages. In case of a tie, the first of the tied languages used in the text is the most common language. If there are no words in the [text inheriting its programmatic language][] from the element or the tie cannot be resolved, then it has no most common language.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This removes the possibility of having several most common languages (this is OK), but then the description of Passed Examples 4/5 of "HTML element language subtag matches language" (and maybe some other) need to be updated accordingly. They still read

This span element has a lang [attribute value][] of fr (French), which matches one of its [most common languages][most common language]. The most common languages are both English and French because all the words belong to both languages.

stating that there are 2 "most common languages".


For more details, see [examples of most common language][].

Expand Down