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/fr/_redirects.txt | 10 +- files/fr/_wikihistory.json | 46 +++---- .../web/api/documentorshadowroot/index.html | 79 ++++++++++++ .../web/api/document/elementfrompoint/index.html | 54 +++++++++ .../web/api/document/elementsfrompoint/index.html | 105 ++++++++++++++++ .../elementfrompoint/index.html | 54 --------- .../elementsfrompoint/index.html | 104 ---------------- files/fr/web/api/documentorshadowroot/index.html | 78 ------------ files/ja/_redirects.txt | 10 +- files/ja/_wikihistory.json | 50 ++++---- .../web/api/documentorshadowroot/index.html | 79 ++++++++++++ .../web/api/document/elementfrompoint/index.html | 51 ++++++++ .../web/api/document/elementsfrompoint/index.html | 103 ++++++++++++++++ .../elementfrompoint/index.html | 51 -------- .../elementsfrompoint/index.html | 102 ---------------- files/ja/web/api/documentorshadowroot/index.html | 78 ------------ files/ko/_redirects.txt | 1 + files/ko/_wikihistory.json | 14 +-- .../web/api/documentorshadowroot/index.html | 75 ++++++++++++ files/ko/web/api/documentorshadowroot/index.html | 74 ------------ files/pt-br/_redirects.txt | 2 +- files/pt-br/_wikihistory.json | 12 +- .../web/api/document/elementfrompoint/index.html | 134 +++++++++++++++++++++ .../elementfrompoint/index.html | 134 --------------------- 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 ------------ 32 files changed, 996 insertions(+), 982 deletions(-) create mode 100644 files/fr/orphaned/web/api/documentorshadowroot/index.html create mode 100644 files/fr/web/api/document/elementfrompoint/index.html create mode 100644 files/fr/web/api/document/elementsfrompoint/index.html delete mode 100644 files/fr/web/api/documentorshadowroot/elementfrompoint/index.html delete mode 100644 files/fr/web/api/documentorshadowroot/elementsfrompoint/index.html delete mode 100644 files/fr/web/api/documentorshadowroot/index.html create mode 100644 files/ja/orphaned/web/api/documentorshadowroot/index.html create mode 100644 files/ja/web/api/document/elementfrompoint/index.html create mode 100644 files/ja/web/api/document/elementsfrompoint/index.html delete mode 100644 files/ja/web/api/documentorshadowroot/elementfrompoint/index.html delete mode 100644 files/ja/web/api/documentorshadowroot/elementsfrompoint/index.html delete mode 100644 files/ja/web/api/documentorshadowroot/index.html create mode 100644 files/ko/orphaned/web/api/documentorshadowroot/index.html delete mode 100644 files/ko/web/api/documentorshadowroot/index.html create mode 100644 files/pt-br/web/api/document/elementfrompoint/index.html delete mode 100644 files/pt-br/web/api/documentorshadowroot/elementfrompoint/index.html 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 diff --git a/files/fr/_redirects.txt b/files/fr/_redirects.txt index 9809f553ab..cf0b650e44 100644 --- a/files/fr/_redirects.txt +++ b/files/fr/_redirects.txt @@ -922,7 +922,7 @@ /fr/docs/DOM/document.createTextNode /fr/docs/Web/API/Document/createTextNode /fr/docs/DOM/document.documentElement /fr/docs/Web/API/Document/documentElement /fr/docs/DOM/document.documentURIObject /fr/docs/Web/API/Document/documentURIObject -/fr/docs/DOM/document.elementFromPoint /fr/docs/Web/API/DocumentOrShadowRoot/elementFromPoint +/fr/docs/DOM/document.elementFromPoint /fr/docs/Web/API/Document/elementFromPoint /fr/docs/DOM/document.execCommand /fr/docs/Web/API/Document/execCommand /fr/docs/DOM/document.firstChild /fr/docs/Web/API/Node/firstChild /fr/docs/DOM/document.getElementById /fr/docs/Web/API/Document/getElementById @@ -1084,7 +1084,7 @@ /fr/docs/DOM:document.createTextNode /fr/docs/Web/API/Document/createTextNode /fr/docs/DOM:document.documentElement /fr/docs/Web/API/Document/documentElement /fr/docs/DOM:document.documentURIObject /fr/docs/Web/API/Document/documentURIObject -/fr/docs/DOM:document.elementFromPoint /fr/docs/Web/API/DocumentOrShadowRoot/elementFromPoint +/fr/docs/DOM:document.elementFromPoint /fr/docs/Web/API/Document/elementFromPoint /fr/docs/DOM:document.firstChild /fr/docs/Web/API/Node/firstChild /fr/docs/DOM:document.getElementById /fr/docs/Web/API/Document/getElementById /fr/docs/DOM:document.getElementsByClassName /fr/docs/Web/API/Document/getElementsByClassName @@ -3729,7 +3729,7 @@ /fr/docs/Web/API/Document.createTextNode /fr/docs/Web/API/Document/createTextNode /fr/docs/Web/API/Document.documentElement /fr/docs/Web/API/Document/documentElement /fr/docs/Web/API/Document.documentURIObject /fr/docs/Web/API/Document/documentURIObject -/fr/docs/Web/API/Document.elementFromPoint /fr/docs/Web/API/DocumentOrShadowRoot/elementFromPoint +/fr/docs/Web/API/Document.elementFromPoint /fr/docs/Web/API/Document/elementFromPoint /fr/docs/Web/API/Document.evaluate /fr/docs/Web/API/Document/evaluate /fr/docs/Web/API/Document.execCommand /fr/docs/Web/API/Document/execCommand /fr/docs/Web/API/Document.firstChild /fr/docs/Web/API/Node/firstChild @@ -3748,8 +3748,10 @@ /fr/docs/Web/API/Document/defaultView/popstate_event /fr/docs/Web/API/Window/popstate_event /fr/docs/Web/API/Document/defaultView/storage_event /fr/docs/Web/API/Window/storage_event /fr/docs/Web/API/Document/domConfig /fr/docs/Web/API/Document -/fr/docs/Web/API/Document/elementFromPoint /fr/docs/Web/API/DocumentOrShadowRoot/elementFromPoint +/fr/docs/Web/API/DocumentOrShadowRoot /fr/docs/orphaned/Web/API/DocumentOrShadowRoot /fr/docs/Web/API/DocumentOrShadowRoot/activeElement /fr/docs/Web/API/Document/activeElement +/fr/docs/Web/API/DocumentOrShadowRoot/elementFromPoint /fr/docs/Web/API/Document/elementFromPoint +/fr/docs/Web/API/DocumentOrShadowRoot/elementsFromPoint /fr/docs/Web/API/Document/elementsFromPoint /fr/docs/Web/API/DocumentOrShadowRoot/getSelection /fr/docs/Web/API/Document/getSelection /fr/docs/Web/API/DocumentOrShadowRoot/styleSheets /fr/docs/Web/API/Document/styleSheets /fr/docs/Web/API/Document_Object_Model/Exemples /fr/docs/Web/API/Document_Object_Model/Examples diff --git a/files/fr/_wikihistory.json b/files/fr/_wikihistory.json index 1dc036a2a5..30437756d3 100644 --- a/files/fr/_wikihistory.json +++ b/files/fr/_wikihistory.json @@ -7697,19 +7697,6 @@ "loella16" ] }, - "Web/API/DocumentOrShadowRoot": { - "modified": "2020-10-15T22:25:01.411Z", - "contributors": [ - "tristantheb" - ] - }, - "Web/API/DocumentOrShadowRoot/elementsFromPoint": { - "modified": "2020-10-15T22:25:00.754Z", - "contributors": [ - "SphinxKnight", - "RolandGautier" - ] - }, "Web/API/DocumentTouch": { "modified": "2019-03-23T22:50:40.193Z", "contributors": [ @@ -44970,16 +44957,6 @@ "BenoitL" ] }, - "Web/API/DocumentOrShadowRoot/elementFromPoint": { - "modified": "2019-03-23T23:50:28.633Z", - "contributors": [ - "fscholz", - "teoli", - "jsx", - "Mgjbot", - "BenoitL" - ] - }, "Web/API/HTMLElement/accessKey": { "modified": "2019-03-23T22:24:43.588Z", "contributors": [ @@ -46002,5 +45979,28 @@ "fscholz", "FredPl" ] + }, + "Web/API/Document/elementFromPoint": { + "modified": "2019-03-23T23:50:28.633Z", + "contributors": [ + "fscholz", + "teoli", + "jsx", + "Mgjbot", + "BenoitL" + ] + }, + "Web/API/Document/elementsFromPoint": { + "modified": "2020-10-15T22:25:00.754Z", + "contributors": [ + "SphinxKnight", + "RolandGautier" + ] + }, + "orphaned/Web/API/DocumentOrShadowRoot": { + "modified": "2020-10-15T22:25:01.411Z", + "contributors": [ + "tristantheb" + ] } } \ No newline at end of file diff --git a/files/fr/orphaned/web/api/documentorshadowroot/index.html b/files/fr/orphaned/web/api/documentorshadowroot/index.html new file mode 100644 index 0000000000..c359b4739d --- /dev/null +++ b/files/fr/orphaned/web/api/documentorshadowroot/index.html @@ -0,0 +1,79 @@ +--- +title: DocumentOrShadowRoot +slug: orphaned/Web/API/DocumentOrShadowRoot +tags: + - API + - Document + - DocumentOrShadowRoot + - Interface + - Reference + - ShadowRoot + - shadow dom +translation_of: Web/API/DocumentOrShadowRoot +original_slug: Web/API/DocumentOrShadowRoot +--- +
{{APIRef("Web Components")}}
+ +

