From d49032372e1ad262a313dc974d8de6bb6efbf784 Mon Sep 17 00:00:00 2001 From: MDN Date: Tue, 16 Mar 2021 00:26:29 +0000 Subject: [CRON] sync translated content --- files/zh-cn/_redirects.txt | 5 +- files/zh-cn/_wikihistory.json | 44 +++++------ .../web/api/documentorshadowroot/index.html | 79 ++++++++++++++++++++ .../web/api/document/elementfrompoint/index.html | 86 ++++++++++++++++++++++ .../web/api/document/elementsfrompoint/index.html | 51 +++++++++++++ .../elementfrompoint/index.html | 85 --------------------- .../elementsfrompoint/index.html | 50 ------------- .../zh-cn/web/api/documentorshadowroot/index.html | 78 -------------------- 8 files changed, 241 insertions(+), 237 deletions(-) create mode 100644 files/zh-cn/orphaned/web/api/documentorshadowroot/index.html create mode 100644 files/zh-cn/web/api/document/elementfrompoint/index.html create mode 100644 files/zh-cn/web/api/document/elementsfrompoint/index.html delete mode 100644 files/zh-cn/web/api/documentorshadowroot/elementfrompoint/index.html delete mode 100644 files/zh-cn/web/api/documentorshadowroot/elementsfrompoint/index.html delete mode 100644 files/zh-cn/web/api/documentorshadowroot/index.html (limited to 'files/zh-cn') diff --git a/files/zh-cn/_redirects.txt b/files/zh-cn/_redirects.txt index 3908924a1b..4dd016de6b 100644 --- a/files/zh-cn/_redirects.txt +++ b/files/zh-cn/_redirects.txt @@ -1483,15 +1483,16 @@ /zh-CN/docs/Web/API/Document/defaultView/resize_event /zh-CN/docs/Web/API/Window/resize_event /zh-CN/docs/Web/API/Document/defaultView/storage_event /zh-CN/docs/Web/API/Window/storage_event /zh-CN/docs/Web/API/Document/domConfig /zh-CN/docs/Web/API/Document -/zh-CN/docs/Web/API/Document/elementFromPoint /zh-CN/docs/conflicting/Web/API/DocumentOrShadowRoot/elementFromPoint -/zh-CN/docs/Web/API/Document/elementsFromPoint /zh-CN/docs/conflicting/Web/API/DocumentOrShadowRoot/elementsFromPoint /zh-CN/docs/Web/API/Document/inputEncoding /zh-CN/docs/conflicting/Web/API/Document/characterSet /zh-CN/docs/Web/API/Document/mozFullScreen /zh-CN/docs/Web/API/Document/fullscreen /zh-CN/docs/Web/API/Document/mozFullScreenElement /zh-CN/docs/Web/API/Document/fullscreenElement /zh-CN/docs/Web/API/Document/mozFullScreenEnabled /zh-CN/docs/Web/API/Document/fullscreenEnabled /zh-CN/docs/Web/API/Document/onreadystatechange /en-US/docs/Web/API/Document/readystatechange_event /zh-CN/docs/Web/API/Document/rouchmove_event /zh-CN/docs/Web/API/Document/touchmove_event +/zh-CN/docs/Web/API/DocumentOrShadowRoot /zh-CN/docs/orphaned/Web/API/DocumentOrShadowRoot /zh-CN/docs/Web/API/DocumentOrShadowRoot/activeElement /zh-CN/docs/Web/API/Document/activeElement +/zh-CN/docs/Web/API/DocumentOrShadowRoot/elementFromPoint /zh-CN/docs/Web/API/Document/elementFromPoint +/zh-CN/docs/Web/API/DocumentOrShadowRoot/elementsFromPoint /zh-CN/docs/Web/API/Document/elementsFromPoint /zh-CN/docs/Web/API/DocumentOrShadowRoot/fullscreenElement /zh-CN/docs/Web/API/Document/fullscreenElement /zh-CN/docs/Web/API/DocumentOrShadowRoot/getSelection /zh-CN/docs/Web/API/Document/getSelection /zh-CN/docs/Web/API/DocumentOrShadowRoot/pointerLockElement /zh-CN/docs/Web/API/Document/pointerLockElement diff --git a/files/zh-cn/_wikihistory.json b/files/zh-cn/_wikihistory.json index 524f81d1c5..5bc5b5ff3b 100644 --- a/files/zh-cn/_wikihistory.json +++ b/files/zh-cn/_wikihistory.json @@ -10362,28 +10362,6 @@ "eventao" ] }, - "Web/API/DocumentOrShadowRoot": { - "modified": "2020-10-15T21:55:35.186Z", - "contributors": [ - "RainSlide", - "bei6", - "iainreid629" - ] - }, - "Web/API/DocumentOrShadowRoot/elementFromPoint": { - "modified": "2020-11-25T12:47:25.249Z", - "contributors": [ - "imgss", - "Bayes" - ] - }, - "Web/API/DocumentOrShadowRoot/elementsFromPoint": { - "modified": "2020-10-15T21:55:33.567Z", - "contributors": [ - "fscholz", - "1Cr18Ni9" - ] - }, "Web/API/DocumentTouch": { "modified": "2019-03-23T22:57:10.414Z", "contributors": [ @@ -50798,5 +50776,27 @@ "contributors": [ "WuCongMan" ] + }, + "Web/API/Document/elementFromPoint": { + "modified": "2020-11-25T12:47:25.249Z", + "contributors": [ + "imgss", + "Bayes" + ] + }, + "Web/API/Document/elementsFromPoint": { + "modified": "2020-10-15T21:55:33.567Z", + "contributors": [ + "fscholz", + "1Cr18Ni9" + ] + }, + "orphaned/Web/API/DocumentOrShadowRoot": { + "modified": "2020-10-15T21:55:35.186Z", + "contributors": [ + "RainSlide", + "bei6", + "iainreid629" + ] } } \ No newline at end of file diff --git a/files/zh-cn/orphaned/web/api/documentorshadowroot/index.html b/files/zh-cn/orphaned/web/api/documentorshadowroot/index.html new file mode 100644 index 0000000000..cc18771f80 --- /dev/null +++ b/files/zh-cn/orphaned/web/api/documentorshadowroot/index.html @@ -0,0 +1,79 @@ +--- +title: DocumentOrShadowRoot +slug: orphaned/Web/API/DocumentOrShadowRoot +tags: + - API + - DocumentOrShadowRoot + - Interface + - NeedsTranslation + - Reference + - TopicStub + - shadow dom +translation_of: Web/API/DocumentOrShadowRoot +original_slug: Web/API/DocumentOrShadowRoot +--- +
{{APIRef("Web Components")}}
+ +

