aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/orphaned/web
diff options
context:
space:
mode:
authorMDN <actions@users.noreply.github.com>2021-03-16 00:26:29 +0000
committerMDN <actions@users.noreply.github.com>2021-03-16 00:26:29 +0000
commitd49032372e1ad262a313dc974d8de6bb6efbf784 (patch)
tree3d0d5ba8caa558ed95ab3223e461ba60908de3d8 /files/zh-cn/orphaned/web
parent6cc1c55b8391c160f9df683eebd3c35196dfd46c (diff)
downloadtranslated-content-d49032372e1ad262a313dc974d8de6bb6efbf784.tar.gz
translated-content-d49032372e1ad262a313dc974d8de6bb6efbf784.tar.bz2
translated-content-d49032372e1ad262a313dc974d8de6bb6efbf784.zip
[CRON] sync translated content
Diffstat (limited to 'files/zh-cn/orphaned/web')
-rw-r--r--files/zh-cn/orphaned/web/api/documentorshadowroot/index.html79
1 files changed, 79 insertions, 0 deletions
diff --git a/files/zh-cn/orphaned/web/api/documentorshadowroot/index.html b/files/zh-cn/orphaned/web/api/documentorshadowroot/index.html
new file mode 100644
index 0000000000..cc18771f80
--- /dev/null
+++ b/files/zh-cn/orphaned/web/api/documentorshadowroot/index.html
@@ -0,0 +1,79 @@
+---
+title: DocumentOrShadowRoot
+slug: orphaned/Web/API/DocumentOrShadowRoot
+tags:
+ - API
+ - DocumentOrShadowRoot
+ - Interface
+ - NeedsTranslation
+ - Reference
+ - TopicStub
+ - shadow dom
+translation_of: Web/API/DocumentOrShadowRoot
+original_slug: Web/API/DocumentOrShadowRoot
+---
+<div>{{APIRef("Web Components")}}</div>
+
+<p><span class="seoSummary"><a href="/zh-CN/docs/Web/Web_Components/Using_shadow_DOM">Shadow DOM API</a> 的 <strong><code>DocumentOrShadowRoot</code></strong> 接口提供了 documents 与 shadow roots 之间共享的 API。The following features are included in both {{DOMxRef("Document")}} and {{DOMxRef("ShadowRoot")}}.</span></p>
+
+<h2 id="属性">属性</h2>
+
+<dl>
+ <dt>{{DOMxRef("DocumentOrShadowRoot.activeElement")}}{{ReadOnlyInline}}</dt>
+ <dd>Returns the {{DOMxRef('Element')}} within the shadow tree that has focus.</dd>
+ <dt>{{DOMxRef("DocumentOrShadowRoot.fullscreenElement")}}{{ReadOnlyInline}}</dt>
+ <dd>Returns the {{DOMxRef('Element')}} that's currently in full screen mode for this document.</dd>
+ <dt>{{DOMxRef("DocumentOrShadowRoot.pointerLockElement")}} {{Experimental_Inline}}{{ReadOnlyInline}}</dt>
+ <dd>Returns the element set as the target for mouse events while the pointer is locked. It returns <code>null</code> if lock is pending, the pointer is unlocked, or if the target is in another document.</dd>
+ <dt>{{DOMxRef("DocumentOrShadowRoot.styleSheets")}}{{ReadOnlyInline}}</dt>
+ <dd>Returns a {{DOMxRef('StyleSheetList')}} of {{DOMxRef('CSSStyleSheet')}} objects for stylesheets explicitly linked into, or embedded in a document.</dd>
+</dl>
+
+<h2 id="方法">方法</h2>
+
+<dl>
+ <dt>{{DOMxRef("DocumentOrShadowRoot.caretPositionFromPoint()")}}</dt>
+ <dd>Returns a {{DOMxRef('CaretPosition')}} object containing the DOM node containing the caret, and caret's character offset within that node.</dd>
+ <dt>{{DOMxRef("DocumentOrShadowRoot.elementFromPoint()")}}</dt>
+ <dd>Returns the topmost element at the specified coordinates.</dd>
+ <dt>{{DOMxRef("DocumentOrShadowRoot.elementsFromPoint()")}}</dt>
+ <dd>Returns an array of all elements at the specified coordinates.</dd>
+ <dt>{{DOMxRef("DocumentOrShadowRoot.getSelection()")}}</dt>
+ <dd>Returns a {{DOMxRef('Selection')}} object representing the range of text selected by the user, or the current position of the caret.</dd>
+ <dt>{{DOMxRef("DocumentOrShadowRoot.nodeFromPoint()")}} {{non-standard_inline}}</dt>
+ <dd>Returns the topmost node at the specified coordinates.</dd>
+ <dt>{{DOMxRef("DocumentOrShadowRoot.nodesFromPoint()")}} {{non-standard_inline}}</dt>
+ <dd>Returns an array of all nodes at the specified coordinates.</dd>
+</dl>
+
+<h2 id="Specifications">Specifications</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('Shadow DOM','#extensions-to-the-documentorshadowroot-mixin','DocumentOrShadowRoot')}}</td>
+ <td>{{Spec2('Shadow DOM')}}</td>
+ <td>Implementation in Shadow DOM.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('DOM WHATWG','#mixin-documentorshadowroot','DocumentOrShadowRoot')}}</td>
+ <td>{{Spec2('DOM WHATWG')}}</td>
+ <td>Initial definition.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+
+
+<p>{{Compat("api.DocumentOrShadowRoot")}}</p>
+
+<p>[1] This interface's features are still implemented on the {{DOMxRef("Document")}} object.</p>