From 49c5601989809c347a5a595e3c5edc08731e5305 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Mon, 19 Jul 2021 14:36:49 -0400 Subject: Remove previously orphaned file (#1616) * remove previously orphaned file * rid of more * remove one more * remove more * another one * delete more --- files/zh-cn/_wikihistory.json | 50 ------ files/zh-cn/web/api/domlocator/index.html | 51 ------ files/zh-cn/web/api/element/after/index.html | 176 ------------------- files/zh-cn/web/api/element/before/index.html | 188 --------------------- files/zh-cn/web/api/element/remove/index.html | 96 ----------- files/zh-cn/web/api/element/replacewith/index.html | 112 ------------ files/zh-cn/web/api/renderingcontext/index.html | 30 ---- files/zh-cn/web/events/mutation_events/index.html | 63 ------- 8 files changed, 766 deletions(-) delete mode 100644 files/zh-cn/web/api/domlocator/index.html delete mode 100644 files/zh-cn/web/api/element/after/index.html delete mode 100644 files/zh-cn/web/api/element/before/index.html delete mode 100644 files/zh-cn/web/api/element/remove/index.html delete mode 100644 files/zh-cn/web/api/element/replacewith/index.html delete mode 100644 files/zh-cn/web/api/renderingcontext/index.html delete mode 100644 files/zh-cn/web/events/mutation_events/index.html (limited to 'files') diff --git a/files/zh-cn/_wikihistory.json b/files/zh-cn/_wikihistory.json index 211897a137..f43a63b1b0 100644 --- a/files/zh-cn/_wikihistory.json +++ b/files/zh-cn/_wikihistory.json @@ -49538,50 +49538,6 @@ "AlexChao" ] }, - "orphaned/Web/API/ChildNode/after": { - "modified": "2020-10-15T21:51:08.472Z", - "contributors": [ - "Ende93", - "Cattla" - ] - }, - "orphaned/Web/API/ChildNode/before": { - "modified": "2019-03-23T22:12:22.842Z", - "contributors": [ - "caoweiju" - ] - }, - "orphaned/Web/API/ChildNode/remove": { - "modified": "2020-10-15T21:27:27.352Z", - "contributors": [ - "RainSlide", - "iSmartSV", - "duola8789", - "pasturn", - "Ende93", - "xgqfrms-GitHub", - "ceverytime", - "teoli", - "khalid32", - "ziyunfei", - "Darrel.Hsu" - ] - }, - "orphaned/Web/API/ChildNode/replaceWith": { - "modified": "2020-10-15T21:56:06.625Z", - "contributors": [ - "ecnelises", - "SphinxKnight", - "wzx", - "VictorDu" - ] - }, - "orphaned/Web/API/DOMLocator": { - "modified": "2019-03-23T22:08:16.598Z", - "contributors": [ - "ResJay" - ] - }, "orphaned/Web/API/Detecting_device_orientation": { "modified": "2020-10-15T21:21:28.912Z", "contributors": [ @@ -50067,12 +50023,6 @@ "lauhua" ] }, - "orphaned/Web/API/RenderingContext": { - "modified": "2019-03-23T22:53:04.731Z", - "contributors": [ - "ice-i-snow" - ] - }, "orphaned/Web/API/Request/context": { "modified": "2020-10-15T22:30:43.048Z", "contributors": [ diff --git a/files/zh-cn/web/api/domlocator/index.html b/files/zh-cn/web/api/domlocator/index.html deleted file mode 100644 index 77ad2f17bb..0000000000 --- a/files/zh-cn/web/api/domlocator/index.html +++ /dev/null @@ -1,51 +0,0 @@ ---- -title: DOMLocator -slug: orphaned/Web/API/DOMLocator -translation_of: Web/API/DOMLocator -original_slug: Web/API/DOMLocator ---- -

{{APIRef("DOM")}}{{obsolete_header}}

- -
-

NOTE: This is not implemented in Mozilla

-
- -

Indicates a location such as where an error occurred. Returned by DOMError.location.

- -

Properties

- -
-
{{domxref("DOMLocator.lineNumber")}} {{ReadOnlyInline}}
-
Returns a positiove integer or -1.
-
{{domxref("DOMLocator.columnNumber")}}  {{ReadOnlyInline}}
-
Returns a positiove integer or -1.
-
{{domxref("DOMLocator.byteOffset")}} {{ReadOnlyInline}}
-
Returns a positiove integer or -1.
-
{{domxref("DOMLocator.utf16Offset")}} {{ReadOnlyInline}}
-
Returns a positiove integer or -1.
-
{{domxref("DOMLocator.relatedNode")}} {{ReadOnlyInline}}
-
Returns a positiove integer or -1.
-
{{domxref("DOMLocator.uri")}} {{ReadOnlyInline}}
-
Returns a positiove integer or -1.
-
- -

Methods

- -

This interface neither implements, nor inherits, any method.

- -

Specifications

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName("DOM3 Core", "core.html#Interfaces-DOMLocator", "DOMLocator")}}{{Spec2("DOM3 Core")}}Initial definition
\ No newline at end of file diff --git a/files/zh-cn/web/api/element/after/index.html b/files/zh-cn/web/api/element/after/index.html deleted file mode 100644 index 76792e7638..0000000000 --- a/files/zh-cn/web/api/element/after/index.html +++ /dev/null @@ -1,176 +0,0 @@ ---- -title: ChildNode.after() -slug: orphaned/Web/API/ChildNode/after -translation_of: Web/API/ChildNode/after -original_slug: Web/API/ChildNode/after ---- -
{{APIRef("DOM")}}
- -