Shadow DOM APIDocumentOrShadowRoot 接口提供了 documents 与 shadow roots 之间共享的 API。The following features are included in both {{DOMxRef("Document")}} and {{DOMxRef("ShadowRoot")}}.

+ +

属性

+ +
+
{{DOMxRef("DocumentOrShadowRoot.activeElement")}}{{ReadOnlyInline}}
+
Returns the {{DOMxRef('Element')}} within the shadow tree that has focus.
+
{{DOMxRef("DocumentOrShadowRoot.fullscreenElement")}}{{ReadOnlyInline}}
+
Returns the {{DOMxRef('Element')}} that's currently in full screen mode for this document.
+
{{DOMxRef("DocumentOrShadowRoot.pointerLockElement")}} {{Experimental_Inline}}{{ReadOnlyInline}}
+
Returns the element set as the target for mouse events while the pointer is locked. It returns null if lock is pending, the pointer is unlocked, or if the target is in another document.
+
{{DOMxRef("DocumentOrShadowRoot.styleSheets")}}{{ReadOnlyInline}}
+
Returns a {{DOMxRef('StyleSheetList')}} of {{DOMxRef('CSSStyleSheet')}} objects for stylesheets explicitly linked into, or embedded in a document.
+
+ +

方法

+ +
+
{{DOMxRef("DocumentOrShadowRoot.caretPositionFromPoint()")}}
+
Returns a {{DOMxRef('CaretPosition')}} object containing the DOM node containing the caret, and caret's character offset within that node.
+
{{DOMxRef("DocumentOrShadowRoot.elementFromPoint()")}}
+
Returns the topmost element at the specified coordinates.
+
{{DOMxRef("DocumentOrShadowRoot.elementsFromPoint()")}}
+
Returns an array of all elements at the specified coordinates.
+
{{DOMxRef("DocumentOrShadowRoot.getSelection()")}}
+
Returns a {{DOMxRef('Selection')}} object representing the range of text selected by the user, or the current position of the caret.
+
{{DOMxRef("DocumentOrShadowRoot.nodeFromPoint()")}} {{non-standard_inline}}
+
Returns the topmost node at the specified coordinates.
+
{{DOMxRef("DocumentOrShadowRoot.nodesFromPoint()")}} {{non-standard_inline}}
+
Returns an array of all nodes at the specified coordinates.
+
+ +