Le DocumentOrShadowRoot mélange de l'API Shadow DOM qui fournit des API qui sont partagées entre les documents et les racines fantômes. Les fonctionnalités suivantes sont incluses dans {{DOMxRef("Document")}} et {{DOMxRef("ShadowRoot")}}.

+ +

Propriétés

+ +
+
{{DOMxRef("DocumentOrShadowRoot.activeElement")}}{{ReadOnlyInline}}
+
Renvoie l'{{DOMxRef('Element')}} dans l'arbre shadow qui a le focus.
+
{{DOMxRef("DocumentOrShadowRoot.fullscreenElement")}}{{ReadOnlyInline}}
+
Renvoie l'{{DOMxRef('Element')}} qui est actuellement en mode plein écran pour ce document.
+
{{DOMxRef("DocumentOrShadowRoot.pointerLockElement")}} {{Experimental_Inline}}{{ReadOnlyInline}}
+
Renvoie l'élément défini comme cible pour les événements de la souris lorsque le pointeur est verrouillé. Il renvoie null si le verrouillage est en cours, si le pointeur est déverrouillé ou si la cible se trouve dans un autre document.
+
{{DOMxRef("DocumentOrShadowRoot.styleSheets")}}{{ReadOnlyInline}}
+
Renvoie une {{DOMxRef('StyleSheetList')}} d'objets {{DOMxRef('CSSStyleSheet')}} pour les feuilles de style explicitement liées ou intégrées dans un document.
+
+ +

Méthodes

+ +
+
{{DOMxRef("DocumentOrShadowRoot.caretPositionFromPoint()")}}
+
Renvoie un objet {{DOMxRef('CaretPosition')}} contenant le noeud DOM contenant le signe d'insertion, et le décalage du caractère d'insertion dans ce noeud.
+
{{DOMxRef("DocumentOrShadowRoot.elementFromPoint()")}}
+
Renvoie l'élément le plus élevé aux coordonnées spécifiées.
+
{{DOMxRef("DocumentOrShadowRoot.elementsFromPoint()")}}
+
Renvoie un tableau de tous les éléments aux coordonnées spécifiées.
+
{{DOMxRef("DocumentOrShadowRoot.getSelection()")}}
+
Renvoie un objet {{DOMxRef('Selection')}} représentant la plage de texte sélectionnée par l'utilisateur, ou la position actuelle du curseur.
+
{{DOMxRef("DocumentOrShadowRoot.nodeFromPoint()")}} {{non-standard_inline}}
+
Renvoie le nœud supérieur aux coordonnées spécifiées.
+
{{DOMxRef("DocumentOrShadowRoot.nodesFromPoint()")}} {{non-standard_inline}}
+
Renvoie un tableau de tous les nœuds aux coordonnées spécifiées.
+
+ +

Spécifications

+ + + + + + + + + + + + + + + + + + + + + +
SpécificationStatutCommentaire
{{SpecName('Shadow DOM','#extensions-to-the-documentorshadowroot-mixin','DocumentOrShadowRoot')}}{{Spec2('Shadow DOM')}}Implémentation de Shadow DOM.
{{SpecName('DOM WHATWG','#mixin-documentorshadowroot','DocumentOrShadowRoot')}}{{Spec2('DOM WHATWG')}}Définition initiale.
+ +

Compatibilité des navigateurs

+ + + +

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

+ +

[1] Les fonctionnalités de cette interface sont toujours implémentées sur l'objet {{DOMxRef("Document")}}.

diff --git a/files/fr/web/api/document/elementfrompoint/index.html b/files/fr/web/api/document/elementfrompoint/index.html new file mode 100644 index 0000000000..8da838500d --- /dev/null +++ b/files/fr/web/api/document/elementfrompoint/index.html @@ -0,0 +1,54 @@ +--- +title: document.elementFromPoint +slug: Web/API/Document/elementFromPoint +tags: + - Référence_du_DOM_Gecko +translation_of: Web/API/DocumentOrShadowRoot/elementFromPoint +translation_of_original: Web/API/Document/elementFromPoint +original_slug: Web/API/DocumentOrShadowRoot/elementFromPoint +--- +

{{ ApiRef() }}

+

Résumé

+

Renvoie l'élément visible au point donné, spécifié relativement au point supérieur gauche visible dans le document.

+

Syntaxe

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

where

+ +

Exemple

+
<html>
+<head>
+<title>Exemple d'utilisation d'elementFromPoint</title>
+
+<script type="text/javascript">
+
+function changeColor(newColor)
+{
+ elem = document.elementFromPoint(2, 2);
+ elem.style.color = newColor;
+}
+</script>
+</head>
+
+<body>
+<p id="para1">Un peu de texte ici</p>
+<button onclick="changeColor('blue');">bleu</button>
+<button onclick="changeColor('red');">rouge</button>
+</body>
+</html>
+
+

Notes

+

Si l'élément au point spécifié appartient à un autre document (par exemple, les sous-document d'un iframe), l'élément dans le DOM du document appelant (l'iframe lui-même) est renvoyé. Si l'élément au point donné est anonyme ou du contenu généré par XBL, comme la barre de défilement d'une boîte de texte, le premier élément parent non anonyme (par exemple, la boîte de texte) est renvoyé.

+

Si le point spécifié est en dehors de la portion visible du document ou que l'une ou l'autre des coordonnées est négative, le résultat est NULL.

+

{{ Note("Les appelants qui sont des documents XUL devraient attendre que l\'évènement onload se soit déclenché avant d\'appeler cette méthode.") }}

+

Spécification

+ +

 

+
+  
+

{{ languages( { "en": "en/DOM/document.elementFromPoint", "es": "es/DOM/document.elementFromPoint", "ja": "ja/DOM/document.elementFromPoint" } ) }}

diff --git a/files/fr/web/api/document/elementsfrompoint/index.html b/files/fr/web/api/document/elementsfrompoint/index.html new file mode 100644 index 0000000000..c0fb412fc8 --- /dev/null +++ b/files/fr/web/api/document/elementsfrompoint/index.html @@ -0,0 +1,105 @@ +--- +title: DocumentOrShadowRoot.elementsFromPoint() +slug: Web/API/Document/elementsFromPoint +tags: + - API + - Document + - DocumentOrShadowRoot + - Méthode + - Reference + - ShadowRoot + - elementsFromPoint + - elementsFromPoint() + - shadow dom +translation_of: Web/API/DocumentOrShadowRoot/elementsFromPoint +original_slug: Web/API/DocumentOrShadowRoot/elementsFromPoint +--- +
{{APIRef("DOM")}}{{SeeCompatTable}}
+ +

La propriété elementsFromPoint() de l'interface {{domxref("DocumentOrShadowRoot")}}  renvoie un tableau (array) de tous les éléments présents sous le point fourni en paramètre (relatif au viewport).

+ +

Syntaxe

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

Paramètres

+ +
+
x
+
L'abscisse du point (coordonnée horizontale).
+
y
+
L'ordonnée du point (coordonnée verticale).
+
+ +

