blob: 62073edb52bfa8efe461f5cb5f9e805aeab7f7af (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
---
title: ShadowRoot.delegatesFocus
slug: Web/API/ShadowRoot/delegatesFocus
translation_of: Web/API/ShadowRoot/delegatesFocus
---
<div>{{APIRef("Shadow DOM")}}</div>
<p>{{domxref("ShadowRoot")}} 接口中的只读属性 <strong><code>delegatesFocus</code></strong> 返回一个布尔值表明 delegatesFocus是否在shadow被附加的时候设置了。</p>
<p>这目前是一个实验的非标准特性,仅在Chrome中可用。</p>
<h2 id="语法">语法</h2>
<pre class="syntaxbox">var <var>df</var> = <var>shadowRoot</var>.delegatesFocus</pre>
<h3 id="值">值</h3>
<p>一个布尔值 — <code>true</code> 值表明shadow root已经delegate focus, <code>false</code> 反之.</p>
<h2 id="示例">示例</h2>
<pre class="brush: js">let customElem = document.querySelector('my-shadow-dom-element');
let shadow = customElem.shadowRoot;
...
// Does it delegate focus?
let hostElem = shadow.delegatesFocus;</pre>
<h2 id="标准">标准</h2>
<p>这目前是个非标准特性。</p>
<h2 id="浏览器兼容性">浏览器兼容性</h2>
<p>{{Compat("api.ShadowRoot.delegatesFocus")}}</p>
|