Specifications

+ + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Shadow DOM','#extensions-to-the-documentorshadowroot-mixin','DocumentOrShadowRoot')}}{{Spec2('Shadow DOM')}}Implementation in Shadow DOM.
{{SpecName('DOM WHATWG','#mixin-documentorshadowroot','DocumentOrShadowRoot')}}{{Spec2('DOM WHATWG')}}Initial definition.
+ +

浏览器兼容性

+ + + +

{{Compat("api.DocumentOrShadowRoot")}}

+ +

[1] This interface's features are still implemented on the {{DOMxRef("Document")}} object.

diff --git a/files/zh-cn/web/api/document/elementfrompoint/index.html b/files/zh-cn/web/api/document/elementfrompoint/index.html new file mode 100644 index 0000000000..5a0cdd7ffc --- /dev/null +++ b/files/zh-cn/web/api/document/elementfrompoint/index.html @@ -0,0 +1,86 @@ +--- +title: DocumentOrShadowRoot.elementFromPoint() +slug: Web/API/Document/elementFromPoint +translation_of: Web/API/DocumentOrShadowRoot/elementFromPoint +original_slug: Web/API/DocumentOrShadowRoot/elementFromPoint +--- +

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

+ +

{{domxref("DocumentOrShadowRoot")}} 接口的 elementFromPoint() 方法返回给定坐标点下最上层的 {{domxref('element')}} 元素。 

+ +