Valeur de retour

+ +

Un tableau (array) d'objets {{domxref('element')}} représentants les éléments du DOM concernés.

+ +

Exemples

+ +

HTML

+ +
<div>
+  <p>Du texte</p>
+</div>
+<p>Éléments au point 30, 20:</p>
+<div id="output"></div>
+
+ +

JavaScript

+ +
var output = document.getElementById("output");
+if (document.elementsFromPoint) {
+  var elements = document.elementsFromPoint(30, 20);
+  for(var i = 0; i < elements.length; i++) {
+    output.textContent += elements[i].localName;
+    if (i < elements.length - 1) {
+      output.textContent += " < ";
+    }
+  }
+} else {
+  output.innerHTML = "<span style=\"color: red;\">" +
+     "Votre navigateur ne prend pas en charge <code>document.elementsFromPoint()</code>" +
+     "</span>";
+}
+ +

Résultat

+ +

{{EmbedLiveSample('Example', '420', '120')}}

+ +

Spécifications

+ + + + + + + + + + + + + + + + + + + + + +
SpécificationÉtatCommentaires
{{SpecName('Shadow DOM','#extensions-to-the-documentorshadowroot-mixin','DocumentOrShadowRoot')}}{{Spec2('Shadow DOM')}}Définition initiale
{{SpecName('CSSOM View', '#dom-document-elementsfrompoint', 'Document')}}{{Spec2('CSSOM View')}}Précise l'ordre selon lequel les éléments sont peints.
+ +

Compatibilité des navigateurs

+ + + +

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

+ +

Voir aussi

+ + diff --git a/files/fr/web/api/documentorshadowroot/elementfrompoint/index.html b/files/fr/web/api/documentorshadowroot/elementfrompoint/index.html deleted file mode 100644 index 142ab83b27..0000000000 --- a/files/fr/web/api/documentorshadowroot/elementfrompoint/index.html +++ /dev/null @@ -1,54 +0,0 @@ ---- -title: document.elementFromPoint -slug: Web/API/DocumentOrShadowRoot/elementFromPoint -tags: - - Référence_du_DOM_Gecko -translation_of: Web/API/DocumentOrShadowRoot/elementFromPoint -translation_of_original: Web/API/Document/elementFromPoint -original_slug: Web/API/Document/elementFromPoint ---- -

{{ ApiRef() }}

-

Résumé

-

Renvoie l'élément visible au point donné, spécifié relativement au point supérieur gauche visible dans le document.

-

Syntaxe

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

where

- -

Exemple

-
<html>
-<head>
-<title>Exemple d'utilisation d'elementFromPoint</title>
-
-<script type="text/javascript">
-
-function changeColor(newColor)
-{
- elem = document.elementFromPoint(2, 2);
- elem.style.color = newColor;
-}
-</script>
-</head>
-
-<body>
-<p id="para1">Un peu de texte ici</p>
-<button onclick="changeColor('blue');">bleu</button>
-<button onclick="changeColor('red');">rouge</button>
-</body>
-</html>
-
-

Notes

-

Si l'élément au point spécifié appartient à un autre document (par exemple, les sous-document d'un iframe), l'élément dans le DOM du document appelant (l'iframe lui-même) est renvoyé. Si l'élément au point donné est anonyme ou du contenu généré par XBL, comme la barre de défilement d'une boîte de texte, le premier élément parent non anonyme (par exemple, la boîte de texte) est renvoyé.

-

Si le point spécifié est en dehors de la portion visible du document ou que l'une ou l'autre des coordonnées est négative, le résultat est NULL.

-

{{ Note("Les appelants qui sont des documents XUL devraient attendre que l\'évènement onload se soit déclenché avant d\'appeler cette méthode.") }}

-

Spécification

- -

 

-
-  
-

{{ languages( { "en": "en/DOM/document.elementFromPoint", "es": "es/DOM/document.elementFromPoint", "ja": "ja/DOM/document.elementFromPoint" } ) }}

diff --git a/files/fr/web/api/documentorshadowroot/elementsfrompoint/index.html b/files/fr/web/api/documentorshadowroot/elementsfrompoint/index.html deleted file mode 100644 index c3f8c30d22..0000000000 --- a/files/fr/web/api/documentorshadowroot/elementsfrompoint/index.html +++ /dev/null @@ -1,104 +0,0 @@ ---- -title: DocumentOrShadowRoot.elementsFromPoint() -slug: Web/API/DocumentOrShadowRoot/elementsFromPoint -tags: - - API - - Document - - DocumentOrShadowRoot - - Méthode - - Reference - - ShadowRoot - - elementsFromPoint - - elementsFromPoint() - - shadow dom -translation_of: Web/API/DocumentOrShadowRoot/elementsFromPoint ---- -
{{APIRef("DOM")}}{{SeeCompatTable}}
- -

La propriété elementsFromPoint() de l'interface {{domxref("DocumentOrShadowRoot")}}  renvoie un tableau (array) de tous les éléments présents sous le point fourni en paramètre (relatif au viewport).

- -

Syntaxe

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

Paramètres

- -
-
x
-
L'abscisse du point (coordonnée horizontale).
-
y
-
L'ordonnée du point (coordonnée verticale).
-
- -

Valeur de retour

- -

Un tableau (array) d'objets {{domxref('element')}} représentants les éléments du DOM concernés.

- -

Exemples

- -

HTML

- -
<div>
-  <p>Du texte</p>
-</div>
-<p>Éléments au point 30, 20:</p>
-<div id="output"></div>
-
- -

JavaScript

- -
var output = document.getElementById("output");
-if (document.elementsFromPoint) {
-  var elements = document.elementsFromPoint(30, 20);
-  for(var i = 0; i < elements.length; i++) {
-    output.textContent += elements[i].localName;
-    if (i < elements.length - 1) {
-      output.textContent += " < ";
-    }
-  }
-} else {
-  output.innerHTML = "<span style=\"color: red;\">" +
-     "Votre navigateur ne prend pas en charge <code>document.elementsFromPoint()</code>" +
-     "</span>";
-}
- -

Résultat

- -

{{EmbedLiveSample('Example', '420', '120')}}

- -

Spécifications

- - - - - - - - - - - - - - - - - - - - - -
SpécificationÉtatCommentaires
{{SpecName('Shadow DOM','#extensions-to-the-documentorshadowroot-mixin','DocumentOrShadowRoot')}}{{Spec2('Shadow DOM')}}Définition initiale
{{SpecName('CSSOM View', '#dom-document-elementsfrompoint', 'Document')}}{{Spec2('CSSOM View')}}Précise l'ordre selon lequel les éléments sont peints.
- -

Compatibilité des navigateurs

- - - -

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

- -

Voir aussi

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

Le DocumentOrShadowRoot mélange de l'API Shadow DOM qui fournit des API qui sont partagées entre les documents et les racines fantômes. Les fonctionnalités suivantes sont incluses dans {{DOMxRef("Document")}} et {{DOMxRef("ShadowRoot")}}.

- -

Propriétés

- -
-
{{DOMxRef("DocumentOrShadowRoot.activeElement")}}{{ReadOnlyInline}}
-
Renvoie l'{{DOMxRef('Element')}} dans l'arbre shadow qui a le focus.
-
{{DOMxRef("DocumentOrShadowRoot.fullscreenElement")}}{{ReadOnlyInline}}
-
Renvoie l'{{DOMxRef('Element')}} qui est actuellement en mode plein écran pour ce document.
-
{{DOMxRef("DocumentOrShadowRoot.pointerLockElement")}} {{Experimental_Inline}}{{ReadOnlyInline}}
-
Renvoie l'élément défini comme cible pour les événements de la souris lorsque le pointeur est verrouillé. Il renvoie null si le verrouillage est en cours, si le pointeur est déverrouillé ou si la cible se trouve dans un autre document.
-
{{DOMxRef("DocumentOrShadowRoot.styleSheets")}}{{ReadOnlyInline}}
-
Renvoie une {{DOMxRef('StyleSheetList')}} d'objets {{DOMxRef('CSSStyleSheet')}} pour les feuilles de style explicitement liées ou intégrées dans un document.
-
- -

Méthodes

