diff --git a/methods/html-lang-attribute/background.html b/methods/html-lang-attribute/background.html new file mode 100644 index 00000000..50f604c1 --- /dev/null +++ b/methods/html-lang-attribute/background.html @@ -0,0 +1,43 @@ + + + + Method - Background + + +
+

Background

+
+
+
+

W3C Resources

+ +
+
+

Non-W3C Resources

+ +
+
+

Accessibility Support

+

There are differences in how assistive technologies handle unknown and invalid language tags. Some will default to the language of the page, whereas others will default to the closest ancestor with a valid lang attribute. Languages with no known pronunciation such as Latin are exempt from this method and outcome. A page written in Haryanvi can not correctly be pronounced by major screen readers. Haryanvi is not considered an accessibility supported language.

+ +

Since most assistive technologies will consistently use lang over xml:lang when both are used, violation of this method may not necessarily be a violation of the outcome. Only when there are inconsistencies between assistive technologies as to which attribute is used to determine the language does this lead to a violation of the Changes to Natural Language outcome.

+
+
+

Assumptions

+ +
+
+ + \ No newline at end of file diff --git a/methods/html-lang-attribute/examples.html b/methods/html-lang-attribute/examples.html new file mode 100644 index 00000000..131c0700 --- /dev/null +++ b/methods/html-lang-attribute/examples.html @@ -0,0 +1,49 @@ + + + + Method - Examples + + +
+

Examples

+
+
+ +
+

Passed

+
+

{Example Name}

+ {Use a copy of this section for each example if not using a bullet list of examples} +

{explanation}

+
+< 
+
+
+
+
+

Failed

+
+

{Example Name}

+ {Use a copy of this section for each example if not using a bullet list of examples} +

{explanation}

+
+< 
+
+
+
+
+

Inapplicable

+
+

{Example Name}

+ {Use a copy of this section for each example if not using a bullet list of examples} +

{explanation}

+
+< 
+
+
+
+
+ + \ No newline at end of file diff --git a/methods/html-lang-attribute/glossary.html b/methods/html-lang-attribute/glossary.html new file mode 100644 index 00000000..4545a8ae --- /dev/null +++ b/methods/html-lang-attribute/glossary.html @@ -0,0 +1,105 @@ + + + + Method - Glossary + + +
+

Glossary

+
+
+

This section does not use plain language for non-technical users. The technical descriptions are precise language primarily for test tool developers.

+
+

ASCII Whitespace

+

ASCII whitespace is U+0009 TAB, U+000A LF, U+000C FF, U+000D CR, or U+0020 SPACE

+
+
+

Assistive Technology

+

Hardware and/or software that acts as a user agent, or along with a mainstream user agent, to provide functionality to meet the requirements of users with disabilities that go beyond those offered by mainstream user agents.

+
+
+

Attribute Value

+

The attribute value of a content attribute set on an HTML element is the value that the attribute gets after being parsed and computed according to specifications. It may differ from the value that is actually written in the HTML code due to trimming whitespace or non-digits characters, default values, or case-insensitivity.

+

Some notable case of attribute value, among others:

+ +

This list is not exhaustive, and only serves as an illustration for some of the most common cases.

+

The attribute value of an IDL attribute is the value returned on getting it. Note that when an IDL attribute reflects a content attribute, they have the same attribute value.

+
+
+

Block of Text

+

Any natural language text, including alternative text, that starts on a new line and ends with a hard line break is a block of text. Each of the following are examples of a Block of Text: a paragraph, each item in a multi-line list, lines in a block of code, each cell in a table.

+

Any natural language text, including alternative text, that isn’t part of a larger sentence. A block of text starts on a new line and ends with the line break. Examples include paragraphs, large quotations, lists, buttons, table cells. Quotations inside a paragraph or links inside sentences are not blocks of text. A paragraph broken by a line break (
) would be two blocks of text. A poem would be a block of text for every line. A definition list could be on one line on a wide screen could be one block of text and one the narrow screen it would be two blocks of text.

+
+
+

Content Type

+