If the element at the specified point belongs to another document (for example, an iframe's subdocument), the subdocument's parent element is returned (the iframe itself). If the element at the given point is anonymous or XBL generated content, such as a textbox's scroll bars, then the first non-anonymous ancestor element (for example, the textbox) is returned.

+ +

如果指定的坐标点在文档的可视范围外,或者两个坐标都是负数,那么结果返回 null

+ +

If you need to find the specific position inside the element, use {{domxref("Document.caretPositionFromPoint()")}}.

+ +

Syntax

+ +
var element = document.elementFromPoint(x, y);
+ +

Parameters

+ +
+
x
+
坐标点的横坐标。
+
y
+
坐标点的纵坐标。
+
+ +

Returns

+ +

在给定的坐标点处的顶端 {{domxref("Element")}}(译者注:如果元素层叠的话,返回最上层的元素)。

+ +

Example

+ +
<!DOCTYPE html>
+<html lang="en">
+<head>
+<title>elementFromPoint example</title>
+
+<script>
+function changeColor(newColor) {
+  elem = document.elementFromPoint(2, 2);
+  elem.style.color = newColor;
+}
+</script>
+</head>
+
+<body>
+<p id="para1">Some text here</p>
+<button onclick="changeColor('blue');">blue</button>
+<button onclick="changeColor('red');">red</button>
+</body>
+</html>
+
+ +

Demo

+ +

{{ EmbedLiveSample('Example', '', '', '', 'Web/API/Document/elementFromPoint') }}

+ + + +

Specifications

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Shadow DOM','#extensions-to-the-documentorshadowroot-mixin','DocumentOrShadowRoot')}}{{Spec2('Shadow DOM')}}Initial definition.
+ +

Browser Compatibility

+ +
+ + +

{{Compat("api.DocumentOrShadowRoot.elementFromPoint")}}

+
diff --git a/files/zh-cn/web/api/document/elementsfrompoint/index.html b/files/zh-cn/web/api/document/elementsfrompoint/index.html new file mode 100644 index 0000000000..bea911988b --- /dev/null +++ b/files/zh-cn/web/api/document/elementsfrompoint/index.html @@ -0,0 +1,51 @@ +--- +title: DocumentOrShadowRoot.elementsFromPoint() +slug: Web/API/Document/elementsFromPoint +translation_of: Web/API/DocumentOrShadowRoot/elementsFromPoint +original_slug: Web/API/DocumentOrShadowRoot/elementsFromPoint +--- +

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

+ +

elementsFromPoint() 是 {{domxref("DocumentOrShadowRoot")}} 下的一个函数,该函数返还在特定坐标点下的HTML元素数组。

+ +

语法

+ +
var elements = document.elementsFromPoint(x, y);
+ +

参数

+ +
+
x
+
坐标点的水平坐标值
+
y
+
坐标点的垂向坐标值
+
+ +

返回值

+ +

一个包含 {{domxref('element')}} 对象的数组.

+ +

其他说明

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Shadow DOM','','elementsFromPoint()')}}{{Spec2('Shadow DOM')}}Initial definition.
+ +

浏览器兼容性

+ +
+ + +

{{Compat("api.DocumentOrShadowRoot.elementsFromPoint")}}

+
diff --git a/files/zh-cn/web/api/documentorshadowroot/elementfrompoint/index.html b/files/zh-cn/web/api/documentorshadowroot/elementfrompoint/index.html deleted file mode 100644 index e7e96436dc..0000000000 --- a/files/zh-cn/web/api/documentorshadowroot/elementfrompoint/index.html +++ /dev/null @@ -1,85 +0,0 @@ ---- -title: DocumentOrShadowRoot.elementFromPoint() -slug: Web/API/DocumentOrShadowRoot/elementFromPoint -translation_of: Web/API/DocumentOrShadowRoot/elementFromPoint ---- -

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

- -

{{domxref("DocumentOrShadowRoot")}} 接口的 elementFromPoint() 方法返回给定坐标点下最上层的 {{domxref('element')}} 元素。 

- -

If the element at the specified point belongs to another document (for example, an iframe's subdocument), the subdocument's parent element is returned (the iframe itself). If the element at the given point is anonymous or XBL generated content, such as a textbox's scroll bars, then the first non-anonymous ancestor element (for example, the textbox) is returned.

- -

如果指定的坐标点在文档的可视范围外,或者两个坐标都是负数,那么结果返回 null

- -

If you need to find the specific position inside the element, use {{domxref("Document.caretPositionFromPoint()")}}.

- -

Syntax

- -
var element = document.elementFromPoint(x, y);
- -

Parameters

- -
-
x
-
坐标点的横坐标。
-
y
-
坐标点的纵坐标。
-
- -

Returns

- -

在给定的坐标点处的顶端 {{domxref("Element")}}(译者注:如果元素层叠的话,返回最上层的元素)。

- -

Example

- -
<!DOCTYPE html>
-<html lang="en">
-<head>
-<title>elementFromPoint example</title>
-
-<script>
-function changeColor(newColor) {
-  elem = document.elementFromPoint(2, 2);
-  elem.style.color = newColor;
-}
-</script>
-</head>
-
-<body>
-<p id="para1">Some text here</p>
-<button onclick="changeColor('blue');">blue</button>
-<button onclick="changeColor('red');">red</button>
-</body>
-</html>
-
- -

Demo

- -

{{ EmbedLiveSample('Example', '', '', '', 'Web/API/Document/elementFromPoint') }}

- - - -

Specifications

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('Shadow DOM','#extensions-to-the-documentorshadowroot-mixin','DocumentOrShadowRoot')}}{{Spec2('Shadow DOM')}}Initial definition.
- -

Browser Compatibility

- -
- - -

{{Compat("api.DocumentOrShadowRoot.elementFromPoint")}}

-
diff --git a/files/zh-cn/web/api/documentorshadowroot/elementsfrompoint/index.html b/files/zh-cn/web/api/documentorshadowroot/elementsfrompoint/index.html deleted file mode 100644 index 6036115eaf..0000000000 --- a/files/zh-cn/web/api/documentorshadowroot/elementsfrompoint/index.html +++ /dev/null @@ -1,50 +0,0 @@ ---- -title: DocumentOrShadowRoot.elementsFromPoint() -slug: Web/API/DocumentOrShadowRoot/elementsFromPoint -translation_of: Web/API/DocumentOrShadowRoot/elementsFromPoint ---- -

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

- -

elementsFromPoint() 是 {{domxref("DocumentOrShadowRoot")}} 下的一个函数,该函数返还在特定坐标点下的HTML元素数组。