- -
-
{{DOMxRef("DocumentOrShadowRoot.caretPositionFromPoint()")}}
-
Renvoie un objet {{DOMxRef('CaretPosition')}} contenant le noeud DOM contenant le signe d'insertion, et le décalage du caractère d'insertion dans ce noeud.
-
{{DOMxRef("DocumentOrShadowRoot.elementFromPoint()")}}
-
Renvoie l'élément le plus élevé aux coordonnées spécifiées.
-
{{DOMxRef("DocumentOrShadowRoot.elementsFromPoint()")}}
-
Renvoie un tableau de tous les éléments aux coordonnées spécifiées.
-
{{DOMxRef("DocumentOrShadowRoot.getSelection()")}}
-
Renvoie un objet {{DOMxRef('Selection')}} représentant la plage de texte sélectionnée par l'utilisateur, ou la position actuelle du curseur.
-
{{DOMxRef("DocumentOrShadowRoot.nodeFromPoint()")}} {{non-standard_inline}}
-
Renvoie le nœud supérieur aux coordonnées spécifiées.
-
{{DOMxRef("DocumentOrShadowRoot.nodesFromPoint()")}} {{non-standard_inline}}
-
Renvoie un tableau de tous les nœuds aux coordonnées spécifiées.
-
- -

Spécifications

- - - - - - - - - - - - - - - - - - - - - -
SpécificationStatutCommentaire
{{SpecName('Shadow DOM','#extensions-to-the-documentorshadowroot-mixin','DocumentOrShadowRoot')}}{{Spec2('Shadow DOM')}}Implémentation de Shadow DOM.
{{SpecName('DOM WHATWG','#mixin-documentorshadowroot','DocumentOrShadowRoot')}}{{Spec2('DOM WHATWG')}}Définition initiale.
- -

Compatibilité des navigateurs

- - - -

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

- -

[1] Les fonctionnalités de cette interface sont toujours implémentées sur l'objet {{DOMxRef("Document")}}.

diff --git a/files/ja/_redirects.txt b/files/ja/_redirects.txt index 9a1cd3bdfd..9eace6107e 100644 --- a/files/ja/_redirects.txt +++ b/files/ja/_redirects.txt @@ -46,7 +46,7 @@ /ja/docs/API/Document/documentURI /ja/docs/Web/API/Document/documentURI /ja/docs/API/Document/documentURIObject /ja/docs/Web/API/Document/documentURIObject /ja/docs/API/Document/domConfig /ja/docs/Web/API/Document -/ja/docs/API/Document/elementFromPoint /ja/docs/Web/API/DocumentOrShadowRoot/elementFromPoint +/ja/docs/API/Document/elementFromPoint /ja/docs/Web/API/Document/elementFromPoint /ja/docs/API/Document/embeds /ja/docs/Web/API/Document/embeds /ja/docs/API/Document/enableStyleSheetsForSet /ja/docs/Web/API/Document/enableStyleSheetsForSet /ja/docs/API/Document/evaluate /ja/docs/Web/API/Document/evaluate @@ -1435,7 +1435,7 @@ /ja/docs/DOM/document.documentURI /ja/docs/Web/API/Document/documentURI /ja/docs/DOM/document.documentURIObject /ja/docs/Web/API/Document/documentURIObject /ja/docs/DOM/document.domConfig /ja/docs/Web/API/Document -/ja/docs/DOM/document.elementFromPoint /ja/docs/Web/API/DocumentOrShadowRoot/elementFromPoint +/ja/docs/DOM/document.elementFromPoint /ja/docs/Web/API/Document/elementFromPoint /ja/docs/DOM/document.embeds /ja/docs/Web/API/Document/embeds /ja/docs/DOM/document.fgColor /ja/docs/Web/API/Document/fgColor /ja/docs/DOM/document.firstChild /ja/docs/Web/API/Node/firstChild @@ -1770,7 +1770,7 @@ /ja/docs/DOM:document.createEvent /ja/docs/Web/API/Document/createEvent /ja/docs/DOM:document.documentElement /ja/docs/Web/API/Document/documentElement /ja/docs/DOM:document.documentURIObject /ja/docs/Web/API/Document/documentURIObject -/ja/docs/DOM:document.elementFromPoint /ja/docs/Web/API/DocumentOrShadowRoot/elementFromPoint +/ja/docs/DOM:document.elementFromPoint /ja/docs/Web/API/Document/elementFromPoint /ja/docs/DOM:document.firstChild /ja/docs/Web/API/Node/firstChild /ja/docs/DOM:document.forms /ja/docs/Web/API/Document/forms /ja/docs/DOM:document.getElementById /ja/docs/Web/API/Document/getElementById @@ -3746,11 +3746,13 @@ /ja/docs/Web/API/Document/async /ja/docs/Web/API/XMLDocument/async /ja/docs/Web/API/Document/defaultView/storage_event /ja/docs/Web/API/Window/storage_event /ja/docs/Web/API/Document/domConfig /ja/docs/Web/API/Document -/ja/docs/Web/API/Document/elementFromPoint /ja/docs/Web/API/DocumentOrShadowRoot/elementFromPoint /ja/docs/Web/API/Document/inputEncoding /ja/docs/conflicting/Web/API/Document/characterSet /ja/docs/Web/API/Document/onselectionchange /ja/docs/Web/API/GlobalEventHandlers/onselectionchange +/ja/docs/Web/API/DocumentOrShadowRoot /ja/docs/orphaned/Web/API/DocumentOrShadowRoot /ja/docs/Web/API/DocumentOrShadowRoot/activeElement /ja/docs/Web/API/Document/activeElement /ja/docs/Web/API/DocumentOrShadowRoot/caretPositionFromPoint /ja/docs/Web/API/Document/caretPositionFromPoint +/ja/docs/Web/API/DocumentOrShadowRoot/elementFromPoint /ja/docs/Web/API/Document/elementFromPoint +/ja/docs/Web/API/DocumentOrShadowRoot/elementsFromPoint /ja/docs/Web/API/Document/elementsFromPoint /ja/docs/Web/API/DocumentOrShadowRoot/fullscreenElement /ja/docs/Web/API/Document/fullscreenElement /ja/docs/Web/API/DocumentOrShadowRoot/getAnimations /ja/docs/Web/API/Document/getAnimations /ja/docs/Web/API/DocumentOrShadowRoot/getSelection /ja/docs/Web/API/Document/getSelection diff --git a/files/ja/_wikihistory.json b/files/ja/_wikihistory.json index 6a622d201e..0cff7990b3 100644 --- a/files/ja/_wikihistory.json +++ b/files/ja/_wikihistory.json @@ -12725,18 +12725,6 @@ "AshfaqHossain" ] }, - "Web/API/DocumentOrShadowRoot": { - "modified": "2020-10-15T22:12:34.663Z", - "contributors": [ - "mfuji09" - ] - }, - "Web/API/DocumentOrShadowRoot/elementsFromPoint": { - "modified": "2020-10-15T22:29:40.404Z", - "contributors": [ - "mfuji09" - ] - }, "Web/API/DocumentType": { "modified": "2020-10-15T22:09:56.256Z", "contributors": [ @@ -52764,19 +52752,6 @@ "Okome" ] }, - "Web/API/DocumentOrShadowRoot/elementFromPoint": { - "modified": "2019-03-23T23:50:29.105Z", - "contributors": [ - "mfuji09", - "fscholz", - "khalid32", - "ethertank", - "Mgjbot", - "Shoot", - "Potappo", - "Norah" - ] - }, "conflicting/Web/API/DocumentOrShadowRoot/getSelection": { "modified": "2019-03-23T23:38:33.748Z", "contributors": [ @@ -53496,5 +53471,30 @@ "contributors": [ "eltociear" ] + }, + "Web/API/Document/elementFromPoint": { + "modified": "2019-03-23T23:50:29.105Z", + "contributors": [ + "mfuji09", + "fscholz", + "khalid32", + "ethertank", + "Mgjbot", + "Shoot", + "Potappo", + "Norah" + ] + }, + "Web/API/Document/elementsFromPoint": { + "modified": "2020-10-15T22:29:40.404Z", + "contributors": [ + "mfuji09" + ] + }, + "orphaned/Web/API/DocumentOrShadowRoot": { + "modified": "2020-10-15T22:12:34.663Z", + "contributors": [ + "mfuji09" + ] } } \ No newline at end of file diff --git a/files/ja/orphaned/web/api/documentorshadowroot/index.html b/files/ja/orphaned/web/api/documentorshadowroot/index.html new file mode 100644 index 0000000000..6f4eceb73f --- /dev/null +++ b/files/ja/orphaned/web/api/documentorshadowroot/index.html @@ -0,0 +1,79 @@ +--- +title: DocumentOrShadowRoot +slug: orphaned/Web/API/DocumentOrShadowRoot +tags: + - API + - Document + - DocumentOrShadowRoot + - Reference + - ShadowRoot + - インターフェイス + - シャドウ DOM +translation_of: Web/API/DocumentOrShadowRoot +original_slug: Web/API/DocumentOrShadowRoot +--- +
{{APIRef("Web Components")}}
+ +

