[html5] r8458 - [cgiow] (0) Add navigator.getLanguages() and <body onlanguagechange=''> Fixing h [...]

whatwg at whatwg.org whatwg at whatwg.org
Tue Feb 4 11:37:52 PST 2014


Author: ianh
Date: 2014-02-04 11:37:51 -0800 (Tue, 04 Feb 2014)
New Revision: 8458

Modified:
   complete.html
   index
   source
Log:
[cgiow] (0) Add navigator.getLanguages() and <body onlanguagechange=''>
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=23517
Affected topics: DOM APIs, HTML, Workers

Modified: complete.html
===================================================================
--- complete.html	2014-02-04 17:04:40 UTC (rev 8457)
+++ complete.html	2014-02-04 19:37:51 UTC (rev 8458)
@@ -14058,6 +14058,7 @@
    <dd><code title=handler-window-onbeforeprint><a href=#handler-window-onbeforeprint>onbeforeprint</a></code></dd>
    <dd><code title=handler-window-onbeforeunload><a href=#handler-window-onbeforeunload>onbeforeunload</a></code></dd>
    <dd><code title=handler-window-onhashchange><a href=#handler-window-onhashchange>onhashchange</a></code></dd>
+   <dd><code title=handler-window-onlanguagechange><a href=#handler-window-onlanguagechange>onlanguagechange</a></code></dd>
    <dd><code title=handler-window-onmessage><a href=#handler-window-onmessage>onmessage</a></code></dd>
    <dd><code title=handler-window-onoffline><a href=#handler-window-onoffline>onoffline</a></code></dd>
    <dd><code title=handler-window-ononline><a href=#handler-window-ononline>ononline</a></code></dd>
@@ -72613,6 +72614,7 @@
     <tr><td><dfn id=handler-window-onbeforeprint title=handler-window-onbeforeprint><code>onbeforeprint</code></dfn> <td> <code title=event-beforeprint><a href=#event-beforeprint>beforeprint</a></code>
     <tr><td><dfn id=handler-window-onbeforeunload title=handler-window-onbeforeunload><code>onbeforeunload</code></dfn> <td> <code title=event-beforeunload><a href=#event-beforeunload>beforeunload</a></code>
     <tr><td><dfn id=handler-window-onhashchange title=handler-window-onhashchange><code>onhashchange</code></dfn> <td> <code title=event-hashchange><a href=#event-hashchange>hashchange</a></code> <!-- new -->
+    <tr><td><dfn id=handler-window-onlanguagechange title=handler-window-onlanguagechange><code>onlanguagechange</code></dfn> <td> <code title=event-languagechange><a href=#event-languagechange>languagechange</a></code> <!-- new -->
     <tr><td><dfn id=handler-window-onmessage title=handler-window-onmessage><code>onmessage</code></dfn> <td> <code title=event-message><a href=#event-message>message</a></code> <!-- new for postMessage -->
     <tr><td><dfn id=handler-window-onoffline title=handler-window-onoffline><code>onoffline</code></dfn> <td> <code title=event-offline><a href=#event-offline>offline</a></code> <!-- new -->
     <tr><td><dfn id=handler-window-ononline title=handler-window-ononline><code>ononline</code></dfn> <td> <code title=event-online><a href=#event-online>online</a></code> <!-- new -->
@@ -72706,6 +72708,7 @@
            attribute <a href=#eventhandler>EventHandler</a> <a href=#handler-window-onbeforeprint title=handler-window-onbeforeprint>onbeforeprint</a>;
            attribute <a href=#onbeforeunloadeventhandler>OnBeforeUnloadEventHandler</a> <a href=#handler-window-onbeforeunload title=handler-window-onbeforeunload>onbeforeunload</a>;
            attribute <a href=#eventhandler>EventHandler</a> <a href=#handler-window-onhashchange title=handler-window-onhashchange>onhashchange</a>;
+           attribute <a href=#eventhandler>EventHandler</a> <a href=#handler-window-onlanguagechange title=handler-window-onlanguagechange>onlanguagechange</a>;
            attribute <a href=#eventhandler>EventHandler</a> <a href=#handler-window-onmessage title=handler-window-onmessage>onmessage</a>;
            attribute <a href=#eventhandler>EventHandler</a> <a href=#handler-window-onoffline title=handler-window-onoffline>onoffline</a>;
            attribute <a href=#eventhandler>EventHandler</a> <a href=#handler-window-ononline title=handler-window-ononline>ononline</a>;
