aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/element/openorclosedshadowroot
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/api/element/openorclosedshadowroot
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/zh-cn/web/api/element/openorclosedshadowroot')
-rw-r--r--files/zh-cn/web/api/element/openorclosedshadowroot/index.html35
1 files changed, 35 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/element/openorclosedshadowroot/index.html b/files/zh-cn/web/api/element/openorclosedshadowroot/index.html
new file mode 100644
index 0000000000..145350e232
--- /dev/null
+++ b/files/zh-cn/web/api/element/openorclosedshadowroot/index.html
@@ -0,0 +1,35 @@
+---
+title: Element.openOrClosedShadowRoot
+slug: Web/API/Element/openOrClosedShadowRoot
+translation_of: Web/API/Element/openOrClosedShadowRoot
+---
+<div>{{APIRef("Shadow DOM")}}{{Draft}}{{non-standard_header}}
+<div class="note"><strong>Note:</strong> This API is available only to <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions">WebExtensions</a>.</div>
+</div>
+
+<p><span class="seoSummary"><code>Element.openOrCloseShadowRoot</code> 是一个只读属性。represents the shadow root hosted by the element, regardless if its {{DOMxRef("ShadowRoot.mode", "mode")}} is <code>open</code> or <code>closed</code>.</span> Use {{DOMxRef("Element.attachShadow()")}} to add a shadow root to an existing element.</p>
+
+<h2 id="Syntax" name="Syntax">Syntax</h2>
+
+<pre class="syntaxbox notranslate">var <em>shadowroot =</em><em> element</em>.shadowRoot;
+</pre>
+
+<h3 id="Value">Value</h3>
+
+<p>A {{DOMxRef("ShadowRoot")}} object instance, regardless if its {{DOMxRef("ShadowRoot.mode", "mode")}} is set to <code>open</code> or <code>closed</code>, or <code>null</code> if no shadow root is present. (See {{DOMxRef("Element.attachShadow()")}} for further details).</p>
+
+<h2 id="Specifications">Specifications</h2>
+
+<p><em>This property is not part of any specification.</em></p>
+
+<h2 id="Browser_compatibility">Browser compatibility</h2>
+
+
+
+<p>{{Compat("api.Element.openOrClosedShadowRoot")}}</p>
+
+<h2 id="See_also">See also</h2>
+
+<ul>
+ <li>{{DOMxRef("Element.shadowRoot")}}</li>
+</ul>