DocumentOrShadowRootShadow DOM API のミックスインで、文書とシャドウルートで共有される API を提供します。以下の機能は {{DOMxRef("Document")}} と {{DOMxRef("ShadowRoot")}} の両方に含まれています。

+ +

プロパティ

+ +
+
{{DOMxRef("DocumentOrShadowRoot.activeElement")}}{{ReadOnlyInline}}
+
シャドウツリー内でフォーカスを持っている {{DOMxRef('Element')}} を返します。
+
{{DOMxRef("DocumentOrShadowRoot.fullscreenElement")}}{{ReadOnlyInline}}
+
この文書で現在全画面モードになっている {{DOMxRef('Element')}} を返します。
+
{{DOMxRef("DocumentOrShadowRoot.pointerLockElement")}} {{Experimental_Inline}}{{ReadOnlyInline}}
+
ポインターがロックされている間、マウスイベントのターゲットとして設定された要素を返します。ロック待ちの場合、ポインターがロックされていない場合、ターゲットが別な文書である場合は null を返します。
+
{{DOMxRef("DocumentOrShadowRoot.styleSheets")}}{{ReadOnlyInline}}
+
文書に明示的にリンクされているか、埋め込まれているスタイルシートの {{DOMxRef('CSSStyleSheet')}} オブジェクトの {{DOMxRef('StyleSheetList')}} を返します。
+
+ +

メソッド

+ +
+
{{DOMxRef("DocumentOrShadowRoot.caretPositionFromPoint()")}}
+
キャレットを含んでいる DOM ノードと、そのノード内におけるキャレットの文字のオフセットを含む {{DOMxRef('CaretPosition')}} オブジェクトを返します。
+
{{DOMxRef("DocumentOrShadowRoot.elementFromPoint()")}}
+
指定された座標にある最上位の要素を返します。
+
{{DOMxRef("DocumentOrShadowRoot.elementsFromPoint()")}}
+
指定された座標にあるすべての要素の配列を返します。
+
{{DOMxRef("DocumentOrShadowRoot.getSelection()")}}
+
ユーザーによって選択されているテキストの範囲、またはキャレットの現在の位置を表す {{DOMxRef('Selection')}} オブジェクトを返します。
+
{{DOMxRef("DocumentOrShadowRoot.nodeFromPoint()")}} {{non-standard_inline}}
+
指定された座標にある最上位のノードを返します。
+
{{DOMxRef("DocumentOrShadowRoot.nodesFromPoint()")}} {{non-standard_inline}}
+
指定された座標にあるすべてのノードの配列を返します。
+
+ +

仕様書

+ + + + + + + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('Shadow DOM','#extensions-to-the-documentorshadowroot-mixin','DocumentOrShadowRoot')}}{{Spec2('Shadow DOM')}}Shadow DOM で実装。
{{SpecName('DOM WHATWG','#mixin-documentorshadowroot','DocumentOrShadowRoot')}}{{Spec2('DOM WHATWG')}}初回定義
+ +

ブラウザーの対応

+ + + +

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

+ +

[1] このインターフェイスの機能は {{DOMxRef("Document")}} オブジェクトにも実装されています。

diff --git a/files/ja/web/api/document/elementfrompoint/index.html b/files/ja/web/api/document/elementfrompoint/index.html new file mode 100644 index 0000000000..662260e4ae --- /dev/null +++ b/files/ja/web/api/document/elementfrompoint/index.html @@ -0,0 +1,51 @@ +--- +title: document.elementFromPoint +slug: Web/API/Document/elementFromPoint +tags: + - DOM + - Gecko + - Gecko DOM Reference +translation_of: Web/API/DocumentOrShadowRoot/elementFromPoint +translation_of_original: Web/API/Document/elementFromPoint +original_slug: Web/API/DocumentOrShadowRoot/elementFromPoint +--- +
+ {{ApiRef()}} {{Fx_minversion_header(3)}}
+

概要

+

文書の左上を基点として指定された座標上にある要素を返します。

+

構文

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

+
<!DOCTYPE html>
+<html lang="ja">
+<head>
+<title>elementFromPoint の使用例</title>
+
+<script>
+function changeColor(newColor) {
+  elem = document.elementFromPoint(2, 2);
+  elem.style.color = newColor;
+}
+</script>
+</head>
+
+
+<body>
+<p id="para1">色は匂へど 散りぬるを……</p>
+<button onclick="changeColor('blue');">blue</button>
+<button onclick="changeColor('red');">red</button>
+</body>
+</html>
+
+

注記

+

指定された座標にある要素が別のドキュメント(例えば iframe 内にあるサブドキュメント) に属する場合、指定された座標にあるドキュメントの DOM 要素 (iframe) を返します。もし指定された座標にある要素が匿名あるいは textbox のスクロールバーのように XBL によって生成された内容の場合、指定された座標にある要素を基点として、匿名ではない最初の親要素(例えば textbox)が返されます。

+

指定された座標がドキュメントの表示外にあるか、座標のどちらかに負の値が設定されている場合は NULL を返します。

+

{{Note("XUL ドキュメントからは onload イベントが発生するまでは、このメソッドを使用してはいけません。")}}

+

仕様

+ diff --git a/files/ja/web/api/document/elementsfrompoint/index.html b/files/ja/web/api/document/elementsfrompoint/index.html new file mode 100644 index 0000000000..a885ce197f --- /dev/null +++ b/files/ja/web/api/document/elementsfrompoint/index.html @@ -0,0 +1,103 @@ +--- +title: DocumentOrShadowRoot.elementsFromPoint() +slug: Web/API/Document/elementsFromPoint +tags: + - API + - Document + - DocumentOrShadowRoot + - Method + - Reference + - ShadowRoot + - elementsFromPoint + - elementsFromPoint() + - shadow dom + - メソッド +translation_of: Web/API/DocumentOrShadowRoot/elementsFromPoint +original_slug: Web/API/DocumentOrShadowRoot/elementsFromPoint +--- +
{{APIRef("DOM")}}{{SeeCompatTable}}
+ +

elementsFromPoint() は {{domxref("DocumentOrShadowRoot")}} インターフェイスのメソッドで、指定された座標 (ビューポートからの相対) にあるすべての要素の配列を返します。

+ +

これは {{domxref("DocumentOrShadowRoot.elementFromPoint", "elementFromPoint()")}} メソッドと同じような方法で動作します。

+ +

構文

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

引数

+ +
+
x
+
点の水平座標です。
+
y
+
点の垂直座標です。
+
+ +

返値

+ +

{{domxref("Element")}} オブジェクトの配列です。

+ +

+ +

HTML

+ +
<div>
+  <p>Some text</p>
+</div>
+<p>Elements at point 30, 20:</p>
+<div id="output"></div>
+
+ +

JavaScript

+ +
let output = document.getElementById("output");
+if (document.elementsFromPoint) {
+  let elements = document.elementsFromPoint(30, 20);
+  for (var i = 0; i < elements.length; i++) {
+    output.textContent += elements[i].localName;
+    if (i < elements.length - 1) {
+      output.textContent += " < ";
+    }
+  }
+} else {
+  output.innerHTML = "<span style=\"color: red;\">" +
+     "Browser does not support <code>document.elementsFromPoint()</code>" +
+     "</span>";
+}
+ +

{{EmbedLiveSample('Example', '420', '120')}}

+ +

仕様書

+ + + + + + + + + + + + + + + + + + +
仕様書状態
{{SpecName('Shadow DOM','#dom-documentorshadowroot-elementsfrompoint','elementsFromPoint()')}}{{Spec2('Shadow DOM')}}
{{SpecName('CSSOM View', '#dom-document-elementsfrompoint', 'elementsFromPoint()')}}{{Spec2('CSSOM View')}}
+ +