@@ -74282,6 +74285,7 @@
   <pre class=idl>[NoInterfaceObject, Exposed=Window,Worker]
 interface <dfn id=navigatorlanguage>NavigatorLanguage</dfn> {
   readonly attribute DOMString? <a href=#dom-navigator-language title=dom-navigator-language>language</a>;
+  DOMString[] <a href=#dom-navigator-getlanguages title=dom-navigator-getLanguages>getLanguages</a>();
 };</pre>
 
   <dl class=domintro><dt><var title="">window</var> . <code title=dom-navigator><a href=#dom-navigator>navigator</a></code> . <code title=dom-navigator-language><a href=#dom-navigator-language>language</a></code></dt>
@@ -74289,8 +74293,18 @@
     <p>Returns a language tag representing the user's preferred language.</p>
    </dd>
 
-  </dl><div class=impl>
+   <dt><var title="">languages</var> = <var title="">window</var> . <code title=dom-navigator><a href=#dom-navigator>navigator</a></code> . <code title=dom-navigator-getLanguages><a href=#dom-navigator-getlanguages>getLanguages</a></code>()</dt>
+   <dd>
+    <p>Returns an array of language tags representing the user's preferred languages, with the most preferred language first.</p>
+    <p>The most preferred language is the one returned by <code title=dom-navigator-language><a href=#dom-navigator-language>navigator.language</a></code>.</p>
+   </dd>
 
+  </dl><p class=note>A <code title=event-languagechange><a href=#event-languagechange>languagechange</a></code> event is fired at the
+  <code><a href=#window>Window</a></code> or <code><a href=#workerglobalscope>WorkerGlobalScope</a></code> object when the user agent's understanding
+  of what the user's preferred languages are changes.</p>
+
+  <div class=impl>
+
   <dl><!--
    <dt><dfn title="dom-navigator-browserLanguage"><code>browserLanguage</code></dfn></dt> <!- - Opera and IE only - ->
    <dd><p>Must return a language tag representing either <span>a plausible language</span> or the
@@ -74300,8 +74314,12 @@
    <dt><dfn title="dom-navigator-userLanguage"><code>userLanguage</code></dfn></dt> <!- - Opera and IE only - ->
    --><!-- at time of testing, this was supported by Opera, Safari, and Mozilla only --><dt><dfn id=dom-navigator-language title=dom-navigator-language><code>language</code></dfn></dt>
    <dd><p>Must return a valid BCP 47 language tag representing either <a href=#a-plausible-language>a plausible
-   language</a> or the user's preferred language. <a href=#refsBCP47>[BCP47]</a></dd>
+   language</a> or the user's most preferred language. <a href=#refsBCP47>[BCP47]</a></dd>
 
+   <dt><dfn id=dom-navigator-getlanguages title=dom-navigator-getLanguages><code>getLanguages()</code></dfn></dt>
+   <dd><p>Must return an array of valid BCP 47 language tags representing either one or more <a href=#a-plausible-language title="a plausible language">plausible languages</a>, or the user's preferred languages,
+   ordered by preference with the most preferred language first. <a href=#refsBCP47>[BCP47]</a></dd>
+
   </dl><p>To determine <dfn id=a-plausible-language>a plausible language</dfn>, the user agent should bear in mind the following:</p>
 
   <ul><li>Any information in this API that varies from user to user can be used to profile or identify
@@ -74318,10 +74336,24 @@
    suggested; if all users of the service use that same value, that reduces the possibility of
    distinguishing the users from each other.</li>
 
-  </ul></div>
+  </ul><p>To avoid introducing any more fingerprinting vectors, user agents should use the same list for
+  the APIs defined in this function as for the HTTP <code title=http-accept-language>Accept-Language</code> header.
+  <a href=#fingerprinting-vector class=fingerprint title="fingerprinting vector"><img src=http://images.whatwg.org/fingerprint.png width=46 alt="(This is a fingerprinting vector.)" height=64></a>
+  </p>
 
+  <p>Whenever the <code title=dom-navigator-getLanguages><a href=#dom-navigator-getlanguages>navigator.getLanguages()</a></code> method
+  of a <code><a href=#window>Window</a></code> or <code><a href=#workerglobalscope>WorkerGlobalScope</a></code> object would start returning a new set
+  of language tags, the user agent must <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple
+  event</a> named <code title=event-languagechange><a href=#event-languagechange>languagechange</a></code> at the
+  <code><a href=#window>Window</a></code> or <code><a href=#workerglobalscope>WorkerGlobalScope</a></code> object.</p>
 
+  <p>The <a href=#task-source>task source</a> for this <a href=#concept-task title=concept-task>task</a> is the
+  <a href=#dom-manipulation-task-source>DOM manipulation task source</a>.</p>
 