Each document has an associated encoding (an encoding), content type (a string), URL (a URL), origin (an origin), type ("xml" or "html"), and mode ("no-quirks", "quirks", or "limited-quirks"). [ENCODING] [URL] [HTML]

+

Unless stated otherwise, a document’s encoding is the utf-8 encoding, content type is "application/xml", document URL is "about:blank", document origin is an opaque origin, type is "xml", and its document mode is "no-quirks".

+

A document is said to be an XML document if its document type is "xml"; otherwise an HTML document. Whether a document is an HTML document or an XML document affects the behavior of certain APIs.

+

A document is said to be in no-quirks mode if its mode is "no-quirks", quirks mode if its document mode is "quirks", and limited-quirks mode if its document mode is "limited-quirks".

+
+
+

Default Page Language

+

The default language of a web page is the most common language of its top-level browsing context document, if it is unique. If this document has either no or several most common languages, then it has no default language.

+
+
+

Document Element

+

The document element of a document is the element whose parent is that document, if it exists; otherwise null.

+
+
+

Flat Tree

+

While Selectors operate on the DOM tree as the host language presents it, with separate trees that are unreachable via the standard parent/child relationship, the rest of CSS needs a single unified tree structure to work with. This is called the flattened element tree (or flat tree).

+
+
+

Inclusive Descendent

+

An inclusive descendant is an object or one of its descendants.

+
+
+

Natural Language

+

Natural Language (sometimes just language) refers to the spoken, written, or signed communications used by human beings. From Internationalization Glossary

+
+
+

Node Document

+

Each node has an associated node document, set upon creation, that is a document.

+
+
+

Text

+

A sequence of characters that can be programmatically determined, where the sequence is expressing something in natural language.

+
+
+

Text Inheriting its Programmatic Language from an Element

+

The text inheriting its programmatic language from an element E is composed of all the following texts: +

+

An element F is an element inheriting its programmatic language from an element E if at least one of the following conditions is true (recursively):

+ +
+
+

Top Level Browsing Context

+

​A browsing context that has no parent browsing context is the top-level browsing context for itself and all of the browsing contexts for which it is an ancestor browsing context.

+

A top-level browsing context has an associated group (null or a browsing context group). It is initially null.

+

It is possible to create new browsing contexts that are related to a top-level browsing context while their container is null. Such browsing contexts are called auxiliary browsing contexts. Auxiliary browsing contexts are always top-level browsing contexts.

+
+
+

Valid Language Tag

+

A language tag is valid if its primary language subtag exists in the language subtag registry with a Type field whose field-body value is language.

+

A "language tag" is here to be understood as in the first paragraph of the RFC 5646 language tag syntax, i.e. a sequence of subtags separated by hyphens, where a subtag is any sequence of alphanumerical characters. Thus, this definition intentionally differs from the strict RFC 5646 syntax (and ABNF grammar) as user agents and assistive technologies are more lenient in what they accept. The definition is however consistent with the behavior of the :lang() pseudo-selector as defined by Selectors Level 3. For example, de-hello would be an accepted way to indicate German in current user agents and assistive technologies, despite not being valid according to RFC 5646 grammar. As a consequence of this definition, however, grandfathered tags are not correctly recognized as valid language subtags. +

+

Subtags, notably the primary language subtag, are case insensitive. Hence comparison with the language subtag registry must be done in a case insensitive way.

+
+
+ + \ No newline at end of file diff --git a/methods/html-lang-attribute/index.html b/methods/html-lang-attribute/index.html new file mode 100644 index 00000000..0a4bef55 --- /dev/null +++ b/methods/html-lang-attribute/index.html @@ -0,0 +1,33 @@ + + + + Method: [HTML lang attribute indicates the language of text ] | {TBD (Pronunciation)} | WCAG 3.0 + + +
+

HTML lang attribute indicates the language of text

+
+
+ + +
+ + + \ No newline at end of file diff --git a/methods/html-lang-attribute/introduction.html b/methods/html-lang-attribute/introduction.html new file mode 100644 index 00000000..5ea4f2d2 --- /dev/null +++ b/methods/html-lang-attribute/introduction.html @@ -0,0 +1,54 @@ + + + + HTML lang attribute indicates the language of text Method - Introduction + + +
+

