From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001
From: Peter Bengtsson <mail@peterbe.com>
Date: Tue, 8 Dec 2020 14:40:17 -0500
Subject: initial commit

---
 files/ja/web/api/document/adoptnode/index.html | 96 ++++++++++++++++++++++++++
 1 file changed, 96 insertions(+)
 create mode 100644 files/ja/web/api/document/adoptnode/index.html

(limited to 'files/ja/web/api/document/adoptnode/index.html')

diff --git a/files/ja/web/api/document/adoptnode/index.html b/files/ja/web/api/document/adoptnode/index.html
new file mode 100644
index 0000000000..a43521e7ce
--- /dev/null
+++ b/files/ja/web/api/document/adoptnode/index.html
@@ -0,0 +1,96 @@
+---
+title: Document.adoptNode()
+slug: Web/API/Document/adoptNode
+tags:
+  - API
+  - DOM
+  - DOM Reference
+  - Method
+  - NeedsExample
+  - NeedsSpecTable
+  - NeedsUpdate
+  - Reference
+translation_of: Web/API/Document/adoptNode
+---
+<div>{{ ApiRef("DOM") }}</div>
+
+<p><strong><code>Document.adoptNode()</code></strong> は、{{Glossary("node/dom", "ノード")}}を他の{{domxref("Document", "文書", "", "1")}}からメソッドの文書へ移動します。取り込まれたノードおよびそのサブツリーは (もしあれば) 元の文書から削除され、 {{domxref("Node.ownerDocument", "ownerDocument")}} が現在の文書に変更されます。その後、ノードを現在の文書に挿入することができます。</p>
+
+<h2 id="Syntax" name="Syntax">構文</h2>
+
+<pre class="syntaxbox notranslate">const <var>importedNode</var> = document.adoptNode(<var>externalNode</var>);
+</pre>
+
+<h3 id="Parameters" name="Parameters">引数</h3>
+
+<dl>
+ <dt><code><var>externalNode</var></code></dt>
+ <dd>他の文書から取り込まれるノードです。</dd>
+</dl>
+
+<h3 id="Return_value" name="Return_value">返値</h3>
+
+<p>インポートする文書のスコープ内にコピーされた <code><var>importedNode</var></code>。</p>
+
+<p>このメソッドを呼び出した後、 <code><var>importedNode</var></code> および <code><var>externalNode</var></code> は同じオブジェクトになります。</p>
+
+<div class="blockIndicator note">
+<p><strong>注:</strong> <code><var>importedNode</var></code> の {{domxref("Node.parentNode")}} は、まだ文書ツリーに挿入されていないので <code>null</code> です。</p>
+</div>
+
+<h2 id="Example" name="Example">例</h2>
+
+<pre class="brush: js notranslate">const iframe = document.querySelector('iframe');
+const iframeImages = iframe.contentDocument.querySelectorAll('img');
+const newParent = document.getElementById('images');
+
+iframeImages.forEach(function(imgEl) {
+  newParent.appendChild(document.adoptNode(imgEl));
+});
+</pre>
+
+<h2 id="Notes" name="Notes">注</h2>
+
+<p>外部の文書から取り込まれるノードは、現在の文書に挿入する前に、次のいずれかを実行してください。</p>
+
+<ul>
+ <li>{{domXref("document.importNode()")}} を使用して複製する</li>
+ <li>{{domXref("document.adoptNode()")}} を使用して取り込む</li>
+</ul>
+
+<div class="blockIndicator note">
+<p><strong>ベストプラクティス:</strong> Firefox は現在はこの規則を強制しませんが、将来の互換性を向上するためにこの規則に従うことを強くお勧めします。</p>
+</div>
+
+<p>{{domXref("Node.ownerDocument")}} の問題についての詳細は、 W3C DOM FAQ を参照してください。</p>
+
+<h2 id="Specification" name="Specification">仕様書</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('DOM WHATWG', '#dom-document-adoptnode', 'document.adoptNode')}}</td>
+   <td>{{Spec2('DOM WHATWG')}}</td>
+   <td></td>
+  </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2>
+
+<div class="hidden">このページの互換性一覧表は構造化データから生成されています。データに協力していただけるのであれば、 <a class="external" href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> をチェックアウトしてプルリクエストを送信してください。</div>
+
+<p>{{Compat("api.Document.adoptNode")}}</p>
+
+<h2 id="See_also" name="See_also">関連情報</h2>
+
+<ul>
+ <li>{{domxref("document.importNode()")}}</li>
+</ul>
-- 
cgit v1.2.3-54-g00ecf