+  </div>
+
+
+
   <h5 id=custom-handlers><span class=secno>7.6.1.3 </span>Custom scheme and content handlers</h5>
 
   <pre class=idl>[NoInterfaceObject]
@@ -83140,6 +83172,7 @@
 
   void <a href=#dom-workerglobalscope-close title=dom-WorkerGlobalScope-close>close</a>();
            attribute <a href=#onerroreventhandler>OnErrorEventHandler</a> <a href=#handler-workerglobalscope-onerror title=handler-WorkerGlobalScope-onerror>onerror</a>;
+           attribute <a href=#eventhandler>EventHandler</a> <a href=#handler-workerglobalscope-onlanguagechange title=handler-WorkerGlobalScope-onlanguagechange>onlanguagechange</a>;
            attribute <a href=#eventhandler>EventHandler</a> <a href=#handler-workerglobalscope-onoffline title=handler-WorkerGlobalScope-onoffline>onoffline</a>;
            attribute <a href=#eventhandler>EventHandler</a> <a href=#handler-workerglobalscope-ononline title=handler-WorkerGlobalScope-ononline>ononline</a>;
 
@@ -83171,6 +83204,7 @@
 
   <table><thead><tr><th><a href=#event-handlers title="event handlers">Event handler</a> <th><a href=#event-handler-event-type>Event handler event type</a>
    <tbody><tr><td><dfn id=handler-workerglobalscope-onerror title=handler-WorkerGlobalScope-onerror><code>onerror</code></dfn> <td> <code title=event-error><a href=#event-error>error</a></code>
+    <tr><td><dfn id=handler-workerglobalscope-onlanguagechange title=handler-WorkerGlobalScope-onlanguagechange><code>onlanguagechange</code></dfn> <td> <code title=event-languagechange><a href=#event-languagechange>languagechange</a></code> <!-- new -->
     <tr><td><dfn id=handler-workerglobalscope-onoffline title=handler-WorkerGlobalScope-onoffline><code>onoffline</code></dfn> <td> <code title=event-offline><a href=#event-offline>offline</a></code> <!-- new -->
     <tr><td><dfn id=handler-workerglobalscope-ononline title=handler-WorkerGlobalScope-ononline><code>ononline</code></dfn> <td> <code title=event-online><a href=#event-online>online</a></code> <!-- new -->
   </table><hr><p class=note>For <a href=#data-protocol title="data protocol"><code title="">data:</code> URLs</a>, this is
@@ -99209,6 +99243,7 @@
          <code title=handler-window-onbeforeprint><a href=#handler-window-onbeforeprint>onbeforeprint</a></code>;
          <code title=handler-window-onbeforeunload><a href=#handler-window-onbeforeunload>onbeforeunload</a></code>;
          <code title=handler-window-onhashchange><a href=#handler-window-onhashchange>onhashchange</a></code>;
+         <code title=handler-window-onlanguagechange><a href=#handler-window-onlanguagechange>onlanguagechange</a></code>;
          <code title=handler-window-onmessage><a href=#handler-window-onmessage>onmessage</a></code>;
          <code title=handler-window-onoffline><a href=#handler-window-onoffline>onoffline</a></code>;
          <code title=handler-window-ononline><a href=#handler-window-ononline>ononline</a></code>;
@@ -101678,6 +101713,11 @@
      <td> <code title=event-keyup><a href=#event-keyup>keyup</a></code> event handler
      <td> <a href=#event-handler-content-attributes title="event handler content attributes">Event handler content attribute</a>
 
+    <tr><th id=ix-handler-window-onlanguagechange> <code title="">onlanguagechange</code>
+     <td> <code title=handler-window-onlanguagechange><a href=#handler-window-onlanguagechange>body</a></code>
+     <td> <code title=event-languagechange><a href=#event-languagechange>languagechange</a></code> event handler for <code><a href=#window>Window</a></code> object
+     <td> <a href=#event-handler-content-attributes title="event handler content attributes">Event handler content attribute</a>
+
     <tr><th id=ix-handler-onload> <code title="">onload</code>
      <td> <a href=#handler-onload title=handler-onload>HTML elements</a>
      <td> <code title=event-load><a href=#event-load>load</a></code> event handler
@@ -102522,6 +102562,11 @@
      <td> Form controls
      <td> Fired at controls during form validation if they do not satisfy their constraints
 
+    <tr><!-- languagechange --><td> <dfn id=event-languagechange title=event-languagechange><code>languagechange</code></dfn>
+     <td> <code><a href=#event>Event</a></code>
+     <td> Global scope objects
+     <td> Fired at the global scope object when the user's preferred languages change
+
     <tr><!-- load --><td> <dfn id=event-load title=event-load><code>load</code></dfn>
      <td> <code><a href=#event>Event</a></code>
      <td> <code><a href=#window>Window</a></code>, elements