- -

语法

- -
var elements = document.elementsFromPoint(x, y);
- -

参数

- -
-
x
-
坐标点的水平坐标值
-
y
-
坐标点的垂向坐标值
-
- -

返回值

- -

一个包含 {{domxref('element')}} 对象的数组.

- -

其他说明

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('Shadow DOM','','elementsFromPoint()')}}{{Spec2('Shadow DOM')}}Initial definition.
- -

浏览器兼容性

- -
- - -

{{Compat("api.DocumentOrShadowRoot.elementsFromPoint")}}

-
diff --git a/files/zh-cn/web/api/documentorshadowroot/index.html b/files/zh-cn/web/api/documentorshadowroot/index.html deleted file mode 100644 index 0e3dd27717..0000000000 --- a/files/zh-cn/web/api/documentorshadowroot/index.html +++ /dev/null @@ -1,78 +0,0 @@ ---- -title: DocumentOrShadowRoot -slug: Web/API/DocumentOrShadowRoot -tags: - - API - - DocumentOrShadowRoot - - Interface - - NeedsTranslation - - Reference - - TopicStub - - shadow dom -translation_of: Web/API/DocumentOrShadowRoot ---- -
{{APIRef("Web Components")}}
- -

Shadow DOM APIDocumentOrShadowRoot 接口提供了 documents 与 shadow roots 之间共享的 API。The following features are included in both {{DOMxRef("Document")}} and {{DOMxRef("ShadowRoot")}}.

- -

属性

- -
-
{{DOMxRef("DocumentOrShadowRoot.activeElement")}}{{ReadOnlyInline}}
-
Returns the {{DOMxRef('Element')}} within the shadow tree that has focus.
-
{{DOMxRef("DocumentOrShadowRoot.fullscreenElement")}}{{ReadOnlyInline}}
-
Returns the {{DOMxRef('Element')}} that's currently in full screen mode for this document.
-
{{DOMxRef("DocumentOrShadowRoot.pointerLockElement")}} {{Experimental_Inline}}{{ReadOnlyInline}}
-
Returns the element set as the target for mouse events while the pointer is locked. It returns null if lock is pending, the pointer is unlocked, or if the target is in another document.
-
{{DOMxRef("DocumentOrShadowRoot.styleSheets")}}{{ReadOnlyInline}}
-
Returns a {{DOMxRef('StyleSheetList')}} of {{DOMxRef('CSSStyleSheet')}} objects for stylesheets explicitly linked into, or embedded in a document.
-
- -

方法

- -
-
{{DOMxRef("DocumentOrShadowRoot.caretPositionFromPoint()")}}
-
Returns a {{DOMxRef('CaretPosition')}} object containing the DOM node containing the caret, and caret's character offset within that node.
-
{{DOMxRef("DocumentOrShadowRoot.elementFromPoint()")}}
-
Returns the topmost element at the specified coordinates.
-
{{DOMxRef("DocumentOrShadowRoot.elementsFromPoint()")}}
-
Returns an array of all elements at the specified coordinates.
-
{{DOMxRef("DocumentOrShadowRoot.getSelection()")}}
-
Returns a {{DOMxRef('Selection')}} object representing the range of text selected by the user, or the current position of the caret.
-
{{DOMxRef("DocumentOrShadowRoot.nodeFromPoint()")}} {{non-standard_inline}}
-
Returns the topmost node at the specified coordinates.
-
{{DOMxRef("DocumentOrShadowRoot.nodesFromPoint()")}} {{non-standard_inline}}
-
Returns an array of all nodes at the specified coordinates.
-
- -

Specifications

- - - - - - - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('Shadow DOM','#extensions-to-the-documentorshadowroot-mixin','DocumentOrShadowRoot')}}{{Spec2('Shadow DOM')}}Implementation in Shadow DOM.
{{SpecName('DOM WHATWG','#mixin-documentorshadowroot','DocumentOrShadowRoot')}}{{Spec2('DOM WHATWG')}}Initial definition.
- -

浏览器兼容性

- - - -

{{Compat("api.DocumentOrShadowRoot")}}

- -

[1] This interface's features are still implemented on the {{DOMxRef("Document")}} object.

-- cgit v1.2.3-54-g00ecf