ChildNode.after() 方法会在其父节点的子节点列表中插入一些 {{domxref("Node")}} 或 {{domxref("DOMString")}} 对象。插入位置为该节点之后。{{domxref("DOMString")}} 对象会被以 {{domxref("Text")}} 的形式插入。

- -

语法

- -
[Throws, Unscopable]
-void ChildNode.after((Node or DOMString)... nodes);
-
- -

参数

- -
-
nodes
-
一组准备插入的 {{domxref("Node")}} 或 {{domxref("DOMString")}} 。
-
- -

错误

- - - -

示例

- -

插入元素

- -
var parent = document.createElement("div");
-var child = document.createElement("p");
-parent.appendChild(child);
-var span = document.createElement("span");
-
-child.after(span);
-
-console.log(parent.outerHTML);
-// "<div><p></p><span></span></div>"
-
- -

插入文本

- -
var parent = document.createElement("div");
-var child = document.createElement("p");
-parent.appendChild(child);
-
-child.after("Text");
-
-console.log(parent.outerHTML);
-// "<div><p></p>Text</div>"
- -

同时插入元素和文本

- -
var parent = document.createElement("div");
-var child = document.createElement("p");
-parent.appendChild(child);
-var span = document.createElement("span");
-
-child.after(span, "Text");
-
-console.log(parent.outerHTML);
-// "<div><p></p><span></span>Text</div>"
- -

ChildNode.after() 会被 with 环境排除

- -

after() 方法不在 with 环境的范围内,可以查看 {{jsxref("Symbol.unscopables")}} 来了解更多信息。

- -
with(node) {
-  after("foo");
-}
-// ReferenceError: after is not defined 
- -

Polyfill

- -

You can polyfill the after() method in Internet Explorer 9 and higher with the following code:

- -
// from: https://github.com/jserz/js_piece/blob/master/DOM/ChildNode/after()/after().md
-(function (arr) {
-  arr.forEach(function (item) {
-    if (item.hasOwnProperty('after')) {
-      return;
-    }
-    Object.defineProperty(item, 'after', {
-      configurable: true,
-      enumerable: true,
-      writable: true,
-      value: function after() {
-        var argArr = Array.prototype.slice.call(arguments),
-          docFrag = document.createDocumentFragment();
-
-        argArr.forEach(function (argItem) {
-          var isNode = argItem instanceof Node;
-          docFrag.appendChild(isNode ? argItem : document.createTextNode(String(argItem)));
-        });
-
-        this.parentNode.insertBefore(docFrag, this.nextSibling);
-      }
-    });
-  });
-})([Element.prototype, CharacterData.prototype, DocumentType.prototype]);
- -

Another polyfill

- -
// from: https://github.com/FabioVergani/js-Polyfill_Element.prototype.after/blob/master/after.js
-
-(function(x){
- var o=x.prototype,p='after';
- if(!o[p]){
-    o[p]=function(){
-     var e, m=arguments, l=m.length, i=0, t=this, p=t.parentNode, n=Node, s=String, d=document;
-     if(p!==null){
-        while(i<l){
-         e=m[i];
-         if(e instanceof n){
-            t=t.nextSibling;
-            if(t!==null){
-                p.insertBefore(e,t);
-            }else{
-                p.appendChild(e);
-            };
-         }else{
-            p.appendChild(d.createTextNode(s(e)));
-         };
-         ++i;
-        };
-     };
-    };
- };
-})(Element);
-
-
-
-/*
-minified:
-
-(function(x){
- var o=x.prototype;
- o.after||(o.after=function(){var e,m=arguments,l=m.length,i=0,t=this,p=t.parentNode,n=Node,s=String,d=document;if(p!==null){while(i<l){((e=m[i]) instanceof n)?(((t=t.nextSibling )!==null)?p.insertBefore(e,t):p.appendChild(e)):p.appendChild(d.createTextNode(s(e)));++i;}}});
-}(Element));
-*/
- -