Modified: index
===================================================================
--- index	2014-02-04 17:04:40 UTC (rev 8457)
+++ index	2014-02-04 19:37:51 UTC (rev 8458)
@@ -14058,6 +14058,7 @@
    <dd><code title=handler-window-onbeforeprint><a href=#handler-window-onbeforeprint>onbeforeprint</a></code></dd>
    <dd><code title=handler-window-onbeforeunload><a href=#handler-window-onbeforeunload>onbeforeunload</a></code></dd>
    <dd><code title=handler-window-onhashchange><a href=#handler-window-onhashchange>onhashchange</a></code></dd>
+   <dd><code title=handler-window-onlanguagechange><a href=#handler-window-onlanguagechange>onlanguagechange</a></code></dd>
    <dd><code title=handler-window-onmessage><a href=#handler-window-onmessage>onmessage</a></code></dd>
    <dd><code title=handler-window-onoffline><a href=#handler-window-onoffline>onoffline</a></code></dd>
    <dd><code title=handler-window-ononline><a href=#handler-window-ononline>ononline</a></code></dd>
@@ -72613,6 +72614,7 @@
     <tr><td><dfn id=handler-window-onbeforeprint title=handler-window-onbeforeprint><code>onbeforeprint</code></dfn> <td> <code title=event-beforeprint><a href=#event-beforeprint>beforeprint</a></code>
     <tr><td><dfn id=handler-window-onbeforeunload title=handler-window-onbeforeunload><code>onbeforeunload</code></dfn> <td> <code title=event-beforeunload><a href=#event-beforeunload>beforeunload</a></code>
     <tr><td><dfn id=handler-window-onhashchange title=handler-window-onhashchange><code>onhashchange</code></dfn> <td> <code title=event-hashchange><a href=#event-hashchange>hashchange</a></code> <!-- new -->
+    <tr><td><dfn id=handler-window-onlanguagechange title=handler-window-onlanguagechange><code>onlanguagechange</code></dfn> <td> <code title=event-languagechange><a href=#event-languagechange>languagechange</a></code> <!-- new -->
     <tr><td><dfn id=handler-window-onmessage title=handler-window-onmessage><code>onmessage</code></dfn> <td> <code title=event-message><a href=#event-message>message</a></code> <!-- new for postMessage -->
     <tr><td><dfn id=handler-window-onoffline title=handler-window-onoffline><code>onoffline</code></dfn> <td> <code title=event-offline><a href=#event-offline>offline</a></code> <!-- new -->
     <tr><td><dfn id=handler-window-ononline title=handler-window-ononline><code>ononline</code></dfn> <td> <code title=event-online><a href=#event-online>online</a></code> <!-- new -->
@@ -72706,6 +72708,7 @@
            attribute <a href=#eventhandler>EventHandler</a> <a href=#handler-window-onbeforeprint title=handler-window-onbeforeprint>onbeforeprint</a>;
            attribute <a href=#onbeforeunloadeventhandler>OnBeforeUnloadEventHandler</a> <a href=#handler-window-onbeforeunload title=handler-window-onbeforeunload>onbeforeunload</a>;
            attribute <a href=#eventhandler>EventHandler</a> <a href=#handler-window-onhashchange title=handler-window-onhashchange>onhashchange</a>;
+           attribute <a href=#eventhandler>EventHandler</a> <a href=#handler-window-onlanguagechange title=handler-window-onlanguagechange>onlanguagechange</a>;
            attribute <a href=#eventhandler>EventHandler</a> <a href=#handler-window-onmessage title=handler-window-onmessage>onmessage</a>;
            attribute <a href=#eventhandler>EventHandler</a> <a href=#handler-window-onoffline title=handler-window-onoffline>onoffline</a>;
            attribute <a href=#eventhandler>EventHandler</a> <a href=#handler-window-ononline title=handler-window-ononline>ononline</a>;
@@ -74282,6 +74285,7 @@
   <pre class=idl>[NoInterfaceObject, Exposed=Window,Worker]
 interface <dfn id=navigatorlanguage>NavigatorLanguage</dfn> {
   readonly attribute DOMString? <a href=#dom-navigator-language title=dom-navigator-language>language</a>;
+  DOMString[] <a href=#dom-navigator-getlanguages title=dom-navigator-getLanguages>getLanguages</a>();
 };</pre>
 
   <dl class=domintro><dt><var title="">window</var> . <code title=dom-navigator><a href=#dom-navigator>navigator</a></code> . <code title=dom-navigator-language><a href=#dom-navigator-language>language</a></code></dt>
