[html5] r8631 - [e] (0) Discourage window.foo usage Fixing https://www.w3.org/Bugs/Public/show_b [...]

whatwg at whatwg.org whatwg at whatwg.org
Tue May 13 16:53:40 PDT 2014


Author: ianh
Date: 2014-05-13 16:53:36 -0700 (Tue, 13 May 2014)
New Revision: 8631

Modified:
   complete.html
   index
   source
Log:
[e] (0) Discourage window.foo usage
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=25512
Affected topics: DOM APIs

Modified: complete.html
===================================================================
--- complete.html	2014-05-13 19:18:47 UTC (rev 8630)
+++ complete.html	2014-05-13 23:53:36 UTC (rev 8631)
@@ -66313,6 +66313,10 @@
 
     <p>Returns the indicated element or collection of elements.</p>
 
+    <p>As a general rule, relying on this will lead to brittle code. Which IDs end up mapping to
+    this API can vary over time, as new features are added to the Web platform, for example. Instead
+    of this, use <code title="">document.getElementById()</code> or <code title="">document.querySelector()</code>.</p>
+
    </dd>
 
   </dl><div class=impl>

Modified: index
===================================================================
--- index	2014-05-13 19:18:47 UTC (rev 8630)
+++ index	2014-05-13 23:53:36 UTC (rev 8631)
@@ -66313,6 +66313,10 @@
 
     <p>Returns the indicated element or collection of elements.</p>
 
+    <p>As a general rule, relying on this will lead to brittle code. Which IDs end up mapping to
+    this API can vary over time, as new features are added to the Web platform, for example. Instead
+    of this, use <code title="">document.getElementById()</code> or <code title="">document.querySelector()</code>.</p>
+
    </dd>
 
   </dl><div class=impl>

Modified: source
===================================================================
--- source	2014-05-13 19:18:47 UTC (rev 8630)
+++ source	2014-05-13 23:53:36 UTC (rev 8631)
@@ -72722,6 +72722,11 @@
 
     <p>Returns the indicated element or collection of elements.</p>
 
+    <p>As a general rule, relying on this will lead to brittle code. Which IDs end up mapping to
+    this API can vary over time, as new features are added to the Web platform, for example. Instead
+    of this, use <code data-x="">document.getElementById()</code> or <code
+    data-x="">document.querySelector()</code>.</p>
+
    </dd>
 
   </dl>



More information about the Commit-Watchers mailing list