Skip to content

Commit

Permalink
[e] (0) Clarify how to handle unknown language codes.
Browse files Browse the repository at this point in the history
Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=8151

git-svn-id: http://svn.whatwg.org/webapps@4454 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Dec 19, 2009
1 parent f5ebec7 commit 68d75b6
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 6 deletions.
15 changes: 13 additions & 2 deletions complete.html
Expand Up @@ -8134,8 +8134,19 @@ <h5 id=the-lang-and-xml:lang-attributes><span class=secno>3.2.3.3 </span>The <co
unknown (the empty string).</p>

<p>If the resulting value is not a recognized language code, then it
must be treated as an unknown language (as if the value was the
empty string).</p>
must be treated as an unknown language having the given language
code, distinct from all other languages. For the purposes of
round-tripping or communicating with other services that expect
language codes, user agents should pass unknown language codes
through unmodified.</p>

<p class=example>Thus, for instance, an element with <code title="">lang="xyzzy"</code> would be matched by the selector <code title="">:lang('xyzzy')</code> (e.g. in CSS), but it would not be
matched by <code title="">:lang('abcde')</code>, even though both
are equally invalid. Similarly, if a Web browser and screen reader
working in unison communicated about the language of the element,
the browser would tell the screen reader that the language was
"xyzzy", even if it knew it was invalid, just in case the screen
reader actually supported a language with that code after all.</p>

<hr><p>User agents may use the element's language to determine proper
processing or rendering (e.g. in the selection of appropriate
Expand Down
15 changes: 13 additions & 2 deletions index
Expand Up @@ -7969,8 +7969,19 @@ Transport Protocol"&gt;HTTP&lt;/abbr&gt; today.&lt;/p&gt;</pre>
unknown (the empty string).</p>

<p>If the resulting value is not a recognized language code, then it
must be treated as an unknown language (as if the value was the
empty string).</p>
must be treated as an unknown language having the given language
code, distinct from all other languages. For the purposes of
round-tripping or communicating with other services that expect
language codes, user agents should pass unknown language codes
through unmodified.</p>

<p class=example>Thus, for instance, an element with <code title="">lang="xyzzy"</code> would be matched by the selector <code title="">:lang('xyzzy')</code> (e.g. in CSS), but it would not be
matched by <code title="">:lang('abcde')</code>, even though both
are equally invalid. Similarly, if a Web browser and screen reader
working in unison communicated about the language of the element,
the browser would tell the screen reader that the language was
"xyzzy", even if it knew it was invalid, just in case the screen
reader actually supported a language with that code after all.</p>

<hr><p>User agents may use the element's language to determine proper
processing or rendering (e.g. in the selection of appropriate
Expand Down
17 changes: 15 additions & 2 deletions source
Expand Up @@ -8087,8 +8087,21 @@ Transport Protocol">HTTP&lt;/abbr> today.&lt;/p></pre>
unknown (the empty string).</p>

<p>If the resulting value is not a recognized language code, then it
must be treated as an unknown language (as if the value was the
empty string).</p>
must be treated as an unknown language having the given language
code, distinct from all other languages. For the purposes of
round-tripping or communicating with other services that expect
language codes, user agents should pass unknown language codes
through unmodified.</p>

<p class="example">Thus, for instance, an element with <code
title="">lang="xyzzy"</code> would be matched by the selector <code
title="">:lang('xyzzy')</code> (e.g. in CSS), but it would not be
matched by <code title="">:lang('abcde')</code>, even though both
are equally invalid. Similarly, if a Web browser and screen reader
working in unison communicated about the language of the element,
the browser would tell the screen reader that the language was
"xyzzy", even if it knew it was invalid, just in case the screen
reader actually supported a language with that code after all.</p>

<hr>

Expand Down

0 comments on commit 68d75b6

Please sign in to comment.