@@ -74289,8 +74293,18 @@
     <p>Returns a language tag representing the user's preferred language.</p>
    </dd>
 
-  </dl><div class=impl>
+   <dt><var title="">languages</var> = <var title="">window</var> . <code title=dom-navigator><a href=#dom-navigator>navigator</a></code> . <code title=dom-navigator-getLanguages><a href=#dom-navigator-getlanguages>getLanguages</a></code>()</dt>
+   <dd>
+    <p>Returns an array of language tags representing the user's preferred languages, with the most preferred language first.</p>
+    <p>The most preferred language is the one returned by <code title=dom-navigator-language><a href=#dom-navigator-language>navigator.language</a></code>.</p>
+   </dd>
 
+  </dl><p class=note>A <code title=event-languagechange><a href=#event-languagechange>languagechange</a></code> event is fired at the
+  <code><a href=#window>Window</a></code> or <code><a href=#workerglobalscope>WorkerGlobalScope</a></code> object when the user agent's understanding
+  of what the user's preferred languages are changes.</p>
+
+  <div class=impl>
+
   <dl><!--
    <dt><dfn title="dom-navigator-browserLanguage"><code>browserLanguage</code></dfn></dt> <!- - Opera and IE only - ->
    <dd><p>Must return a language tag representing either <span>a plausible language</span> or the
@@ -74300,8 +74314,12 @@
    <dt><dfn title="dom-navigator-userLanguage"><code>userLanguage</code></dfn></dt> <!- - Opera and IE only - ->
    --><!-- at time of testing, this was supported by Opera, Safari, and Mozilla only --><dt><dfn id=dom-navigator-language title=dom-navigator-language><code>language</code></dfn></dt>
    <dd><p>Must return a valid BCP 47 language tag representing either <a href=#a-plausible-language>a plausible
-   language</a> or the user's preferred language. <a href=#refsBCP47>[BCP47]</a></dd>
+   language</a> or the user's most preferred language. <a href=#refsBCP47>[BCP47]</a></dd>
 
+   <dt><dfn id=dom-navigator-getlanguages title=dom-navigator-getLanguages><code>getLanguages()</code></dfn></dt>
+   <dd><p>Must return an array of valid BCP 47 language tags representing either one or more <a href=#a-plausible-language title="a plausible language">plausible languages</a>, or the user's preferred languages,
+   ordered by preference with the most preferred language first. <a href=#refsBCP47>[BCP47]</a></dd>
+
   </dl><p>To determine <dfn id=a-plausible-language>a plausible language</dfn>, the user agent should bear in mind the following:</p>
 
   <ul><li>Any information in this API that varies from user to user can be used to profile or identify
@@ -74318,10 +74336,24 @@
    suggested; if all users of the service use that same value, that reduces the possibility of
    distinguishing the users from each other.</li>
 
-  </ul></div>
+  </ul><p>To avoid introducing any more fingerprinting vectors, user agents should use the same list for
+  the APIs defined in this function as for the HTTP <code title=http-accept-language>Accept-Language</code> header.
+  <a href=#fingerprinting-vector class=fingerprint title="fingerprinting vector"><img src=http://images.whatwg.org/fingerprint.png width=46 alt="(This is a fingerprinting vector.)" height=64></a>
+  </p>
 
+  <p>Whenever the <code title=dom-navigator-getLanguages><a href=#dom-navigator-getlanguages>navigator.getLanguages()</a></code> method
+  of a <code><a href=#window>Window</a></code> or <code><a href=#workerglobalscope>WorkerGlobalScope</a></code> object would start returning a new set
+  of language tags, the user agent must <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple
+  event</a> named <code title=event-languagechange><a href=#event-languagechange>languagechange</a></code> at the
+  <code><a href=#window>Window</a></code> or <code><a href=#workerglobalscope>WorkerGlobalScope</a></code> object.</p>
 
+  <p>The <a href=#task-source>task source</a> for this <a href=#concept-task title=concept-task>task</a> is the
+  <a href=#dom-manipulation-task-source>DOM manipulation task source</a>.</p>
 
+  </div>
+
+
+
   <h5 id=custom-handlers><span class=secno>7.6.1.3 </span>Custom scheme and content handlers</h5>
 
   <pre class=idl>[NoInterfaceObject]
@@ -83140,6 +83172,7 @@
 
   void <a href=#dom-workerglobalscope-close title=dom-WorkerGlobalScope-close>close</a>();
            attribute <a href=#onerroreventhandler>OnErrorEventHandler</a> <a href=#handler-workerglobalscope-onerror title=handler-WorkerGlobalScope-onerror>onerror</a>;