ブラウザーの互換性

+ + + +

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

+ +

関連情報

+ + diff --git a/files/ja/web/api/documentorshadowroot/elementfrompoint/index.html b/files/ja/web/api/documentorshadowroot/elementfrompoint/index.html deleted file mode 100644 index e041d4592d..0000000000 --- a/files/ja/web/api/documentorshadowroot/elementfrompoint/index.html +++ /dev/null @@ -1,51 +0,0 @@ ---- -title: document.elementFromPoint -slug: Web/API/DocumentOrShadowRoot/elementFromPoint -tags: - - DOM - - Gecko - - Gecko DOM Reference -translation_of: Web/API/DocumentOrShadowRoot/elementFromPoint -translation_of_original: Web/API/Document/elementFromPoint -original_slug: Web/API/Document/elementFromPoint ---- -
- {{ApiRef()}} {{Fx_minversion_header(3)}}
-

概要

-

文書の左上を基点として指定された座標上にある要素を返します。

-

構文

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

-
<!DOCTYPE html>
-<html lang="ja">
-<head>
-<title>elementFromPoint の使用例</title>
-
-<script>
-function changeColor(newColor) {
-  elem = document.elementFromPoint(2, 2);
-  elem.style.color = newColor;
-}
-</script>
-</head>
-
-
-<body>
-<p id="para1">色は匂へど 散りぬるを……</p>
-<button onclick="changeColor('blue');">blue</button>
-<button onclick="changeColor('red');">red</button>
-</body>
-</html>
-
-

注記

-

指定された座標にある要素が別のドキュメント(例えば iframe 内にあるサブドキュメント) に属する場合、指定された座標にあるドキュメントの DOM 要素 (iframe) を返します。もし指定された座標にある要素が匿名あるいは textbox のスクロールバーのように XBL によって生成された内容の場合、指定された座標にある要素を基点として、匿名ではない最初の親要素(例えば textbox)が返されます。

-

指定された座標がドキュメントの表示外にあるか、座標のどちらかに負の値が設定されている場合は NULL を返します。

-

{{Note("XUL ドキュメントからは onload イベントが発生するまでは、このメソッドを使用してはいけません。")}}

-

仕様

- diff --git a/files/ja/web/api/documentorshadowroot/elementsfrompoint/index.html b/files/ja/web/api/documentorshadowroot/elementsfrompoint/index.html deleted file mode 100644 index a5337f576f..0000000000 --- a/files/ja/web/api/documentorshadowroot/elementsfrompoint/index.html +++ /dev/null @@ -1,102 +0,0 @@ ---- -title: DocumentOrShadowRoot.elementsFromPoint() -slug: Web/API/DocumentOrShadowRoot/elementsFromPoint -tags: - - API - - Document - - DocumentOrShadowRoot - - Method - - Reference - - ShadowRoot - - elementsFromPoint - - elementsFromPoint() - - shadow dom - - メソッド -translation_of: Web/API/DocumentOrShadowRoot/elementsFromPoint ---- -
{{APIRef("DOM")}}{{SeeCompatTable}}
- -

elementsFromPoint() は {{domxref("DocumentOrShadowRoot")}} インターフェイスのメソッドで、指定された座標 (ビューポートからの相対) にあるすべての要素の配列を返します。

- -

これは {{domxref("DocumentOrShadowRoot.elementFromPoint", "elementFromPoint()")}} メソッドと同じような方法で動作します。

- -

構文

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

引数

- -
-
x
-
点の水平座標です。
-
y
-
点の垂直座標です。
-
- -

返値

- -

{{domxref("Element")}} オブジェクトの配列です。

- -

- -

HTML

- -
<div>
-  <p>Some text</p>
-</div>
-<p>Elements at point 30, 20:</p>
-<div id="output"></div>
-
- -

JavaScript

- -
let output = document.getElementById("output");
-if (document.elementsFromPoint) {
-  let elements = document.elementsFromPoint(30, 20);
-  for (var i = 0; i < elements.length; i++) {
-    output.textContent += elements[i].localName;
-    if (i < elements.length - 1) {
-      output.textContent += " < ";
-    }
-  }
-} else {
-  output.innerHTML = "<span style=\"color: red;\">" +
-     "Browser does not support <code>document.elementsFromPoint()</code>" +
-     "</span>";
-}
- -

{{EmbedLiveSample('Example', '420', '120')}}

- -

仕様書

- - - - - - - - - - - - - - - - - - -
仕様書状態
{{SpecName('Shadow DOM','#dom-documentorshadowroot-elementsfrompoint','elementsFromPoint()')}}{{Spec2('Shadow DOM')}}
{{SpecName('CSSOM View', '#dom-document-elementsfrompoint', 'elementsFromPoint()')}}{{Spec2('CSSOM View')}}
- -

ブラウザーの互換性

- - - -

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

- -

関連情報

- - diff --git a/files/ja/web/api/documentorshadowroot/index.html b/files/ja/web/api/documentorshadowroot/index.html deleted file mode 100644 index 41a6afbfa8..0000000000 --- a/files/ja/web/api/documentorshadowroot/index.html +++ /dev/null @@ -1,78 +0,0 @@ ---- -title: DocumentOrShadowRoot -slug: Web/API/DocumentOrShadowRoot -tags: - - API - - Document - - DocumentOrShadowRoot - - Reference - - ShadowRoot - - インターフェイス - - シャドウ DOM -translation_of: Web/API/DocumentOrShadowRoot ---- -
{{APIRef("Web Components")}}
- -

DocumentOrShadowRootShadow DOM API のミックスインで、文書とシャドウルートで共有される API を提供します。以下の機能は {{DOMxRef("Document")}} と {{DOMxRef("ShadowRoot")}} の両方に含まれています。

- -

プロパティ

- -
-
{{DOMxRef("DocumentOrShadowRoot.activeElement")}}{{ReadOnlyInline}}
-
シャドウツリー内でフォーカスを持っている {{DOMxRef('Element')}} を返します。
-
{{DOMxRef("DocumentOrShadowRoot.fullscreenElement")}}{{ReadOnlyInline}}
-
この文書で現在全画面モードになっている {{DOMxRef('Element')}} を返します。
-
{{DOMxRef("DocumentOrShadowRoot.pointerLockElement")}} {{Experimental_Inline}}{{ReadOnlyInline}}
-
ポインターがロックされている間、マウスイベントのターゲットとして設定された要素を返します。ロック待ちの場合、ポインターがロックされていない場合、ターゲットが別な文書である場合は null を返します。
-
{{DOMxRef("DocumentOrShadowRoot.styleSheets")}}{{ReadOnlyInline}}
-
文書に明示的にリンクされているか、埋め込まれているスタイルシートの {{DOMxRef('CSSStyleSheet')}} オブジェクトの {{DOMxRef('StyleSheetList')}} を返します。
-
- -

メソッド

- -
-
{{DOMxRef("DocumentOrShadowRoot.caretPositionFromPoint()")}}
-
キャレットを含んでいる DOM ノードと、そのノード内におけるキャレットの文字のオフセットを含む {{DOMxRef('CaretPosition')}} オブジェクトを返します。
-
{{DOMxRef("DocumentOrShadowRoot.elementFromPoint()")}}
-
指定された座標にある最上位の要素を返します。
-
{{DOMxRef("DocumentOrShadowRoot.elementsFromPoint()")}}
-
指定された座標にあるすべての要素の配列を返します。
-
{{DOMxRef("DocumentOrShadowRoot.getSelection()")}}
-
ユーザーによって選択されているテキストの範囲、またはキャレットの現在の位置を表す {{DOMxRef('Selection')}} オブジェクトを返します。
-
{{DOMxRef("DocumentOrShadowRoot.nodeFromPoint()")}} {{non-standard_inline}}
-
指定された座標にある最上位のノードを返します。
-
{{DOMxRef("DocumentOrShadowRoot.nodesFromPoint()")}} {{non-standard_inline}}
-
指定された座標にあるすべてのノードの配列を返します。
-
- -

仕様書

- - - - - - - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('Shadow DOM','#extensions-to-the-documentorshadowroot-mixin','DocumentOrShadowRoot')}}{{Spec2('Shadow DOM')}}Shadow DOM で実装。
{{SpecName('DOM WHATWG','#mixin-documentorshadowroot','DocumentOrShadowRoot')}}{{Spec2('DOM WHATWG')}}初回定義
- -

