From 1afd214b4c6ed965b75ece5e8d75febad8bc7c07 Mon Sep 17 00:00:00 2001 From: MDN Date: Thu, 27 May 2021 00:56:56 +0000 Subject: [CRON] sync translated content --- files/ja/_redirects.txt | 1 + files/ja/_wikihistory.json | 14 +-- .../web/api/childnode/replacewith/index.html | 120 +++++++++++++++++++++ files/ja/web/api/childnode/replacewith/index.html | 119 -------------------- 4 files changed, 128 insertions(+), 126 deletions(-) create mode 100644 files/ja/orphaned/web/api/childnode/replacewith/index.html delete mode 100644 files/ja/web/api/childnode/replacewith/index.html (limited to 'files/ja') diff --git a/files/ja/_redirects.txt b/files/ja/_redirects.txt index 49b308eb2e..da70e4015f 100644 --- a/files/ja/_redirects.txt +++ b/files/ja/_redirects.txt @@ -3723,6 +3723,7 @@ /ja/docs/Web/API/CanvasRenderingContext2D.removeHitRegion /ja/docs/Web/API/CanvasRenderingContext2D/removeHitRegion /ja/docs/Web/API/Canvas_API/Drawing_graphics_with_canvas /ja/docs/conflicting/Web/API/Canvas_API/Tutorial_3cd5468edc15a1ef1ddc0d2b17e1fa5d /ja/docs/Web/API/ChildNode/remove /ja/docs/orphaned/Web/API/ChildNode/remove +/ja/docs/Web/API/ChildNode/replaceWith /ja/docs/orphaned/Web/API/ChildNode/replaceWith /ja/docs/Web/API/Console.error /ja/docs/Web/API/Console/error /ja/docs/Web/API/Coordinates /ja/docs/Web/API/GeolocationCoordinates /ja/docs/Web/API/DOMCursor.done /ja/docs/Web/API/DOMCursor/done diff --git a/files/ja/_wikihistory.json b/files/ja/_wikihistory.json index c036e9e759..8871adaacb 100644 --- a/files/ja/_wikihistory.json +++ b/files/ja/_wikihistory.json @@ -11643,13 +11643,6 @@ "Shirasu" ] }, - "Web/API/ChildNode/replaceWith": { - "modified": "2020-10-17T04:41:48.425Z", - "contributors": [ - "Potappo", - "Shirasu" - ] - }, "Web/API/Client": { "modified": "2020-10-15T22:28:43.389Z", "contributors": [ @@ -52339,6 +52332,13 @@ "chikoski" ] }, + "orphaned/Web/API/ChildNode/replaceWith": { + "modified": "2020-10-17T04:41:48.425Z", + "contributors": [ + "Potappo", + "Shirasu" + ] + }, "orphaned/Web/API/Detecting_device_orientation": { "modified": "2020-10-15T21:21:30.973Z", "contributors": [ diff --git a/files/ja/orphaned/web/api/childnode/replacewith/index.html b/files/ja/orphaned/web/api/childnode/replacewith/index.html new file mode 100644 index 0000000000..28896c90fd --- /dev/null +++ b/files/ja/orphaned/web/api/childnode/replacewith/index.html @@ -0,0 +1,120 @@ +--- +title: ChildNode.replaceWith() +slug: orphaned/Web/API/ChildNode/replaceWith +tags: + - API + - DOM + - Method + - Node + - Reference +translation_of: Web/API/ChildNode/replaceWith +original_slug: Web/API/ChildNode/replaceWith +--- +
{{APIRef("DOM")}}
+ +

ChildNode.replaceWith() は親の子リストの ChildNode を、 {{domxref("Node")}} または {{domxref("DOMString")}} オブジェクトのセットに置換します。 {{domxref("DOMString")}} オブジェクトは {{domxref("Text")}} ノードと等価なノードとして挿入されます。

+ +

構文

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

パラメーター

+ +
+
nodes
+
{{domxref("Node")}} または {{domxref("DOMString")}} オブジェクトのセットで置換します。
+
+ +

例外

+ + + +

+ +

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() はスコーピングに非対応

+ +

replaceWith() メソッドは with 文でのスコーピングに対応していません。詳細は {{jsxref("Symbol.unscopables")}} をご覧ください。

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

ポリフィル

+ +

以下のポリフィルで、 Internet Explorer 9 以降でも replaceWith() メソッドが利用できます。

+ +
function ReplaceWithPolyfill() {
+  'use-strict'; // For safari, and IE > 10
+  var parent = this.parentNode, i = arguments.length, currentNode;
+  if (!parent) return;
+  if (!i) // if there are no arguments
+    parent.removeChild(this);
+  while (i--) { // i-- decrements i and returns the value of i before the decrement
+    currentNode = arguments[i];
+    if (typeof currentNode !== 'object'){
+      currentNode = this.ownerDocument.createTextNode(currentNode);
+    } else if (currentNode.parentNode){
+      currentNode.parentNode.removeChild(currentNode);
+    }
+    // the value of "i" below is after the decrement
+    if (!i) // if currentNode is the first argument (currentNode === arguments[0])
+      parent.replaceChild(currentNode, this);
+    else // if currentNode isn't the first
+      parent.insertBefore(currentNode, this.nextSibling);
+  }
+}
+if (!Element.prototype.replaceWith)
+    Element.prototype.replaceWith = ReplaceWithPolyfill;
+if (!CharacterData.prototype.replaceWith)
+    CharacterData.prototype.replaceWith = ReplaceWithPolyfill;
+if (!DocumentType.prototype.replaceWith)
+    DocumentType.prototype.replaceWith = ReplaceWithPolyfill;
+ +

仕様

+ + + + + + + + + + + + + + +
仕様書策定状況コメント
{{SpecName('DOM WHATWG', '#dom-childnode-replacewith', 'ChildNode.replacewith()')}}{{Spec2('DOM WHATWG')}}初期定義
+ +

ブラウザー実装状況

+ + + +

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

+ +

関連情報

+ + diff --git a/files/ja/web/api/childnode/replacewith/index.html b/files/ja/web/api/childnode/replacewith/index.html deleted file mode 100644 index 1f5874de65..0000000000 --- a/files/ja/web/api/childnode/replacewith/index.html +++ /dev/null @@ -1,119 +0,0 @@ ---- -title: ChildNode.replaceWith() -slug: Web/API/ChildNode/replaceWith -tags: - - API - - DOM - - Method - - Node - - Reference -translation_of: Web/API/ChildNode/replaceWith ---- -
{{APIRef("DOM")}}
- -

ChildNode.replaceWith() は親の子リストの ChildNode を、 {{domxref("Node")}} または {{domxref("DOMString")}} オブジェクトのセットに置換します。 {{domxref("DOMString")}} オブジェクトは {{domxref("Text")}} ノードと等価なノードとして挿入されます。

- -

構文

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

パラメーター

- -
-
nodes
-
{{domxref("Node")}} または {{domxref("DOMString")}} オブジェクトのセットで置換します。
-
- -

例外

- - - -

- -

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() はスコーピングに非対応

- -

replaceWith() メソッドは with 文でのスコーピングに対応していません。詳細は {{jsxref("Symbol.unscopables")}} をご覧ください。

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

ポリフィル

- -

以下のポリフィルで、 Internet Explorer 9 以降でも replaceWith() メソッドが利用できます。

- -
function ReplaceWithPolyfill() {
-  'use-strict'; // For safari, and IE > 10
-  var parent = this.parentNode, i = arguments.length, currentNode;
-  if (!parent) return;
-  if (!i) // if there are no arguments
-    parent.removeChild(this);
-  while (i--) { // i-- decrements i and returns the value of i before the decrement
-    currentNode = arguments[i];
-    if (typeof currentNode !== 'object'){
-      currentNode = this.ownerDocument.createTextNode(currentNode);
-    } else if (currentNode.parentNode){
-      currentNode.parentNode.removeChild(currentNode);
-    }
-    // the value of "i" below is after the decrement
-    if (!i) // if currentNode is the first argument (currentNode === arguments[0])
-      parent.replaceChild(currentNode, this);
-    else // if currentNode isn't the first
-      parent.insertBefore(currentNode, this.nextSibling);
-  }
-}
-if (!Element.prototype.replaceWith)
-    Element.prototype.replaceWith = ReplaceWithPolyfill;
-if (!CharacterData.prototype.replaceWith)
-    CharacterData.prototype.replaceWith = ReplaceWithPolyfill;
-if (!DocumentType.prototype.replaceWith)
-    DocumentType.prototype.replaceWith = ReplaceWithPolyfill;
- -

仕様

- - - - - - - - - - - - - - -
仕様書策定状況コメント
{{SpecName('DOM WHATWG', '#dom-childnode-replacewith', 'ChildNode.replacewith()')}}{{Spec2('DOM WHATWG')}}初期定義
- -

ブラウザー実装状況

- - - -

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

- -

関連情報

- - -- cgit v1.2.3-54-g00ecf