From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../web/api/shadowroot/delegatesfocus/index.html | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 files/zh-cn/web/api/shadowroot/delegatesfocus/index.html (limited to 'files/zh-cn/web/api/shadowroot/delegatesfocus') diff --git a/files/zh-cn/web/api/shadowroot/delegatesfocus/index.html b/files/zh-cn/web/api/shadowroot/delegatesfocus/index.html new file mode 100644 index 0000000000..62073edb52 --- /dev/null +++ b/files/zh-cn/web/api/shadowroot/delegatesfocus/index.html @@ -0,0 +1,38 @@ +--- +title: ShadowRoot.delegatesFocus +slug: Web/API/ShadowRoot/delegatesFocus +translation_of: Web/API/ShadowRoot/delegatesFocus +--- +
{{APIRef("Shadow DOM")}}
+ +

{{domxref("ShadowRoot")}} 接口中的只读属性 delegatesFocus 返回一个布尔值表明 delegatesFocus是否在shadow被附加的时候设置了。

+ +

这目前是一个实验的非标准特性,仅在Chrome中可用。

+ +

语法

+ +
var df = shadowRoot.delegatesFocus
+ +

+ +

一个布尔值 — true 值表明shadow root已经delegate focus, false 反之.

+ +

示例

+ +
let customElem = document.querySelector('my-shadow-dom-element');
+let shadow = customElem.shadowRoot;
+
+  ...
+
+// Does it delegate focus?
+let hostElem = shadow.delegatesFocus;
+ +

标准

+ +

这目前是个非标准特性。

+ +

浏览器兼容性

+ + + +

{{Compat("api.ShadowRoot.delegatesFocus")}}

-- cgit v1.2.3-54-g00ecf