ブラウザーの対応

- - - -

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

- -

[1] このインターフェイスの機能は {{DOMxRef("Document")}} オブジェクトにも実装されています。

diff --git a/files/ko/_redirects.txt b/files/ko/_redirects.txt index 8d61ce0196..1f8d05cf00 100644 --- a/files/ko/_redirects.txt +++ b/files/ko/_redirects.txt @@ -626,6 +626,7 @@ /ko/docs/Web/API/Document/defaultView/popstate_event /ko/docs/Web/API/Window/popstate_event /ko/docs/Web/API/Document/defaultView/resize_event /ko/docs/Web/API/Window/resize_event /ko/docs/Web/API/Document/drag_이벤트 /ko/docs/Web/API/Document/drag_event +/ko/docs/Web/API/DocumentOrShadowRoot /ko/docs/orphaned/Web/API/DocumentOrShadowRoot /ko/docs/Web/API/DocumentOrShadowRoot/activeElement /ko/docs/Web/API/Document/activeElement /ko/docs/Web/API/DocumentOrShadowRoot/getSelection /ko/docs/Web/API/Document/getSelection /ko/docs/Web/API/DocumentOrShadowRoot/styleSheets /ko/docs/Web/API/Document/styleSheets diff --git a/files/ko/_wikihistory.json b/files/ko/_wikihistory.json index c7cbc472de..cb68777e6f 100644 --- a/files/ko/_wikihistory.json +++ b/files/ko/_wikihistory.json @@ -3613,13 +3613,6 @@ "zzoPark" ] }, - "Web/API/DocumentOrShadowRoot": { - "modified": "2020-10-15T22:11:35.284Z", - "contributors": [ - "DeadIntegral", - "Sheppy" - ] - }, "Web/API/DocumentType": { "modified": "2020-10-15T22:10:02.690Z", "contributors": [ @@ -18704,5 +18697,12 @@ "contributors": [ "x86kernel" ] + }, + "orphaned/Web/API/DocumentOrShadowRoot": { + "modified": "2020-10-15T22:11:35.284Z", + "contributors": [ + "DeadIntegral", + "Sheppy" + ] } } \ No newline at end of file diff --git a/files/ko/orphaned/web/api/documentorshadowroot/index.html b/files/ko/orphaned/web/api/documentorshadowroot/index.html new file mode 100644 index 0000000000..526f6687ad --- /dev/null +++ b/files/ko/orphaned/web/api/documentorshadowroot/index.html @@ -0,0 +1,75 @@ +--- +title: DocumentOrShadowRoot +slug: orphaned/Web/API/DocumentOrShadowRoot +tags: + - API + - Document + - DocumentOrShadowRoot + - Interface + - NeedsTranslation + - Reference + - ShadowRoot + - TopicStub + - shadow dom +translation_of: Web/API/DocumentOrShadowRoot +original_slug: Web/API/DocumentOrShadowRoot +--- +
{{APIRef("Web Components")}}
+ +

Shadow DOM API 의 DocumentOrShadowRoot 믹스인(mixin)은 문서와 섀도우 루트간에 공유되는 API를 제공합니다. 다음 기능은 문서{{DOMxRef("Document")}}와 {{DOMxRef("ShadowRoot")}}에 모두 포함되어 있습니다.

+ +

Properties

+ +
+
{{DOMxRef("DocumentOrShadowRoot.activeElement")}}{{ReadOnlyInline}}
+
포커스를 가지는 섀도우 루트 내의 요소{{DOMxRef('Element')}}를 반환합니다.
+
{{DOMxRef("DocumentOrShadowRoot.fullscreenElement")}}{{ReadOnlyInline}}
+
현재 이 문서에서 full screen mode인 요소{{DOMxRef('Element')}}를 반환합니다.
+
{{DOMxRef("DocumentOrShadowRoot.pointerLockElement")}} {{Experimental_Inline}}{{ReadOnlyInline}}
+
포인터가 잠겨있는 동안 마우스 이벤트의 대상으로 설정된 요소를 반환합니다. 잠금이 보류중이거나 포인터가 잠금 해제되어 있거나, 대상이 다른 문서(document)에 있으면 null을 반환합니다.
+
{{DOMxRef("DocumentOrShadowRoot.styleSheets")}}{{ReadOnlyInline}}
+
문서에 명시적으로 링크되었거나 포함하고 있는 스타일 시트의 {{DOMxRef('CSSStyleSheet')}} 객체의 {{DOMxRef('StyleSheetList')}}를 반환합니다.
+
+ +

Methods

+ +
+
{{DOMxRef("DocumentOrShadowRoot.getSelection()")}}
+
유저가 선택한 텍스트의 범위, 또는 캐럿(caret - 텍스트 커서)의 현재 위치를 나타내는 {{DOMxRef('Selection')}}객체를 반환합니다.
+
{{DOMxRef("DocumentOrShadowRoot.elementFromPoint()")}}
+
지정된 좌표의 최상위 요소를 반환합니다.
+
{{DOMxRef("DocumentOrShadowRoot.elementsFromPoint()")}}
+
지정된 자표에 있는 모든 요소의 배열을 반환합니다.
+
{{DOMxRef("DocumentOrShadowRoot.caretPositionFromPoint()")}}
+
캐럿을 포함한 DOM 노드와 그 노드 내에서 캐럿의 문자 오프셋을 포함한 {{DOMxRef('CaretPosition')}}를 반환합니다.
+
+ +

Specifications

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

Browser Compatibility

+ + + +

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

+ +

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

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

Shadow DOM API 의 DocumentOrShadowRoot 믹스인(mixin)은 문서와 섀도우 루트간에 공유되는 API를 제공합니다. 다음 기능은 문서{{DOMxRef("Document")}}와 {{DOMxRef("ShadowRoot")}}에 모두 포함되어 있습니다.

- -

Properties

- -
-
{{DOMxRef("DocumentOrShadowRoot.activeElement")}}{{ReadOnlyInline}}
-
포커스를 가지는 섀도우 루트 내의 요소{{DOMxRef('Element')}}를 반환합니다.
-
{{DOMxRef("DocumentOrShadowRoot.fullscreenElement")}}{{ReadOnlyInline}}
-
현재 이 문서에서 full screen mode인 요소{{DOMxRef('Element')}}를 반환합니다.
-
{{DOMxRef("DocumentOrShadowRoot.pointerLockElement")}} {{Experimental_Inline}}{{ReadOnlyInline}}
-
포인터가 잠겨있는 동안 마우스 이벤트의 대상으로 설정된 요소를 반환합니다. 잠금이 보류중이거나 포인터가 잠금 해제되어 있거나, 대상이 다른 문서(document)에 있으면 null을 반환합니다.
-
{{DOMxRef("DocumentOrShadowRoot.styleSheets")}}{{ReadOnlyInline}}
-
문서에 명시적으로 링크되었거나 포함하고 있는 스타일 시트의 {{DOMxRef('CSSStyleSheet')}} 객체의 {{DOMxRef('StyleSheetList')}}를 반환합니다.
-
- -

Methods

- -
-
{{DOMxRef("DocumentOrShadowRoot.getSelection()")}}
-
유저가 선택한 텍스트의 범위, 또는 캐럿(caret - 텍스트 커서)의 현재 위치를 나타내는 {{DOMxRef('Selection')}}객체를 반환합니다.
-
{{DOMxRef("DocumentOrShadowRoot.elementFromPoint()")}}
-
지정된 좌표의 최상위 요소를 반환합니다.
-
{{DOMxRef("DocumentOrShadowRoot.elementsFromPoint()")}}
-
지정된 자표에 있는 모든 요소의 배열을 반환합니다.
-
{{DOMxRef("DocumentOrShadowRoot.caretPositionFromPoint()")}}
-
캐럿을 포함한 DOM 노드와 그 노드 내에서 캐럿의 문자 오프셋을 포함한 {{DOMxRef('CaretPosition')}}를 반환합니다.
-
- -

Specifications

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

Browser Compatibility

- - - -

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

- -

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