Introduction

+
+
+
+

Outcome

+

This method supports the outcome Changes Of Natural Language.

+
+
+

Platform

+ +
+
+

Technology

+ +
+
+

Input aspects for testing

+ +
+
+

Summary

+

When authors specify the correct natural language of content, user agents, including assistive technologies, can present text more accurately. Screen readers can load the correct pronunciation rules and braille tables for languages.

+
+
+

How it solves user need

+

Specifying both the natural language of the view's main content as well as any changes in language of blocks of content in that view can help:

+ + +
+
+

When to use and what to do

+

Ensure that the HTML element has a lang attribute. The lang attribute value must use a valid language tag, for example lang="en" indicates the language as English. The attribute value must match the natural language of the page title element. Changes in language must be indicated using the lang attribute on the closest parent element.

+
+
+ + diff --git a/methods/html-lang-attribute/tests.html b/methods/html-lang-attribute/tests.html new file mode 100644 index 00000000..24768905 --- /dev/null +++ b/methods/html-lang-attribute/tests.html @@ -0,0 +1,38 @@ + + + + HTML lang attribute indicates the language of text Method - Tests + + +
+

Tests

+
+
+
+

Get Started

+

To get started with testing language attributes in a web page, you'll need to inspect the code in your browser. Once the page has loaded, open up your browser's developer tools and look for the <html> element near the top of code—it should be on the second line, just after the <!doctype html> tag. Once you've found that, you need to check that it has a lang attribute that correctly indicates the main language of the page. For example, if the main language of the page is French, you would look for <html lang="fr">.

+ +

Once you've checked that the page itself is marked up correctly, you need to read the page to look for blocks of text that are in a different language. If you find a block of content in another language, use your browser's developer tools to inspect the code to check that there is a lang attribute that correctly indicates the language that the block of text is written in. Complete this check for each block of text that's in a different human language from that of the main page.

+
+
+

Summary

+

For each block of content that's in a different human language than that of its parent, ensure there is lang attribute that correctly matches the content in the block.

+
+
+

Applicability

+

This outcome applies to any block of text that is included in the accessibility tree.

+
+
+

Expectations

+
+
Expectation 1:
+
For each test target, there is an ancestor with a lang attribute.
+
Expectation 2:
+
For each test target, the ancestor from expectation 1 has a lang attribute value that is a valid language tag.
+
Expectation 3:
+
For each test target, the language tag from expectation 2 matches that target's default language.
+
+
+
+ + \ No newline at end of file diff --git a/methods/template/tests.html b/methods/template/tests.html index 1b8d5289..f9134c21 100644 --- a/methods/template/tests.html +++ b/methods/template/tests.html @@ -18,10 +18,10 @@

Summary

Applicability

-

This outcome applies to any [element names] element that is [condition] and for which one of the following is true: +

This outcome applies to any [element names] element that is [condition] and for which one of the following is true:

{excluded, ignored, exception}
-
[element] +
[element]
diff --git a/outcomes/changes-to-natural-language.html b/outcomes/changes-to-natural-language.html new file mode 100644 index 00000000..39d3c06d --- /dev/null +++ b/outcomes/changes-to-natural-language.html @@ -0,0 +1,20 @@ + + + + Outcome: Changes to Natural Language + + +
+

Outcome: Changes to Natural Language

+

Assistive technologies using text to speech can pronounce blocks of text in their natural language.

+

Good articulation aids with comprehension, and is essential for text-to-speech assistive technology to be as useful as possible. Speech synthesis using pronunciation rules for the wrong language (even one using a similar alphabet) cannot easily be understood.

+ +

This outcome relates to guideline Pronunciation of Text.

+

Methods:

+
    +
  1. HTML lang attribute indicates the language of text
  2. +
  3. User agent automatic language detection for text (not written)
  4. +
+
+ + \ No newline at end of file