规范

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('DOM WHATWG', '#dom-childnode-after', 'ChildNode.after()')}}{{Spec2('DOM WHATWG')}}Initial definition.
- -

浏览器兼容性

- -

{{Compat("api.ChildNode.after")}}

- -

相关链接

- - diff --git a/files/zh-cn/web/api/element/before/index.html b/files/zh-cn/web/api/element/before/index.html deleted file mode 100644 index add3dab015..0000000000 --- a/files/zh-cn/web/api/element/before/index.html +++ /dev/null @@ -1,188 +0,0 @@ ---- -title: ChildNode.before() -slug: orphaned/Web/API/ChildNode/before -tags: - - api、dom、节点、方法 -translation_of: Web/API/ChildNode/before -original_slug: Web/API/ChildNode/before ---- -
{{APIRef("DOM")}} {{SeeCompatTable}}
- -

 ChildNode.before 方法可以在ChildNode这个节点的父节点中插入一些列的 {{domxref("Node")}} 或者 {{domxref("DOMString")}} 对象,位置就是在ChildNode节点的前面,{{domxref("DOMString")}} 对象其实和 {{domxref("Text")}}节点一样的方式来完成插入的。

- -

语法

- -
[Throws, Unscopable]
-void ChildNode.before((Node or DOMString)... nodes);
-
- -

Parameters参数

- -
-
nodes
-
一系列的 {{domxref("Node")}} 或者 {{domxref("DOMString")}} 
-
- -

Exceptions

- - - -

Examples事例

- -

Inserting an element插入元素节点

- -
var parent = document.createElement("div");
-var child = document.createElement("p");
-parent.appendChild(child);
-var span = document.createElement("span");
-
-child.before(span);
-
-console.log(parent.outerHTML);
-// "<div><span></span><p></p></div>"
-
- -

Inserting text插入文本节点

- -
var parent = document.createElement("div");
-var child = document.createElement("p");
-parent.appendChild(child);
-
-child.before("Text");
-
-console.log(parent.outerHTML);
-// "<div>Text<p></p></div>"
- -

Inserting an element and text同时插入文本和元素

- -
var parent = document.createElement("div");
-var child = document.createElement("p");
-parent.appendChild(child);
-var span = document.createElement("span");
-
-child.before(span, "Text");
-
-console.log(parent.outerHTML);
-// "<div><span></span>Text<p></p></div>"
- -

ChildNode.before() is unscopable不可使用区域

- -

The before() 不能配合with声明使用,See {{jsxref("Symbol.unscopables")}} for more information.

- -
with(node) {
-  before("foo");
-}
-// ReferenceError: before is not defined 
- -

Polyfill

- -

兼容ie9或者更高版本的方法,You can polyfill the before() method in Internet Explorer 9 and higher with the following code:

- -
// from: https://github.com/jserz/js_piece/blob/master/DOM/ChildNode/before()/before().md
-(function (arr) {
-  arr.forEach(function (item) {
-    if (item.hasOwnProperty('before')) {
-      return;
-    }
-    Object.defineProperty(item, 'before', {
-      configurable: true,
-      enumerable: true,
-      writable: true,
-      value: function before() {
-        var argArr = Array.prototype.slice.call(arguments),
-          docFrag = document.createDocumentFragment();
-
-        argArr.forEach(function (argItem) {
-          var isNode = argItem instanceof Node;
-          docFrag.appendChild(isNode ? argItem : document.createTextNode(String(argItem)));
-        });
-
-        this.parentNode.insertBefore(docFrag, this);
-      }
-    });
-  });
-})([Element.prototype, CharacterData.prototype, DocumentType.prototype]);
- -

Specification

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('DOM WHATWG', '#dom-childnode-before', 'ChildNode.before()')}}{{Spec2('DOM WHATWG')}}Initial definition.
- -

Browser compatibility

- -

{{CompatibilityTable}}

- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatChrome(54.0)}}{{CompatGeckoDesktop(49)}}{{CompatUnknown}}{{CompatOpera(39)}}{{CompatUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidAndroid WebviewFirefox Mobile (Gecko)IE MobileOpera MobileSafari MobileChrome for Android
Basic support{{CompatNo}}{{CompatChrome(54.0)}}{{CompatGeckoMobile(49)}}{{CompatUnknown}}{{CompatOpera(39)}}{{CompatUnknown}}{{CompatChrome(54.0)}}
-
- -

See also

- - diff --git a/files/zh-cn/web/api/element/remove/index.html b/files/zh-cn/web/api/element/remove/index.html deleted file mode 100644 index b60cab7a0c..0000000000 --- a/files/zh-cn/web/api/element/remove/index.html +++ /dev/null @@ -1,96 +0,0 @@ ---- -title: ChildNode.remove() -slug: orphaned/Web/API/ChildNode/remove -tags: - - API - - ChildNode - - DOM - - Method -translation_of: Web/API/ChildNode/remove -original_slug: Web/API/ChildNode/remove ---- -

{{APIRef("DOM")}}

- -

ChildNode.remove() 方法,把对象从它所属的 DOM 树中删除。

- -

语法

- -
node.remove();
- -

示例

- -

使用 remove()

- -
<div id="div-01">Here is div-01</div>
-<div id="div-02">Here is div-02</div>
-<div id="div-03">Here is div-03</div>
-
- -
var el = document.getElementById('div-02');
-el.remove();
-// id 为 'div-02' 的 div 被删掉了
-
- -

{{EmbedLiveSample('使用_remove()')}}

- -

ChildNode.remove() 是不可见的

- -

with 语句中,remove() 方法是不可见的。参阅 {{jsxref("Symbol.unscopables")}} 了解更多信息。

- -
with(node) {
-  remove();
-}
-// ReferenceError: remove is not defined
- -

Polyfill

- -

You can polyfill the remove() method in Internet Explorer 9 and higher with the following code:

- -
//https://github.com/jserz/js_piece/blob/master/DOM/ChildNode/remove()/remove().md
-(function (arr) {
-   arr.forEach(function (item) {
-    if (item.hasOwnProperty('remove')) {
-      return;
-    }
-    Object.defineProperty(item, 'remove', {
-      configurable: true,
-      enumerable: true,
-      writable: true,
-      value: function remove() {
-        this.parentNode.removeChild(this);
-      }
-    });
-  });
-})([Element.prototype, CharacterData.prototype, DocumentType.prototype]);
- -

规范

- - - - - - - - - - - - - - -
规范状态注释
{{SpecName('DOM WHATWG', '#dom-childnode-remove', 'ChildNode.remove')}}{{Spec2('DOM WHATWG')}}Initial definition.
- -

浏览器兼容性

- - - -

{{Compat("api.ChildNode.remove")}}

- -

参见

- - diff --git a/files/zh-cn/web/api/element/replacewith/index.html b/files/zh-cn/web/api/element/replacewith/index.html deleted file mode 100644 index 9f3ef5bd88..0000000000 --- a/files/zh-cn/web/api/element/replacewith/index.html +++ /dev/null @@ -1,112 +0,0 @@ ---- -title: ChildNode.replaceWith() -slug: orphaned/Web/API/ChildNode/replaceWith -tags: - - DOM - - Node -translation_of: Web/API/ChildNode/replaceWith -original_slug: Web/API/ChildNode/replaceWith ---- -
{{APIRef("DOM")}} {{SeeCompatTable}}
- -

ChildNode.replaceWith() 的方法用一套 {{domxref("Node")}} 对象或者 {{domxref("DOMString")}} 对象,替换了该节点父节点下的子节点 。{{domxref("DOMString")}} 对象被当做等效的{{domxref("Text")}} 节点插入。

- -

语法

- -
[Throws, Unscopable]
-void ChildNode.replaceWith((Node or DOMString)... nodes);
-
- -

参数

- -
-
节点
-
一系列用来替换的{{domxref("Node")}} 对象或者 {{domxref("DOMString")}} 对象。
-
- -

例外

- - - -

案例

- -

Using replaceWith()

- -
var parent = document.createElement("div");
-var child = document.createElement("p");
-parent.appendChild(child);
-var span = document.createElement("span");
-
-child.replaceWith(span);
-
-console.log(parent.outerHTML);
-// "<div><span></span></div>"
-
- -

ChildNode.replaceWith() is unscopable

- -

replaceWith()的方法并没有作用于with语句. 参考 {{jsxref("Symbol.unscopables")}} 获取更多信息.

- -
with(node) {
-  replaceWith("foo");
-}
-// ReferenceError: replaceWith is not defined 
- -

Polyfill

- -

你可以在IE9及更高级的浏览器中使用下面的代码向上兼容replaceWith()的方法:

- -
(function (arr) {
-  arr.forEach(function (item) {
-    if (item.hasOwnProperty('replaceWith')) {
-      return;
-    }
-    Object.defineProperty(item, 'replaceWith', {
-      configurable: true,
-      enumerable: true,
-      writable: true,
-      value: function replaceWith() {
-        var argArr = Array.prototype.slice.call(arguments),
-          docFrag = document.createDocumentFragment();
-
-        argArr.forEach(function (argItem) {
-          var isNode = argItem instanceof Node;
-          docFrag.appendChild(isNode ? argItem : document.createTextNode(String(argItem)));
-        });
-
-        this.parentNode.replaceChild(docFrag, this);
-      }
-    });
-  });
-})([Element.prototype, CharacterData.prototype, DocumentType.prototype]);
- -

规范

- - - - - - - - - - - - - - -
规范状态注释
{{SpecName('DOM WHATWG', '#dom-childnode-replacewith', 'ChildNode.replacewith()')}}{{Spec2('DOM WHATWG')}}Initial definition.
- -

浏览器兼容性

- -

{{Compat("api.ChildNode.replaceWith")}}

- -

参阅

- - diff --git a/files/zh-cn/web/api/renderingcontext/index.html b/files/zh-cn/web/api/renderingcontext/index.html deleted file mode 100644 index 3a1477c435..0000000000 --- a/files/zh-cn/web/api/renderingcontext/index.html +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: RenderingContext -slug: orphaned/Web/API/RenderingContext -translation_of: Web/API/RenderingContext -original_slug: Web/API/RenderingContext ---- -

{{APIRef("Canvas API")}}

- -

RenderingContext 是一个辅助类型,描述下面任何一个渲染上下文:  {{domxref("CanvasRenderingContext2D")}}, {{domxref("WebGLRenderingContext")}} 或者 {{domxref("WebGL2RenderingContext")}} (继承自 WebGLRenderingContext)。

- -

这是简化规范的辅助类型,它不是一个接口,也没有对象实现它。

- -

规范描述

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', "scripting.html#renderingcontext", "RenderingContext")}}{{Spec2('HTML WHATWG')}}Initial definition.
- -

 

\ No newline at end of file diff --git a/files/zh-cn/web/events/mutation_events/index.html b/files/zh-cn/web/events/mutation_events/index.html deleted file mode 100644 index 732cb7614b..0000000000 --- a/files/zh-cn/web/events/mutation_events/index.html +++ /dev/null @@ -1,63 +0,0 @@ ---- -title: Mutation events -slug: orphaned/Web/Guide/Events/Mutation_events -translation_of: Web/Guide/Events/Mutation_events -original_slug: Web/Guide/Events/Mutation_events ---- -

{{deprecated_header()}}

- -

Mutation 事件 为web页面提供一种机制或扩展,以便在DOM被改变时获得通知。如果可能请用Mutation Observers代替。

- -

前言

- -

这个 mutation 事件在DOM Events 标准 中已被列为反对使用 , 因为在API的设计中有缺陷 (详情见发表于 public-webapps 的"DOM Mutation Events Replacement: The Story So Far / Existing Points of Consensus" )

- -

Mutation Observers 在DOM4中被提议用来取代mutation事件. 预计它们被列入 in Firefox 14 and Chrome 18中。

- -

避免用mutation事件的实际原因是性能问题跨浏览器支持

- -

性能

- -

为DOM添加 mutation 监听器极度降低进一步修改DOM文档的性能(慢1.5 - 7倍),此外, 移除监听器不会逆转的损害。

- -

性能好坏 限制了文档拥有mutation事件监听.

- -

跨浏览器支持

- -

这些事件在不同的浏览器实现并不一致, 例如:

- - - -

Dottoro documents browser support for mutation events.

- -

Mutation 事件列表

- -

下面是所有 mutation 事件列表, DOM Level 3 Events specification 中定义的:

- - - -

使用

- -

你可以如下所示使用element.addEventListener 注册一个mutation 事件监听器:

- -
element.addEventListener("DOMNodeInserted", function (ev) {
-  // ...
-}, false);
-
- -

事件对象在 {{ domxref("MutationEvent") }}传递给监听器 (见 its definition in the specification) 对于大多数的事件, 和 {{ domxref("MutationNameEvent") }} 用于 DOMAttributeNameChanged and DOMElementNameChanged.

-- cgit v1.2.3-54-g00ecf