+           attribute <a href=#eventhandler>EventHandler</a> <a href=#handler-workerglobalscope-onlanguagechange title=handler-WorkerGlobalScope-onlanguagechange>onlanguagechange</a>;
            attribute <a href=#eventhandler>EventHandler</a> <a href=#handler-workerglobalscope-onoffline title=handler-WorkerGlobalScope-onoffline>onoffline</a>;
            attribute <a href=#eventhandler>EventHandler</a> <a href=#handler-workerglobalscope-ononline title=handler-WorkerGlobalScope-ononline>ononline</a>;
 
@@ -83171,6 +83204,7 @@
 
   <table><thead><tr><th><a href=#event-handlers title="event handlers">Event handler</a> <th><a href=#event-handler-event-type>Event handler event type</a>
    <tbody><tr><td><dfn id=handler-workerglobalscope-onerror title=handler-WorkerGlobalScope-onerror><code>onerror</code></dfn> <td> <code title=event-error><a href=#event-error>error</a></code>
+    <tr><td><dfn id=handler-workerglobalscope-onlanguagechange title=handler-WorkerGlobalScope-onlanguagechange><code>onlanguagechange</code></dfn> <td> <code title=event-languagechange><a href=#event-languagechange>languagechange</a></code> <!-- new -->
     <tr><td><dfn id=handler-workerglobalscope-onoffline title=handler-WorkerGlobalScope-onoffline><code>onoffline</code></dfn> <td> <code title=event-offline><a href=#event-offline>offline</a></code> <!-- new -->
     <tr><td><dfn id=handler-workerglobalscope-ononline title=handler-WorkerGlobalScope-ononline><code>ononline</code></dfn> <td> <code title=event-online><a href=#event-online>online</a></code> <!-- new -->
   </table><hr><p class=note>For <a href=#data-protocol title="data protocol"><code title="">data:</code> URLs</a>, this is
@@ -99209,6 +99243,7 @@
          <code title=handler-window-onbeforeprint><a href=#handler-window-onbeforeprint>onbeforeprint</a></code>;
          <code title=handler-window-onbeforeunload><a href=#handler-window-onbeforeunload>onbeforeunload</a></code>;
          <code title=handler-window-onhashchange><a href=#handler-window-onhashchange>onhashchange</a></code>;
+         <code title=handler-window-onlanguagechange><a href=#handler-window-onlanguagechange>onlanguagechange</a></code>;
          <code title=handler-window-onmessage><a href=#handler-window-onmessage>onmessage</a></code>;
          <code title=handler-window-onoffline><a href=#handler-window-onoffline>onoffline</a></code>;
          <code title=handler-window-ononline><a href=#handler-window-ononline>ononline</a></code>;
@@ -101678,6 +101713,11 @@
      <td> <code title=event-keyup><a href=#event-keyup>keyup</a></code> event handler
      <td> <a href=#event-handler-content-attributes title="event handler content attributes">Event handler content attribute</a>
 
+    <tr><th id=ix-handler-window-onlanguagechange> <code title="">onlanguagechange</code>
+     <td> <code title=handler-window-onlanguagechange><a href=#handler-window-onlanguagechange>body</a></code>
+     <td> <code title=event-languagechange><a href=#event-languagechange>languagechange</a></code> event handler for <code><a href=#window>Window</a></code> object
+     <td> <a href=#event-handler-content-attributes title="event handler content attributes">Event handler content attribute</a>
+
     <tr><th id=ix-handler-onload> <code title="">onload</code>
      <td> <a href=#handler-onload title=handler-onload>HTML elements</a>
      <td> <code title=event-load><a href=#event-load>load</a></code> event handler
@@ -102522,6 +102562,11 @@
      <td> Form controls
      <td> Fired at controls during form validation if they do not satisfy their constraints
 
+    <tr><!-- languagechange --><td> <dfn id=event-languagechange title=event-languagechange><code>languagechange</code></dfn>
+     <td> <code><a href=#event>Event</a></code>
+     <td> Global scope objects
+     <td> Fired at the global scope object when the user's preferred languages change
+
     <tr><!-- load --><td> <dfn id=event-load title=event-load><code>load</code></dfn>
      <td> <code><a href=#event>Event</a></code>
      <td> <code><a href=#window>Window</a></code>, elements

Modified: source
===================================================================
--- source	2014-02-04 17:04:40 UTC (rev 8457)
+++ source	2014-02-04 19:37:51 UTC (rev 8458)
@@ -14594,6 +14594,7 @@
    <dd><code data-x="handler-window-onbeforeprint">onbeforeprint</code></dd>
    <dd><code data-x="handler-window-onbeforeunload">onbeforeunload</code></dd>
    <dd><code data-x="handler-window-onhashchange">onhashchange</code></dd>