diff --git a/files/pt-br/_redirects.txt b/files/pt-br/_redirects.txt index 85c7b192d6..dc89b12bc6 100644 --- a/files/pt-br/_redirects.txt +++ b/files/pt-br/_redirects.txt @@ -554,8 +554,8 @@ /pt-BR/docs/Web/API/Document/async /pt-BR/docs/Web/API/XMLDocument/async /pt-BR/docs/Web/API/Document/defaultView/popstate_event /pt-BR/docs/Web/API/Window/popstate_event /pt-BR/docs/Web/API/Document/defaultView/resize_event /pt-BR/docs/Web/API/Window/resize_event -/pt-BR/docs/Web/API/Document/elementFromPoint /pt-BR/docs/Web/API/DocumentOrShadowRoot/elementFromPoint /pt-BR/docs/Web/API/DocumentOrShadowRoot/activeElement /pt-BR/docs/Web/API/Document/activeElement +/pt-BR/docs/Web/API/DocumentOrShadowRoot/elementFromPoint /pt-BR/docs/Web/API/Document/elementFromPoint /pt-BR/docs/Web/API/DocumentOrShadowRoot/getSelection /pt-BR/docs/Web/API/Document/getSelection /pt-BR/docs/Web/API/DocumentoXML /pt-BR/docs/Web/API/XMLDocument /pt-BR/docs/Web/API/Element.addEventListener /pt-BR/docs/Web/API/EventTarget/addEventListener diff --git a/files/pt-br/_wikihistory.json b/files/pt-br/_wikihistory.json index fc9965ff16..75facc48d9 100644 --- a/files/pt-br/_wikihistory.json +++ b/files/pt-br/_wikihistory.json @@ -16958,12 +16958,6 @@ "Fernandolrs" ] }, - "Web/API/DocumentOrShadowRoot/elementFromPoint": { - "modified": "2019-03-23T22:29:17.399Z", - "contributors": [ - "cezaraugusto" - ] - }, "Web/API/HTMLElement/accessKey": { "modified": "2019-03-23T22:27:15.059Z", "contributors": [ @@ -17367,5 +17361,11 @@ "contributors": [ "expalmer" ] + }, + "Web/API/Document/elementFromPoint": { + "modified": "2019-03-23T22:29:17.399Z", + "contributors": [ + "cezaraugusto" + ] } } \ No newline at end of file diff --git a/files/pt-br/web/api/document/elementfrompoint/index.html b/files/pt-br/web/api/document/elementfrompoint/index.html new file mode 100644 index 0000000000..2b97e74bea --- /dev/null +++ b/files/pt-br/web/api/document/elementfrompoint/index.html @@ -0,0 +1,134 @@ +--- +title: Document.elementFromPoint() +slug: Web/API/Document/elementFromPoint +tags: + - API + - CSSOM View + - Method + - NeedsMarkupWork + - NeedsMobileBrowserCompatibility + - Reference +translation_of: Web/API/DocumentOrShadowRoot/elementFromPoint +translation_of_original: Web/API/Document/elementFromPoint +original_slug: Web/API/DocumentOrShadowRoot/elementFromPoint +--- +
{{APIRef("DOM")}}
+ +

O método elementFromPoint() da interface {{domxref("Document")}} retorna o elemento de maior nível nas coordenadas especificadas.

+ +

Se o elemento no ponto especificado pertencer à outro documento (por exemplo, um subdocumento em um iframe), será retornado o pai do subdocumento (o próprio iframe). Se o elemento em determinado ponto for anônimo ou for um conteudo gerado por XBL, como por exemplo barras de scroll de caixas de texto, então será retornado o primeiro elemento pai, não-anônimo (por exemplo, a própria caixa de texto).

+ +

Se o ponto especificado estiver fora dos limites visíveis do documento ou tiver uma coordenada negativa, o resultado é null.

+ +

Se você precisa encontrar uma posição específica dentro do elemento, use {{domxref("Document.caretPositionFromPoint()")}}.

+ +

{{Note("Chamados por documentos XUL devem esperar até o evento onload ser acionado antes de chamar este método.")}}

+ +

Sintaxe

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

Parâmetros

+ +
+
x
+
Uma posição horizontal dentro do viewport atual.
+
y
+
Uma position vertical dentro do viewport atual.
+
+ +

Valor retornado

+ +

O objeto de nível mais alto {{domxref("Element")}} dentro das coordenadas declaradas.

+ +

Exemplo

+ +
<!DOCTYPE html>
+<html lang="en">
+<head>
+<title>exemplo de elementFromPoint</title>
+
+<script>
+function changeColor(newColor) {
+  elem = document.elementFromPoint(2, 2);
+  elem.style.color = newColor;
+}
+</script>
+</head>
+
+<body>
+<p id="para1">Algum texto aqui</p>
+<button onclick="changeColor('blue');">azul</button>
+<button onclick="changeColor('red');">vermelho</button>
+</body>
+</html>
+
+ +

Especificações

+ + + + + + + + + + + + + + +
EspecificaçãoStatusComment
{{SpecName('CSSOM View', '#dom-document-elementfrompoint', 'elementFromPoint')}}{{Spec2('CSSOM View')}}Definição Inicial.
+ +

Compatibilidade entre navegadores

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + +
FuncionalidadeChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support {{CompatChrome(4.0)}}35.510.50{{CompatVersionUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FuncionalidadeAndroidChrome para AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatUnknown}}{{CompatVersionUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
diff --git a/files/pt-br/web/api/documentorshadowroot/elementfrompoint/index.html b/files/pt-br/web/api/documentorshadowroot/elementfrompoint/index.html deleted file mode 100644 index 912dd85e80..0000000000 --- a/files/pt-br/web/api/documentorshadowroot/elementfrompoint/index.html +++ /dev/null @@ -1,134 +0,0 @@ ---- -title: Document.elementFromPoint() -slug: Web/API/DocumentOrShadowRoot/elementFromPoint -tags: - - API - - CSSOM View - - Method - - NeedsMarkupWork - - NeedsMobileBrowserCompatibility - - Reference -translation_of: Web/API/DocumentOrShadowRoot/elementFromPoint -translation_of_original: Web/API/Document/elementFromPoint -original_slug: Web/API/Document/elementFromPoint ---- -
{{APIRef("DOM")}}
- -

O método elementFromPoint() da interface {{domxref("Document")}} retorna o elemento de maior nível nas coordenadas especificadas.

- -

Se o elemento no ponto especificado pertencer à outro documento (por exemplo, um subdocumento em um iframe), será retornado o pai do subdocumento (o próprio iframe). Se o elemento em determinado ponto for anônimo ou for um conteudo gerado por XBL, como por exemplo barras de scroll de caixas de texto, então será retornado o primeiro elemento pai, não-anônimo (por exemplo, a própria caixa de texto).

- -

Se o ponto especificado estiver fora dos limites visíveis do documento ou tiver uma coordenada negativa, o resultado é null.

- -

Se você precisa encontrar uma posição específica dentro do elemento, use {{domxref("Document.caretPositionFromPoint()")}}.

- -

{{Note("Chamados por documentos XUL devem esperar até o evento onload ser acionado antes de chamar este método.")}}

- -

Sintaxe

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

Parâmetros

- -
-
x
-
Uma posição horizontal dentro do viewport atual.
-
y
-
Uma position vertical dentro do viewport atual.
-
- -

Valor retornado

- -

O objeto de nível mais alto {{domxref("Element")}} dentro das coordenadas declaradas.

- -

Exemplo

- -
<!DOCTYPE html>
-<html lang="en">
-<head>
-<title>exemplo de elementFromPoint</title>
-
-<script>
-function changeColor(newColor) {
-  elem = document.elementFromPoint(2, 2);
-  elem.style.color = newColor;
-}
-</script>
-</head>
-
-<body>
-<p id="para1">Algum texto aqui</p>
-<button onclick="changeColor('blue');">azul</button>
-<button onclick="changeColor('red');">vermelho</button>
-</body>
-</html>
-
- -

Especificações

- - - - - - - - - - - - - - -
EspecificaçãoStatusComment
{{SpecName('CSSOM View', '#dom-document-elementfrompoint', 'elementFromPoint')}}{{Spec2('CSSOM View')}}Definição Inicial.
- -

Compatibilidade entre navegadores

- -

{{CompatibilityTable}}

- -
- - - - - - - - - - - - - - - - - - - -
FuncionalidadeChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support {{CompatChrome(4.0)}}35.510.50{{CompatVersionUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
FuncionalidadeAndroidChrome para AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatUnknown}}{{CompatVersionUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
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