aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/document
diff options
context:
space:
mode:
authorFlorian Merz <me@fiji-flo.de>2021-02-11 12:56:40 +0100
committerFlorian Merz <me@fiji-flo.de>2021-02-11 12:56:40 +0100
commit310fd066e91f454b990372ffa30e803cc8120975 (patch)
treed5d900deb656a5da18e0b60d00f0db73f3a2e88e /files/zh-cn/web/api/document
parent8260a606c143e6b55a467edf017a56bdcd6cba7e (diff)
downloadtranslated-content-310fd066e91f454b990372ffa30e803cc8120975.tar.gz
translated-content-310fd066e91f454b990372ffa30e803cc8120975.tar.bz2
translated-content-310fd066e91f454b990372ffa30e803cc8120975.zip
unslug zh-cn: move
Diffstat (limited to 'files/zh-cn/web/api/document')
-rw-r--r--files/zh-cn/web/api/document/cookie/simple_document.cookie_framework/index.html218
-rw-r--r--files/zh-cn/web/api/document/elementfrompoint/index.html45
-rw-r--r--files/zh-cn/web/api/document/elementsfrompoint/index.html129
-rw-r--r--files/zh-cn/web/api/document/fullscreen/index.html (renamed from files/zh-cn/web/api/document/mozfullscreen/index.html)0
-rw-r--r--files/zh-cn/web/api/document/fullscreenenabled/index.html (renamed from files/zh-cn/web/api/document/mozfullscreenenabled/index.html)0
-rw-r--r--files/zh-cn/web/api/document/getselection/index.html15
-rw-r--r--files/zh-cn/web/api/document/inputencoding/index.html21
-rw-r--r--files/zh-cn/web/api/document/mozfullscreenelement/index.html77
-rw-r--r--files/zh-cn/web/api/document/onafterscriptexecute/index.html44
-rw-r--r--files/zh-cn/web/api/document/pointerlockelement/index.html105
-rw-r--r--files/zh-cn/web/api/document/readystatechange_event/index.html149
-rw-r--r--files/zh-cn/web/api/document/stylesheets/index.html26
-rw-r--r--files/zh-cn/web/api/document/touchmove_event/index.html (renamed from files/zh-cn/web/api/document/rouchmove_event/index.html)0
13 files changed, 193 insertions, 636 deletions
diff --git a/files/zh-cn/web/api/document/cookie/simple_document.cookie_framework/index.html b/files/zh-cn/web/api/document/cookie/simple_document.cookie_framework/index.html
deleted file mode 100644
index 450751cefa..0000000000
--- a/files/zh-cn/web/api/document/cookie/simple_document.cookie_framework/index.html
+++ /dev/null
@@ -1,218 +0,0 @@
----
-title: 简单的cookie框架
-slug: Web/API/Document/cookie/Simple_document.cookie_framework
-tags:
- - Cookies
- - cookie
-translation_of: Web/API/Document/cookie/Simple_document.cookie_framework
----
-<h2 id="一个小型框架_一个完整的cookies读写器对Unicode充分支持">一个小型框架: 一个完整的cookies读/写器对Unicode充分支持</h2>
-
-<p>由于Cookie只是特殊格式的字符串,因此有时很难管理它们。 以下库旨在通过定义一个与一个<a href="https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage#Storage"><code>Storage</code> </a>对象部分一致的对象(<code>docCookies</code>)来抽象对<code>document.cookie</code>的访问。</p>
-
-<p> 以下代码也<a href="https://github.com/madmurphy/cookies.js">在GitHub上获取</a>。它是基于GNU General Public License v3.0 许可 (<a href="https://github.com/madmurphy/cookies.js/blob/master/LICENSE">许可链接</a>)</p>
-
-<h5 id="库">库</h5>
-
-<pre class="brush: js">/*\
-|*|
-|*|  :: cookies.js ::
-|*|
-|*|  A complete cookies reader/writer framework with full unicode support.
-|*|
-|*|  Revision #1 - September 4, 2014
-|*|
-|*|  https://developer.mozilla.org/en-US/docs/Web/API/document.cookie
-|*|  https://developer.mozilla.org/User:fusionchess
-|*|  https://github.com/madmurphy/cookies.js
-|*|
-|*|  This framework is released under the GNU Public License, version 3 or later.
-|*|  http://www.gnu.org/licenses/gpl-3.0-standalone.html
-|*|
-|*|  Syntaxes:
-|*|
-|*|  * docCookies.setItem(name, value[, end[, path[, domain[, secure]]]])
-|*|  * docCookies.getItem(name)
-|*|  * docCookies.removeItem(name[, path[, domain]])
-|*|  * docCookies.hasItem(name)
-|*|  * docCookies.keys()
-|*|
-\*/
-
-var docCookies = {
-  getItem: function (sKey) {
-    if (!sKey) { return null; }
-    return decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*" + encodeURIComponent(sKey).replace(/[\-\.\+\*]/g, "\\$&amp;") + "\\s*\\=\\s*([^;]*).*$)|^.*$"), "$1")) || null;
-  },
-  setItem: function (sKey, sValue, vEnd, sPath, sDomain, bSecure) {
-    if (!sKey || /^(?:expires|max\-age|path|domain|secure)$/i.test(sKey)) { return false; }
-    var sExpires = "";
-    if (vEnd) {
-      switch (vEnd.constructor) {
-        case Number:
-          sExpires = vEnd === Infinity ? "; expires=Fri, 31 Dec 9999 23:59:59 GMT" : "; max-age=" + vEnd;
-          break;
-        case String:
-          sExpires = "; expires=" + vEnd;
-          break;
-        case Date:
-          sExpires = "; expires=" + vEnd.toUTCString();
-          break;
-      }
-    }
-    document.cookie = encodeURIComponent(sKey) + "=" + encodeURIComponent(sValue) + sExpires + (sDomain ? "; domain=" + sDomain : "") + (sPath ? "; path=" + sPath : "") + (bSecure ? "; secure" : "");
-    return true;
-  },
-  removeItem: function (sKey, sPath, sDomain) {
-    if (!this.hasItem(sKey)) { return false; }
-    document.cookie = encodeURIComponent(sKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT" + (sDomain ? "; domain=" + sDomain : "") + (sPath ? "; path=" + sPath : "");
-    return true;
-  },
-  hasItem: function (sKey) {
-    if (!sKey) { return false; }
-    return (new RegExp("(?:^|;\\s*)" + encodeURIComponent(sKey).replace(/[\-\.\+\*]/g, "\\$&amp;") + "\\s*\\=")).test(document.cookie);
-  },
-  keys: function () {
-    var aKeys = document.cookie.replace(/((?:^|\s*;)[^\=]+)(?=;|$)|^\s*|\s*(?:\=[^;]*)?(?:\1|$)/g, "").split(/\s*(?:\=[^;]*)?;\s*/);
-    for (var nLen = aKeys.length, nIdx = 0; nIdx &lt; nLen; nIdx++) { aKeys[nIdx] = decodeURIComponent(aKeys[nIdx]); }
-    return aKeys;
-  }
-};</pre>
-
-<div class="note"><strong>Note:</strong> 对于<em>never-expire-cookies  我们使用一个随意的遥远日期</em><code>Fri, 31 Dec 9999 23:59:59 GMT</code>. 处于任何原因,你担心这样一个日期,使用 <em><a href="http://en.wikipedia.org/wiki/Year_2038_problem">惯例世界末日</a></em>Tue, 19 Jan 2038 03:14:07 GMT - 这是自1970年1月1日00:00:00 UTC以来使用 <a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Operators/Bitwise_Operators#Signed_32-bit_integers">有符号的32位二进制整数</a>表示的最大秒数。(i.e., <code>01111111111111111111111111111111</code> which is <code>new Date(0x7fffffff * 1e3)</code>).</div>
-
-<h3 id="cookie的写入">cookie的写入</h3>
-
-<h5 id="语法">语法</h5>
-
-<pre class="syntaxbox"><code>docCookies.setItem(<em>name</em>, <em>value</em>[, <em>end</em>[, <em>path</em>[, <em>domain</em>[, <em>secure</em>]]]])</code></pre>
-
-<h5 id="Description">Description</h5>
-
-<p>新增/重写一个 cookie.</p>
-
-<h5 id="参数">参数</h5>
-
-<dl>
- <dt><code>name</code></dt>
- <dd>新增/重写一个 cookie的 <a href="#new-cookie_syntax">名字</a>  (<a href="/en-US/docs/JavaScript/Reference/Global_Objects/String"><code>字符传</code></a>).</dd>
- <dt><code>value</code></dt>
- <dd>cookie的<a href="#new-cookie_syntax">值</a> (<a href="/en-US/docs/JavaScript/Reference/Global_Objects/String"><code>字符串</code></a>).</dd>
- <dt><code>end</code> <font face="Helvetica, arial, sans-serif"><span style="background-color: #eeeeee; font-size: 14px; font-weight: 400;">可选</span></font></dt>
- <dd><code><a href="#new-cookie_max-age">max-age</a>(最大有效时间)单位秒</code> (e.g. <code>31536e3</code> 表示一年, <a href="/en-US/docs/JavaScript/Reference/Global_Objects/Infinity"><code>Infinity</code> </a> 表示永不过期的cookie), 或者以<code><a href="/en-US/docs/JavaScript/Reference/Global_Objects/Date/toGMTString">GMTString</a></code> 格式或者<a href="/en-US/docs/JavaScript/Reference/Global_Objects/Date"><code>Date</code> object</a> 的<a href="#new-cookie_expires"><code>expires</code></a> date(过期时间); 如果没有,指定的cookie将在会话结束时到期 (<a href="/en-US/docs/JavaScript/Reference/Global_Objects/Number"><code>number</code></a> – finite or <a href="/en-US/docs/JavaScript/Reference/Global_Objects/Infinity"><code>Infinity</code></a> – <a href="/en-US/docs/JavaScript/Reference/Global_Objects/String"><code>string</code></a>, <a href="/en-US/docs/JavaScript/Reference/Global_Objects/Date"><code>Date</code> object</a> or <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/null"><code>null</code></a>).
- <div class="note" id="max-age_note" style="margin-top: 1em;">
- <p><strong>Note:</strong> 尽管 <a href="https://tools.ietf.org/html/rfc6265#section-5.2.2">officially defined in rfc6265</a>, <code>max-age</code> 在 Internet Explorer, Edg和一些移动端浏览器上不兼容. 因此,将数字传递给<code>end</code>参数可能无法按预期工作. 可能的解决方案可能是将相对时间转换为绝对时间。例如,以下代码:</p>
-
- <pre class="brush: js">docCookies.setItem("mycookie", "Hello world!", 150);</pre>
-
- <p>可以使用绝对日期重写,如下例所示:</p>
-
- <pre class="brush: js"> maxAgeToGMT (nMaxAge) {
-  return nMaxAge === Infinity ? "Fri, 31 Dec 9999 23:59:59 GMT" : (new Date(nMaxAge * 1e3 + Date.now())).toUTCString();
-}
-
-docCookies.setItem("mycookie", "Hello world!", maxAgeToGMT(150));</pre>
-
- <p>在上面的代码中,函数<code> maxAgeToGMT() </code>用于从相对时间(即,从“age”)创建<code><a href="/en-US/docs/JavaScript/Reference/Global_Objects/Date/toGMTString">GMTString</a>.</code></p>
- </div>
- </dd>
- <dt><code>path</code> <span class="inlineIndicator optional optionalInline">可选</span></dt>
- <dd>可访问此cookie的路径. 例如,“/”,“/ mydir”;如果未指定,则默认为当前文档位置的当前路径(<a href="/en-US/docs/JavaScript/Reference/Global_Objects/String"><code>string</code></a> or <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/null"><code>null</code></a>). The path must be <em>absolute</em> (see <a href="http://www.ietf.org/rfc/rfc2965.txt">RFC 2965</a>). For more information on how to use relative paths in this argument, see <a href="#Using_relative_URLs_in_the_path_parameter">this paragraph</a>.</dd>
- <dt><code>domain</code> <span class="inlineIndicator optional optionalInline">可选</span></dt>
- <dd>可访问此cookie的域名. 例如,<code>“example.com”</code>,<code>“.example.com”</code>(包括所有子域)或<code>“subdomain.example.com”</code>; 如果未指定,则默认为当前文档位置的主机端口(<a href="/en-US/docs/JavaScript/Reference/Global_Objects/String"><code>string</code></a> or <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/null"><code>null</code></a>).</dd>
- <dt><code>secure</code> <span class="inlineIndicator optional optionalInline">可选</span></dt>
- <dd>cookie将仅通过https安全协议传输 (<a href="/en-US/docs/JavaScript/Reference/Global_Objects/Boolean"><code>boolean</code></a> or <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/null"><code>null</code></a>).</dd>
-</dl>
-
-<h3 id="获取一个cookie">获取一个cookie</h3>
-
-<h5 id="语法_2">语法</h5>
-
-<pre class="syntaxbox"><code>docCookies.getItem(<em>name</em>)</code></pre>
-
-<h5 id="描述">描述</h5>
-
-<p>读一个cookie。如果cookie不存在,则返回null值。Parameters</p>
-
-<h5 id="参数_2">参数</h5>
-
-<dl>
- <dt><code>name</code></dt>
- <dd>读取cookie的名字 (<a href="/en-US/docs/JavaScript/Reference/Global_Objects/String"><code>string</code></a>).</dd>
-</dl>
-
-<h3 id="移除一个cookie">移除一个cookie</h3>
-
-<h5 id="语法_3">语法</h5>
-
-<pre class="syntaxbox"><code>docCookies.removeItem(<em>name</em>[, <em>path</em>[, <em>domain</em>]])</code></pre>
-
-<h5 id="描述_2">描述</h5>
-
-<p>删除一个cookie.</p>
-
-<h5 id="参数_3">参数</h5>
-
-<dl>
- <dt><code>name</code></dt>
- <dd>待移除cookie的名字 (<a href="/en-US/docs/JavaScript/Reference/Global_Objects/String"><code>string</code></a>).</dd>
- <dt><code>path</code> <span class="inlineIndicator optional optionalInline">可选</span></dt>
- <dd>例如,"<code>/"</code>,"<code>/ </code><code>mydir"</code>;如果未指定,则默认为当前文档位置的当前路径 (<a href="/en-US/docs/JavaScript/Reference/Global_Objects/String"><code>string</code></a> or <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/null"><code>null</code></a>). The path must be <em>absolute</em> (see <a href="http://www.ietf.org/rfc/rfc2965.txt">RFC 2965</a>). For more information on how to use relative paths in this argument, see <a href="#Using_relative_URLs_in_the_path_parameter">this paragraph</a>.</dd>
- <dt><code>domain</code> <span class="inlineIndicator optional optionalInline">可选</span></dt>
- <dd>例如, <code>"example.com"</code>,  或者 <code>"subdomain.example.com"</code>; 如果未指定,则默认为当前文档位置的主机端口(字符串或null),但不包括子域。 (<a href="/en-US/docs/JavaScript/Reference/Global_Objects/String"><code>string</code></a> or <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/null"><code>null</code></a>), 但不包括子域名。与早期的规范相反,域名中的前置的点被忽略。如果指定了域,则始终包含子域。
- <div class="note"><strong>Note:</strong> 要删除跨子域的cookie,您需要想<code>setItem()样</code>在<code>removeItem()</code>中指定domain属性。</div>
- </dd>
-</dl>
-
-<h3 id="检查一个cookie(是否存在)">检查一个cookie(是否存在)</h3>
-
-<h5 id="语法_4">语法</h5>
-
-<pre class="syntaxbox"><code>docCookies.hasItem(<em>name</em>)</code></pre>
-
-<h5 id="描述_3">描述</h5>
-
-<p>检查当前位置是否存在cookie。</p>
-
-<h5 id="参数_4">参数</h5>
-
-<dl>
- <dt><code>name</code></dt>
- <dd>待检查cookie的名字 (<a href="/en-US/docs/JavaScript/Reference/Global_Objects/String"><code>string</code></a>).</dd>
-</dl>
-
-<h3 id="获取所有cookie列表">获取所有cookie列表</h3>
-
-<h5 id="Syntax">Syntax</h5>
-
-<pre class="syntaxbox"><code>docCookies.keys()</code></pre>
-
-<h5 id="Description_2">Description</h5>
-
-<p>返回此位置的所有可读cookie的数组。</p>
-
-<h3 id="Example_usage">Example usage:</h3>
-
-<pre class="brush: js">docCookies.setItem("test0", "Hello world!");
-docCookies.setItem("test1", "Unicode test: \u00E0\u00E8\u00EC\u00F2\u00F9", Infinity);
-docCookies.setItem("test2", "Hello world!", new Date(2020, 5, 12));
-docCookies.setItem("test3", "Hello world!", new Date(2027, 2, 3), "/blog");
-docCookies.setItem("test4", "Hello world!", "Wed, 19 Feb 2127 01:04:55 GMT");
-docCookies.setItem("test5", "Hello world!", "Fri, 20 Aug 88354 14:07:15 GMT", "/home");
-docCookies.setItem("test6", "Hello world!", 150);
-docCookies.setItem("test7", "Hello world!", 245, "/content");
-docCookies.setItem("test8", "Hello world!", null, null, "example.com");
-docCookies.setItem("test9", "Hello world!", null, null, null, true);
-docCookies.setItem("test1;=", "Safe character test;=", Infinity);
-
-alert(docCookies.keys().join("\n"));
-alert(docCookies.getItem("test1"));
-alert(docCookies.getItem("test5"));
-docCookies.removeItem("test1");
-docCookies.removeItem("test5", "/home");
-alert(docCookies.getItem("test1"));
-alert(docCookies.getItem("test5"));
-alert(docCookies.getItem("unexistingCookie"));
-alert(docCookies.getItem());
-alert(docCookies.getItem("test1;="));
-</pre>
diff --git a/files/zh-cn/web/api/document/elementfrompoint/index.html b/files/zh-cn/web/api/document/elementfrompoint/index.html
deleted file mode 100644
index 6fb591e1da..0000000000
--- a/files/zh-cn/web/api/document/elementfrompoint/index.html
+++ /dev/null
@@ -1,45 +0,0 @@
----
-title: Document.elementFromPoint()
-slug: Web/API/Document/elementFromPoint
-translation_of: Web/API/DocumentOrShadowRoot/elementFromPoint
-translation_of_original: Web/API/Document/elementFromPoint
----
-<div>
- {{APIRef()}} {{Fx_minversion_header(3)}}</div>
-<h2 id="Summary" name="Summary">概述</h2>
-<p>返回当前文档上处于指定坐标位置最顶层的元素, 坐标是相对于包含该文档的浏览器窗口的左上角为原点来计算的, 通常 x 和 y 坐标都应为正数.</p>
-<h2 id="Syntax" name="Syntax">语法</h2>
-<pre><em>var element</em> = document.elementFromPoint(<em>x</em>, <em>y</em>);</pre>
-<ul>
- <li><code>element</code> 是返回的DOM<a href="/en-US/docs/DOM/element" title="DOM/element">元素</a>.</li>
- <li><code>x</code> 和 <code>y</code> 是坐标数值, 不需要单位比如px.</li>
-</ul>
-<h2 id="Example" name="Example">示例</h2>
-<pre class="brush:html">&lt;!DOCTYPE html&gt;
-&lt;html lang="en"&gt;
-&lt;head&gt;
-&lt;title&gt;elementFromPoint example&lt;/title&gt;
-
-&lt;script&gt;
-function changeColor(newColor) {
- elem = document.elementFromPoint(2, 2);
- elem.style.color = newColor;
-}
-&lt;/script&gt;
-&lt;/head&gt;
-
-&lt;body&gt;
-&lt;p id="para1"&gt;Some text here&lt;/p&gt;
-&lt;button onclick="changeColor('blue');"&gt;blue&lt;/button&gt;
-&lt;button onclick="changeColor('red');"&gt;red&lt;/button&gt;
-&lt;/body&gt;
-&lt;/html&gt;
-</pre>
-<h2 id="Notes" name="Notes">附注</h2>
-<p>If the element at the specified point belongs to another document (for example, an iframe's subdocument), the element in the DOM of the document the method is called on (in the iframe case, the iframe itself) is returned. If the element at the given point is anonymous or XBL generated content, such as a textbox's scroll bars, then the first non-anonymous ancestor element (for example, the textbox) is returned.</p>
-<p>If the specified point is outside the visible bounds of the document or either coordinate is negative, the result is <code>null</code>.</p>
-<p>{{Note("Callers from XUL documents should wait until the <code>onload</code> event has fired before calling this method.")}}</p>
-<h2 id="Specification" name="Specification">规范</h2>
-<ul>
- <li>Preliminary specification: <code><a class="external" href="http://dev.w3.org/csswg/cssom-view/#dom-document-elementfrompoint">elementFromPoint</a></code></li>
-</ul>
diff --git a/files/zh-cn/web/api/document/elementsfrompoint/index.html b/files/zh-cn/web/api/document/elementsfrompoint/index.html
deleted file mode 100644
index 9a7ee01503..0000000000
--- a/files/zh-cn/web/api/document/elementsfrompoint/index.html
+++ /dev/null
@@ -1,129 +0,0 @@
----
-title: Document.elementsFromPoint()
-slug: Web/API/Document/elementsFromPoint
-translation_of: Web/API/DocumentOrShadowRoot/elementsFromPoint
-translation_of_original: Web/API/Document/elementsFromPoint
----
-<div>{{APIRef("DOM")}}{{SeeCompatTable}}</div>
-
-<p><code><strong>elementsFromPoint()</strong></code> 方法可以获取到当前视口内指定坐标处,由里到外排列的所有元素。</p>
-
-<h2 id="语法">语法</h2>
-
-<pre class="brush: js">var<em> elements</em> = <em>document</em>.elementsFromPoint(<em>x</em>, <em>y</em>);</pre>
-
-<h3 id="返回值">返回值</h3>
-
-<p>一个包含多个元素的数组</p>
-
-<h3 id="参数">参数</h3>
-
-<dl>
- <dt>x</dt>
- <dd>当前视口内某一点的横坐标</dd>
- <dt>y</dt>
- <dd>当前视口内某一点的纵坐标</dd>
-</dl>
-
-<h2 id="Example" name="Example">示例</h2>
-
-<h3 id="HTML">HTML</h3>
-
-<pre class="brush: html">&lt;div&gt;
- &lt;p&gt;Some text&lt;/p&gt;
-&lt;/div&gt;
-&lt;p&gt;Elements at point 30, 20:&lt;/p&gt;
-&lt;div id="output"&gt;&lt;/div&gt;
-</pre>
-
-<h3 id="JavaScript">JavaScript</h3>
-
-<pre class="brush: js;highlight[1]">var output = document.getElementById("output");
-if (document.elementsFromPoint) {
- var elements = document.elementsFromPoint(30, 20);
- for(var i = 0; i &lt; elements.length; i++) {
- output.textContent += elements[i].localName;
- if (i &lt; elements.length - 1) {
- output.textContent += " &lt; ";
- }
- }
-} else {
- output.innerHTML = "&lt;span style=\"color: red;\"&gt;" +
- "您的浏览器不支持 &lt;code&gt;document.elementsFromPoint()&lt;/code&gt;" +
- "&lt;/span&gt;";
-}</pre>
-
-<p>{{EmbedLiveSample('Example', '420', '120')}}</p>
-
-<h2 id="规范">规范</h2>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <th scope="col">Specification</th>
- <th scope="col">Status</th>
- <th scope="col">Comment</th>
- </tr>
- <tr>
- <td>{{SpecName('CSSOM View', '#dom-document-elementsfrompoint', 'elementsFromPoint')}}</td>
- <td>{{Spec2('CSSOM View')}}</td>
- <td>Initial definition.</td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="浏览器兼容性">浏览器兼容性</h2>
-
-<p>{{CompatibilityTable}}</p>
-
-<div id="compat-desktop">
-<table class="compat-table">
- <tbody>
- <tr>
- <th>Feature</th>
- <th>Chrome</th>
- <th>Firefox (Gecko)</th>
- <th>Internet Explorer</th>
- <th>Opera</th>
- <th>Safari</th>
- </tr>
- <tr>
- <td>Basic support</td>
- <td> {{CompatChrome(43.0)}}</td>
- <td>{{CompatGeckoDesktop("46.0")}}<sup>[1]</sup></td>
- <td>10.0 {{property_prefix("ms")}}</td>
- <td>{{CompatUnknown}}</td>
- <td>{{CompatSafari(11)}}</td>
- </tr>
- </tbody>
-</table>
-</div>
-
-<div id="compat-mobile">
-<table class="compat-table">
- <tbody>
- <tr>
- <th>Feature</th>
- <th>Android</th>
- <th>Android Webview</th>
- <th>Firefox Mobile (Gecko)</th>
- <th>IE Mobile</th>
- <th>Opera Mobile</th>
- <th>Safari Mobile</th>
- <th>Chrome for Android</th>
- </tr>
- <tr>
- <td>Basic support</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatChrome(43.0)}}</td>
- <td>{{CompatGeckoMobile("46.0")}}<sup>[1]</sup></td>
- <td>{{CompatUnknown}}</td>
- <td>{{CompatUnknown}}</td>
- <td>{{CompatSafari(11)}}</td>
- <td>{{CompatChrome(43.0)}}</td>
- </tr>
- </tbody>
-</table>
-</div>
-
-<p> </p>
diff --git a/files/zh-cn/web/api/document/mozfullscreen/index.html b/files/zh-cn/web/api/document/fullscreen/index.html
index eb15adcede..eb15adcede 100644
--- a/files/zh-cn/web/api/document/mozfullscreen/index.html
+++ b/files/zh-cn/web/api/document/fullscreen/index.html
diff --git a/files/zh-cn/web/api/document/mozfullscreenenabled/index.html b/files/zh-cn/web/api/document/fullscreenenabled/index.html
index 248797541a..248797541a 100644
--- a/files/zh-cn/web/api/document/mozfullscreenenabled/index.html
+++ b/files/zh-cn/web/api/document/fullscreenenabled/index.html
diff --git a/files/zh-cn/web/api/document/getselection/index.html b/files/zh-cn/web/api/document/getselection/index.html
deleted file mode 100644
index 73b3a4ce6b..0000000000
--- a/files/zh-cn/web/api/document/getselection/index.html
+++ /dev/null
@@ -1,15 +0,0 @@
----
-title: document.getSelection
-slug: Web/API/Document/getSelection
-translation_of: Web/API/DocumentOrShadowRoot/getSelection
-translation_of_original: Web/API/Document/getSelection
----
-<article class="approved text-content" style="padding-right: 10px; width: 652px; float: left;">
-<div class="boxed translate-rendered" style="">
-<p>{{APIRef("DOM")}}</p>
-
-<p>该方法的功能等价于 {{domxref("Window.getSelection()")}} 方法;其返回一个 {{domxref("Selection")}} 对象,表示文档中当前被选择的文本。</p>
-</div>
-</article>
-
-<p> </p>
diff --git a/files/zh-cn/web/api/document/inputencoding/index.html b/files/zh-cn/web/api/document/inputencoding/index.html
deleted file mode 100644
index 00701e8acf..0000000000
--- a/files/zh-cn/web/api/document/inputencoding/index.html
+++ /dev/null
@@ -1,21 +0,0 @@
----
-title: document.inputEncoding
-slug: Web/API/Document/inputEncoding
-translation_of: Web/API/Document/characterSet
-translation_of_original: Web/API/Document/inputEncoding
----
-<p>{{ ApiRef() }} {{ deprecated_header() }}</p>
-<h3 id="概述">概述</h3>
-<p>返回一个字符串,代表当前文档渲染时所使用的编码.(比如<code>utf-8</code>).</p>
-<div class="warning">
- <strong>警告:</strong> 不要再使用该属性.该属性在DOM 4 规范(草案)中已经被废弃. Gecko 在未来的版本中将会删除它.</div>
-<h3 id="语法">语法</h3>
-<pre class="eval"><var>encoding</var> = <code>document.inputEncoding;</code>
-</pre>
-<p><code>inputEncoding</code> 是个只读属性.</p>
-<h3 id="规范">规范</h3>
-<ul>
- <li><a class="external" href="http://www.w3.org/TR/DOM-Level-3-Core/core.html#Document3-inputEncoding">DOM Level 3 Core</a></li>
- <li>This has been removed from {{ spec("http://www.w3.org/TR/domcore/","DOM Core Level 4","WD") }}</li>
-</ul>
-<p>{{ languages( {"en": "en/DOM/document.inputEncoding" } ) }}</p>
diff --git a/files/zh-cn/web/api/document/mozfullscreenelement/index.html b/files/zh-cn/web/api/document/mozfullscreenelement/index.html
deleted file mode 100644
index d87cd89683..0000000000
--- a/files/zh-cn/web/api/document/mozfullscreenelement/index.html
+++ /dev/null
@@ -1,77 +0,0 @@
----
-title: document.mozFullScreenElement
-slug: Web/API/Document/mozFullScreenElement
-translation_of: Web/API/DocumentOrShadowRoot/fullscreenElement
----
-<p>{{ ApiRef() }}</p>
-<h3 id="Summary" name="Summary">概述</h3>
-<p>返回当前文档中正在以全屏模式显示的{{ domxref("Element") }}节点,如果没有使用全屏模式,则返回<code>null</code>.</p>
-<h3 id="Syntax" name="Syntax">语法</h3>
-<pre class="eval"><em>var element</em> = <em>document</em>.mozFullScreenElement;
-</pre>
-<h3 id="Example" name="Example">示例</h3>
-<pre class="eval">function isVideoInFullsreen() {
- if (document.mozFullScreenElement &amp;&amp; document.mozFullScreenElement.nodeName == 'VIDEO') {
- console.log('您的视频正在以全屏模式显示');
- }
-}</pre>
-<h3 id="辅助">辅助</h3>
-<p>查看<a href="/zh-CN/docs/DOM/Using_full-screen_mode" title="zh-CN/docs/DOM/Using full-screen mode">使用"全屏模式"</a>页面了解详情.</p>
-<h3 id="Specification" name="Specification">浏览器兼容性</h3>
-<p>{{ CompatibilityTable() }}</p>
-<div id="compat-desktop">
- <table class="compat-table">
- <tbody>
- <tr>
- <th>Feature</th>
- <th>Chrome</th>
- <th>Firefox (Gecko)</th>
- <th>Internet Explorer</th>
- <th>Opera</th>
- <th>Safari</th>
- </tr>
- <tr>
- <td>Basic support</td>
- <td>{{ CompatUnknown() }}</td>
- <td>{{ CompatGeckoDesktop("9.0") }}</td>
- <td>{{ CompatUnknown() }}</td>
- <td>{{ CompatUnknown() }}</td>
- <td>{{ CompatUnknown() }}</td>
- </tr>
- </tbody>
- </table>
-</div>
-<div id="compat-mobile">
- <table class="compat-table">
- <tbody>
- <tr>
- <th>Feature</th>
- <th>Android</th>
- <th>Firefox Mobile (Gecko)</th>
- <th>IE Mobile</th>
- <th>Opera Mobile</th>
- <th>Safari Mobile</th>
- </tr>
- <tr>
- <td>Basic support</td>
- <td>{{ CompatUnknown() }}</td>
- <td>{{ CompatGeckoMobile("9.0") }}</td>
- <td>{{ CompatUnknown() }}</td>
- <td>{{ CompatUnknown() }}</td>
- <td>{{ CompatUnknown() }}</td>
- </tr>
- </tbody>
- </table>
-</div>
-<h3 id="Specification" name="Specification">规范</h3>
-<p>该方法提案已经进入相关规范草案 <a class="external" href="http://dvcs.w3.org/hg/fullscrezh-CN/raw-file/tip/Overview.html#dom-document-fullscreenelement" title="http://dvcs.w3.org/hg/fullscrezh-CN/raw-file/tip/Overview.html#dom-document-fullscreenelement">http://dvcs.w3.org/hg/fullscrezh-CN/raw-file/tip/Overview.html#dom-document-fullscreenelement</a></p>
-<h3 id="相关链接">相关链接</h3>
-<ul>
- <li><a href="/zh-CN/docs/DOM/Using_full-screen_mode" title="zh-CN/docs/DOM/Using full-screen mode">Using full-screen mode</a></li>
- <li>{{ domxref("element.mozRequestFullScreen()") }}</li>
- <li>{{ domxref("document.mozCancelFullScreen()") }}</li>
- <li>{{ domxref("document.mozFullScreen") }}</li>
- <li>{{ domxref("document.mozFullScreenEnabled") }}</li>
- <li>{{ cssxref(":-moz-full-screen") }}</li>
- <li>{{ HTMLAttrXRef("allowfullscreen", "iframe") }}</li>
-</ul>
diff --git a/files/zh-cn/web/api/document/onafterscriptexecute/index.html b/files/zh-cn/web/api/document/onafterscriptexecute/index.html
new file mode 100644
index 0000000000..f1e976522e
--- /dev/null
+++ b/files/zh-cn/web/api/document/onafterscriptexecute/index.html
@@ -0,0 +1,44 @@
+---
+title: element.onafterscriptexecute
+slug: Web/API/Element/onafterscriptexecute
+tags:
+ - DOM
+ - onafterscriptexecute
+translation_of: Web/API/Document/onafterscriptexecute
+---
+<div>{{ApiRef}}{{gecko_minversion_header("2")}}</div>
+
+<h2 id="概述">概述</h2>
+
+<p>当HTML文档中的{{HTMLElement("script")}}标签内的代码执行完毕时触发该事件,如果这个<code>script</code>标签是用<code>appendChild()</code>等方法动态添加上去的,则不会触发该事件.</p>
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox"><em>document.onafterscriptexecute = funcRef;</em>
+</pre>
+
+<p>当<code>afterscriptexecute</code>事件触发时,<code>funcRef</code>函数就会被调用. 传入参数<code>event</code>的<code>target</code>属性指向触发该事件的那个<code>script</code>元素.</p>
+
+<h2 id="例子">例子</h2>
+
+<pre class="brush:js">function finished(e) {
+ logMessage("Finished script with ID: " + e.target.id);
+}
+
+document.addEventListener("afterscriptexecute", finished, true);
+</pre>
+
+<p><a href="/samples/html/currentScript.html">查看在线演示</a></p>
+
+<h2 id="规范">规范</h2>
+
+<ul>
+ <li><a href="http://www.whatwg.org/specs/web-apps/current-work/#the-script-element" title="http://www.whatwg.org/specs/web-apps/current-work/#the-script-element">HTML5</a></li>
+</ul>
+
+<h2 id="相关链接">相关链接</h2>
+
+<ul>
+ <li>{{domxref("element.onbeforescriptexecute")}}</li>
+ <li>{{domxref("document.currentScript")}}</li>
+</ul>
diff --git a/files/zh-cn/web/api/document/pointerlockelement/index.html b/files/zh-cn/web/api/document/pointerlockelement/index.html
deleted file mode 100644
index eb6ed9cf98..0000000000
--- a/files/zh-cn/web/api/document/pointerlockelement/index.html
+++ /dev/null
@@ -1,105 +0,0 @@
----
-title: Document.pointerLockElement
-slug: Web/API/Document/pointerLockElement
-translation_of: Web/API/DocumentOrShadowRoot/pointerLockElement
----
-<div>{{APIRef("DOM")}}</div>
-
-<p><code>pointerLockElement 特性规定了如在鼠标事件中当目标被锁定时的元素集和。如果指针处于锁定等待中、指针没有被锁定,或者目标在另外一个文档中这几种情况,返回的值null。</code></p>
-
-<h2 id="语法">语法</h2>
-
-<pre class="syntaxbox">var element = document.pointerLockElement;
-</pre>
-
-<h3 id="返回值">返回值</h3>
-
-<p>An {{domxref("Element")}} or <code>null</code>.</p>
-
-<h2 id="特性">特性</h2>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <th scope="col">Specification</th>
- <th scope="col">Status</th>
- <th scope="col">Comment</th>
- </tr>
- <tr>
- <td>{{SpecName('Pointer Lock','l#extensions-to-the-document-interface','Document')}}</td>
- <td>{{Spec2('Pointer Lock')}}</td>
- <td>Extend the <code>Document</code> interface</td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="Browser_compatibility" name="Browser_compatibility">浏览器兼容</h2>
-
-<p>{{ CompatibilityTable() }}</p>
-
-<div id="compat-desktop">
-<table class="compat-table">
- <tbody>
- <tr>
- <th>Feature</th>
- <th>Chrome</th>
- <th>Edge</th>
- <th>Firefox (Gecko)</th>
- <th>Internet Explorer</th>
- <th>Opera</th>
- <th>Safari</th>
- </tr>
- <tr>
- <td>Basic support</td>
- <td>{{ CompatVersionUnknown() }} {{property_prefix("webkit")}}</td>
- <td>{{CompatVersionUnknown}}</td>
- <td>{{ CompatVersionUnknown() }} {{property_prefix("moz")}}</td>
- <td>{{ CompatUnknown() }}</td>
- <td>{{ CompatUnknown() }}</td>
- <td>{{ CompatUnknown() }}</td>
- </tr>
- <tr>
- <td>Unprefixed support</td>
- <td>{{ CompatVersionUnknown() }}</td>
- <td>{{CompatUnknown}}</td>
- <td>{{CompatGeckoDesktop(50)}}</td>
- <td> </td>
- <td> </td>
- <td> </td>
- </tr>
- </tbody>
-</table>
-</div>
-
-<div id="compat-mobile">
-<table class="compat-table">
- <tbody>
- <tr>
- <th>Feature</th>
- <th>Android</th>
- <th>Edge</th>
- <th>Firefox Mobile (Gecko)</th>
- <th>IE Mobile</th>
- <th>Opera Mobile</th>
- <th>Safari Mobile</th>
- </tr>
- <tr>
- <td>Basic support</td>
- <td>{{ CompatUnknown() }}</td>
- <td>{{CompatVersionUnknown}}</td>
- <td>{{ CompatUnknown() }}</td>
- <td>{{ CompatUnknown() }}</td>
- <td>{{ CompatUnknown() }}</td>
- <td>{{ CompatUnknown() }}</td>
- </tr>
- </tbody>
-</table>
-</div>
-
-<h2 id="相关链接">相关链接</h2>
-
-<ul>
- <li>{{ domxref("Document.exitPointerLock()") }}</li>
- <li>{{ domxref("Element.requestPointerLock()") }}</li>
- <li><a href="/en-US/docs/WebAPI/Pointer_Lock">Pointer Lock</a></li>
-</ul>
diff --git a/files/zh-cn/web/api/document/readystatechange_event/index.html b/files/zh-cn/web/api/document/readystatechange_event/index.html
new file mode 100644
index 0000000000..a4f95498ad
--- /dev/null
+++ b/files/zh-cn/web/api/document/readystatechange_event/index.html
@@ -0,0 +1,149 @@
+---
+title: 'Document: readystatechange 事件'
+slug: Web/Events/readystatechange事件
+tags:
+ - Reference
+ - XMLHttpRequest
+ - interactive
+ - 事件
+translation_of: Web/API/Document/readystatechange_event
+---
+<div>{{APIRef}}</div>
+
+<p>当文档的 {{domxref("Document.readyState", "readyState")}} 属性发生改变时,会触发 <code>readystatechange</code> 事件。</p>
+
+<table class="properties">
+ <tbody>
+ <tr>
+ <th scope="row">是否冒泡</th>
+ <td>否</td>
+ </tr>
+ <tr>
+ <th scope="row">是否可取消</th>
+ <td>否</td>
+ </tr>
+ <tr>
+ <th scope="row">接口</th>
+ <td>{{domxref("Event")}}</td>
+ </tr>
+ <tr>
+ <th scope="row">Event handler 属性</th>
+ <td><code>onreadystatechange</code></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="示例">示例</h2>
+
+<h3 id="实时演示">实时演示</h3>
+
+<h4 id="HTML">HTML</h4>
+
+<pre class="brush: html">&lt;div class="controls"&gt;
+ &lt;button id="reload" type="button"&gt;Reload&lt;/button&gt;
+&lt;/div&gt;
+
+&lt;div class="event-log"&gt;
+ &lt;label&gt;Event log:&lt;/label&gt;
+ &lt;textarea readonly class="event-log-contents" rows="8" cols="30"&gt;&lt;/textarea&gt;
+&lt;/div&gt;</pre>
+
+<div class="hidden">
+<h4 id="CSS">CSS</h4>
+
+<pre class="brush: css">body {
+ display: grid;
+ grid-template-areas: "control log";
+}
+
+.controls {
+ grid-area: control;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+.event-log {
+ grid-area: log;
+}
+
+.event-log-contents {
+ resize: none;
+}
+
+label, button {
+ display: block;
+}
+
+#reload {
+ height: 2rem;
+}
+
+</pre>
+</div>
+
+<h4 id="JS">JS</h4>
+
+<pre class="brush: js">const log = document.querySelector('.event-log-contents');
+const reload = document.querySelector('#reload');
+
+reload.addEventListener('click', () =&gt; {
+ log.textContent ='';
+ window.setTimeout(() =&gt; {
+ window.location.reload(true);
+ }, 200);
+});
+
+window.addEventListener('load', (event) =&gt; {
+ log.textContent = log.textContent + 'load\n';
+});
+
+document.addEventListener('readystatechange', (event) =&gt; {
+ log.textContent = log.textContent + `readystate: ${document.readyState}\n`;
+});
+
+document.addEventListener('DOMContentLoaded', (event) =&gt; {
+ log.textContent = log.textContent + `DOMContentLoaded\n`;
+});
+
+</pre>
+
+<h4 id="结果">结果</h4>
+
+<p><iframe class="live-sample-frame sample-code-frame" frameborder="0" height="160px" id="frame_Live_example" src="https://mdn.mozillademos.org/en-US/docs/Web/API/Document/readystatechange_event$samples/Live_example?revision=1607037" width="100%"></iframe></p>
+
+<h2 id="规范">规范</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">规范</th>
+ <th scope="col">状态</th>
+ <th scope="col">备注</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName("HTML WHATWG", "indices.html#event-readystatechange", "readystatechange")}}</td>
+ <td>{{Spec2("HTML WHATWG")}}</td>
+ <td></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+
+
+<p>{{Compat("api.Document.readystatechange_event")}}</p>
+
+<p>IE 浏览器是一直支持 <code>readystatechange</code> 事件的,可作为 <a href="/zh-CN/docs/Mozilla_event_reference/DOMContentLoaded_(event)">DOMContentLoaded </a>事件的替代方法(参见<a href="https://developer.mozilla.org/en-US/docs/Mozilla_event_reference/DOMContentLoaded_%28event%29#Browser_compatibility">Browser compatibility</a>的注释 [2])。</p>
+
+<h2 id="参见">参见</h2>
+
+<ul>
+ <li>{{event("DOMContentLoaded")}}</li>
+ <li>{{event("load")}}</li>
+ <li>{{event("beforeunload")}}</li>
+ <li>{{event("unload")}}</li>
+</ul>
diff --git a/files/zh-cn/web/api/document/stylesheets/index.html b/files/zh-cn/web/api/document/stylesheets/index.html
deleted file mode 100644
index de44c8537b..0000000000
--- a/files/zh-cn/web/api/document/stylesheets/index.html
+++ /dev/null
@@ -1,26 +0,0 @@
----
-title: Document.styleSheets
-slug: Web/API/Document/styleSheets
-translation_of: Web/API/DocumentOrShadowRoot/styleSheets
-translation_of_original: Web/API/Document/styleSheets
----
-<div>{{APIRef}}</div>
-
-<p><strong><code>Document.styleSheets</code></strong> 只读属性,返回一个由 {{domxref("StyleSheet ")}} 对象组成的 {{domxref("StyleSheetList")}},每个 {{domxref("StyleSheet ")}} 对象都是一个文档中链接或嵌入的样式表。</p>
-
-<h2 id="Syntax" name="Syntax">语法</h2>
-
-<pre class="syntaxbox">let <var>styleSheetList</var> = <em>document</em>.styleSheets;
-</pre>
-
-<p>返回的对象是一个 {{domxref("StyleSheetList")}}。</p>
-
-<p>它是一个 {{domxref("StyleSheet")}} 对象的有序集合。<code><em>styleSheetList</em>.item(<em>index</em>)</code> 或 <code><em>styleSheetList</em>{{ mediawiki.External('<em>index</em>') }}</code> 根据它的索引(索引基于0)返回一个单独的样式表对象。</p>
-
-<pre class="syntaxbox"> </pre>
-
-<h2 id="Specification" name="Specification">规范</h2>
-
-<ul>
- <li><a class="external" href="http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-DocumentStyle-styleSheets">DOM Level 2 Style: styleSheets</a></li>
-</ul>
diff --git a/files/zh-cn/web/api/document/rouchmove_event/index.html b/files/zh-cn/web/api/document/touchmove_event/index.html
index 1321a0c4d2..1321a0c4d2 100644
--- a/files/zh-cn/web/api/document/rouchmove_event/index.html
+++ b/files/zh-cn/web/api/document/touchmove_event/index.html