+   <dd><code data-x="handler-window-onlanguagechange">onlanguagechange</code></dd>
    <dd><code data-x="handler-window-onmessage">onmessage</code></dd>
    <dd><code data-x="handler-window-onoffline">onoffline</code></dd>
    <dd><code data-x="handler-window-ononline">ononline</code></dd>
@@ -81167,6 +81168,7 @@
     <tr><td><dfn data-x="handler-window-onbeforeprint"><code>onbeforeprint</code></dfn> <td> <code data-x="event-beforeprint">beforeprint</code>
     <tr><td><dfn data-x="handler-window-onbeforeunload"><code>onbeforeunload</code></dfn> <td> <code data-x="event-beforeunload">beforeunload</code>
     <tr><td><dfn data-x="handler-window-onhashchange"><code>onhashchange</code></dfn> <td> <code data-x="event-hashchange">hashchange</code> <!-- new -->
+    <tr><td><dfn data-x="handler-window-onlanguagechange"><code>onlanguagechange</code></dfn> <td> <code data-x="event-languagechange">languagechange</code> <!-- new -->
     <tr><td><dfn data-x="handler-window-onmessage"><code>onmessage</code></dfn> <td> <code data-x="event-message">message</code> <!-- new for postMessage -->
     <tr><td><dfn data-x="handler-window-onoffline"><code>onoffline</code></dfn> <td> <code data-x="event-offline">offline</code> <!-- new -->
     <tr><td><dfn data-x="handler-window-ononline"><code>ononline</code></dfn> <td> <code data-x="event-online">online</code> <!-- new -->
@@ -81272,6 +81274,7 @@
            attribute <span>EventHandler</span> <span data-x="handler-window-onbeforeprint">onbeforeprint</span>;
            attribute <span>OnBeforeUnloadEventHandler</span> <span data-x="handler-window-onbeforeunload">onbeforeunload</span>;
            attribute <span>EventHandler</span> <span data-x="handler-window-onhashchange">onhashchange</span>;
+           attribute <span>EventHandler</span> <span data-x="handler-window-onlanguagechange">onlanguagechange</span>;
            attribute <span>EventHandler</span> <span data-x="handler-window-onmessage">onmessage</span>;
            attribute <span>EventHandler</span> <span data-x="handler-window-onoffline">onoffline</span>;
            attribute <span>EventHandler</span> <span data-x="handler-window-ononline">ononline</span>;
@@ -83039,6 +83042,7 @@
   <pre class="idl">[NoInterfaceObject, Exposed=Window,Worker]
 interface <dfn>NavigatorLanguage</dfn> {
   readonly attribute DOMString? <span data-x="dom-navigator-language">language</span>;
+  DOMString[] <span data-x="dom-navigator-getLanguages">getLanguages</span>();
 };</pre>
 
   <dl class="domintro">
@@ -83048,8 +83052,18 @@
     <p>Returns a language tag representing the user's preferred language.</p>
    </dd>
 
+   <dt><var data-x="">languages</var> = <var data-x="">window</var> . <code data-x="dom-navigator">navigator</code> . <code data-x="dom-navigator-getLanguages">getLanguages</code>()</dt>
+   <dd>
+    <p>Returns an array of language tags representing the user's preferred languages, with the most preferred language first.</p>
+    <p>The most preferred language is the one returned by <code data-x="dom-navigator-language">navigator.language</code>.</p>
+   </dd>
+
   </dl>
 
+  <p class="note">A <code data-x="event-languagechange">languagechange</code> event is fired at the
+  <code>Window</code> or <code>WorkerGlobalScope</code> object when the user agent's understanding
+  of what the user's preferred languages are changes.</p>
+
   <div class="impl">
 
   <dl>
@@ -83065,8 +83079,14 @@
    <!-- at time of testing, this was supported by Opera, Safari, and Mozilla only -->
    <dt><dfn data-x="dom-navigator-language"><code>language</code></dfn></dt>
    <dd><p>Must return a valid BCP 47 language tag representing either <span>a plausible
-   language</span> or the user's preferred language. <a href="#refsBCP47">[BCP47]</a></p></dd>
+   language</span> or the user's most preferred language. <a href="#refsBCP47">[BCP47]</a></p></dd>
 
+   <dt><dfn data-x="dom-navigator-getLanguages"><code>getLanguages()</code></dfn></dt>
+   <dd><p>Must return an array of valid BCP 47 language tags representing either one or more <span
+   data-x="a plausible language">plausible languages</span>, or the user's preferred languages,
+   ordered by preference with the most preferred language first. <a
+   href="#refsBCP47">[BCP47]</a></p></dd>
+
   </dl>
 
   <p>To determine <dfn>a plausible language</dfn>, the user agent should bear in mind the following:</p>
@@ -83089,6 +83109,21 @@
 
   </ul>
 
+  <p>To avoid introducing any more fingerprinting vectors, user agents should use the same list for
+  the APIs defined in this function as for the HTTP <code
+  data-x="http-accept-language">Accept-Language</code> header.
+  <!--INSERT FINGERPRINT-->
+  </p>
+
+  <p>Whenever the <code data-x="dom-navigator-getLanguages">navigator.getLanguages()</code> method
+  of a <code>Window</code> or <code>WorkerGlobalScope</code> object would start returning a new set
+  of language tags, the user agent must <span>queue a task</span> to <span>fire a simple
+  event</span> named <code data-x="event-languagechange">languagechange</code> at the
+  <code>Window</code> or <code>WorkerGlobalScope</code> object.</p>
+
+  <p>The <span>task source</span> for this <span data-x="concept-task">task</span> is the
+  <span>DOM manipulation task source</span>.</p>
+
   </div>
 
 
@@ -92529,6 +92564,7 @@
 
   void <span data-x="dom-WorkerGlobalScope-close">close</span>();
            attribute <span>OnErrorEventHandler</span> <span data-x="handler-WorkerGlobalScope-onerror">onerror</span>;
+           attribute <span>EventHandler</span> <span data-x="handler-WorkerGlobalScope-onlanguagechange">onlanguagechange</span>;
            attribute <span>EventHandler</span> <span data-x="handler-WorkerGlobalScope-onoffline">onoffline</span>;
            attribute <span>EventHandler</span> <span data-x="handler-WorkerGlobalScope-ononline">ononline</span>;
 };</pre>
@@ -92570,6 +92606,7 @@
     <tr><th><span data-x="event handlers">Event handler</span> <th><span>Event handler event type</span>
    <tbody>
     <tr><td><dfn data-x="handler-WorkerGlobalScope-onerror"><code>onerror</code></dfn> <td> <code data-x="event-error">error</code>
+    <tr><td><dfn data-x="handler-WorkerGlobalScope-onlanguagechange"><code>onlanguagechange</code></dfn> <td> <code data-x="event-languagechange">languagechange</code> <!-- new -->
     <tr><td><dfn data-x="handler-WorkerGlobalScope-onoffline"><code>onoffline</code></dfn> <td> <code data-x="event-offline">offline</code> <!-- new -->
     <tr><td><dfn data-x="handler-WorkerGlobalScope-ononline"><code>ononline</code></dfn> <td> <code data-x="event-online">online</code> <!-- new -->
   </table>
@@ -110571,6 +110608,7 @@
          <code data-x="handler-window-onbeforeprint">onbeforeprint</code>;
          <code data-x="handler-window-onbeforeunload">onbeforeunload</code>;
          <code data-x="handler-window-onhashchange">onhashchange</code>;
+         <code data-x="handler-window-onlanguagechange">onlanguagechange</code>;
          <code data-x="handler-window-onmessage">onmessage</code>;
          <code data-x="handler-window-onoffline">onoffline</code>;
          <code data-x="handler-window-ononline">ononline</code>;
@@ -113554,6 +113592,12 @@
      <td> <span data-x="event handler content attributes">Event handler content attribute</span>
 
     <tr>
+     <th id="ix-handler-window-onlanguagechange"> <code data-x="">onlanguagechange</code>
+     <td> <code data-x="handler-window-onlanguagechange">body</code>
+     <td> <code data-x="event-languagechange">languagechange</code> event handler for <code>Window</code> object
+     <td> <span data-x="event handler content attributes">Event handler content attribute</span>
+
+    <tr>
      <th id="ix-handler-onload"> <code data-x="">onload</code>
      <td> <span data-x="handler-onload">HTML elements</span>
      <td> <code data-x="event-load">load</code> event handler
@@ -114423,6 +114467,12 @@
      <td> Form controls
      <td> Fired at controls during form validation if they do not satisfy their constraints
 
+    <tr> <!-- languagechange -->
+     <td> <dfn data-x="event-languagechange"><code>languagechange</code></dfn>
+     <td> <code>Event</code>
+     <td> Global scope objects
+     <td> Fired at the global scope object when the user's preferred languages change
+
     <tr> <!-- load -->
      <td> <dfn data-x="event-load"><code>load</code></dfn>
      <td> <code>Event</code>




More information about the Commit-Watchers mailing list