Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move DocumentOrShadowRoot.element(s)FromPoint to Document.element(s)FromPoint #3069

Merged
merged 4 commits into from
Mar 15, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions files/en-us/_redirects.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1914,7 +1914,7 @@
/en-US/docs/DOM/document.documentURI /en-US/docs/Web/API/Document/documentURI
/en-US/docs/DOM/document.documentURIObject /en-US/docs/Web/API/Document/documentURIObject
/en-US/docs/DOM/document.domain /en-US/docs/Web/API/Document/domain
/en-US/docs/DOM/document.elementFromPoint /en-US/docs/Web/API/DocumentOrShadowRoot/elementFromPoint
/en-US/docs/DOM/document.elementFromPoint /en-US/docs/Web/API/Document/elementFromPoint
/en-US/docs/DOM/document.embeds /en-US/docs/Web/API/Document/embeds
/en-US/docs/DOM/document.enableStyleSheetsForSet /en-US/docs/Web/API/Document/enableStyleSheetsForSet
/en-US/docs/DOM/document.execCommand /en-US/docs/Web/API/Document/execCommand
Expand Down Expand Up @@ -2452,7 +2452,7 @@
/en-US/docs/DOM:document.documentElement /en-US/docs/Web/API/document/documentElement
/en-US/docs/DOM:document.documentURIObject /en-US/docs/Web/API/Document/documentURIObject
/en-US/docs/DOM:document.domain /en-US/docs/Web/API/Document/domain
/en-US/docs/DOM:document.elementFromPoint /en-US/docs/Web/API/DocumentOrShadowRoot/elementFromPoint
/en-US/docs/DOM:document.elementFromPoint /en-US/docs/Web/API/Document/elementFromPoint
/en-US/docs/DOM:document.embeds /en-US/docs/Web/API/Document/embeds
/en-US/docs/DOM:document.fgColor /en-US/docs/Web/API/Document/fgColor
/en-US/docs/DOM:document.firstChild /en-US/docs/Web/API/Node/firstChild
Expand Down Expand Up @@ -3285,7 +3285,7 @@
/en-US/docs/Document_Object_Model_(DOM)/document.documentURI /en-US/docs/Web/API/Document/documentURI
/en-US/docs/Document_Object_Model_(DOM)/document.documentURIObject /en-US/docs/Web/API/Document/documentURIObject
/en-US/docs/Document_Object_Model_(DOM)/document.domain /en-US/docs/Web/API/Document/domain
/en-US/docs/Document_Object_Model_(DOM)/document.elementFromPoint /en-US/docs/Web/API/DocumentOrShadowRoot/elementFromPoint
/en-US/docs/Document_Object_Model_(DOM)/document.elementFromPoint /en-US/docs/Web/API/Document/elementFromPoint
/en-US/docs/Document_Object_Model_(DOM)/document.embeds /en-US/docs/Web/API/Document/embeds
/en-US/docs/Document_Object_Model_(DOM)/document.execCommand /en-US/docs/Web/API/Document/execCommand
/en-US/docs/Document_Object_Model_(DOM)/document.fgColor /en-US/docs/Web/API/Document/fgColor
Expand Down Expand Up @@ -7513,8 +7513,6 @@
/en-US/docs/Web/API/Document/defaultView/resize_event /en-US/docs/Web/API/Window/resize_event
/en-US/docs/Web/API/Document/defaultView/storage_event /en-US/docs/Web/API/Window/storage_event
/en-US/docs/Web/API/Document/domConfig /en-US/docs/Web/API/Document
/en-US/docs/Web/API/Document/elementFromPoint /en-US/docs/Web/API/DocumentOrShadowRoot/elementFromPoint
/en-US/docs/Web/API/Document/elementsFromPoint /en-US/docs/Web/API/DocumentOrShadowRoot/elementsFromPoint
/en-US/docs/Web/API/Document/firstElementChild /en-US/docs/Web/API/ParentNode/firstElementChild
/en-US/docs/Web/API/Document/inputEncoding /en-US/docs/Web/API/document/characterSet
/en-US/docs/Web/API/Document/lastElementChild /en-US/docs/Web/API/ParentNode/lastElementChild
Expand Down Expand Up @@ -7555,6 +7553,8 @@
/en-US/docs/Web/API/DocumentFragment/firstElementChild /en-US/docs/Web/API/ParentNode/firstElementChild
/en-US/docs/Web/API/DocumentFragment/lastElementChild /en-US/docs/Web/API/ParentNode/lastElementChild
/en-US/docs/Web/API/DocumentOrShadowRoot/activeElement /en-US/docs/Web/API/Document/activeElement
/en-US/docs/Web/API/DocumentOrShadowRoot/elementFromPoint /en-US/docs/Web/API/Document/elementFromPoint
/en-US/docs/Web/API/DocumentOrShadowRoot/elementsFromPoint /en-US/docs/Web/API/Document/elementsFromPoint
/en-US/docs/Web/API/DocumentOrShadowRoot/caretPositionFromPoint /en-US/docs/Web/API/Document/caretPositionFromPoint
/en-US/docs/Web/API/DocumentOrShadowRoot/fullscreenElement /en-US/docs/Web/API/Document/fullscreenElement
/en-US/docs/Web/API/DocumentOrShadowRoot/getAnimations /en-US/docs/Web/API/Document/getAnimations
Expand Down Expand Up @@ -9297,7 +9297,7 @@
/en-US/docs/Web/API/document.documentURI /en-US/docs/Web/API/Document/documentURI
/en-US/docs/Web/API/document.documentURIObject /en-US/docs/Web/API/Document/documentURIObject
/en-US/docs/Web/API/document.domain /en-US/docs/Web/API/Document/domain
/en-US/docs/Web/API/document.elementFromPoint /en-US/docs/Web/API/DocumentOrShadowRoot/elementFromPoint
/en-US/docs/Web/API/document.elementFromPoint /en-US/docs/Web/API/Document/elementFromPoint
/en-US/docs/Web/API/document.embeds /en-US/docs/Web/API/Document/embeds
/en-US/docs/Web/API/document.enableStyleSheetsForSet /en-US/docs/Web/API/Document/enableStyleSheetsForSet
/en-US/docs/Web/API/document.evaluate /en-US/docs/Web/API/Document/evaluate
Expand Down
68 changes: 33 additions & 35 deletions files/en-us/_wikihistory.json
Original file line number Diff line number Diff line change
Expand Up @@ -44289,40 +44289,6 @@
"david_ross"
]
},
"Web/API/DocumentOrShadowRoot/elementFromPoint": {
"modified": "2020-10-15T21:49:27.541Z",
"contributors": [
"Zearin_Galaurum",
"sideshowbarker",
"Nickolay",
"Sheppy",
"ExE-Boss",
"rsinohara",
"fscholz",
"chrisdavidmills",
"HolgerJeromin",
"david_ross",
"jpmedley"
]
},
"Web/API/DocumentOrShadowRoot/elementsFromPoint": {
"modified": "2020-10-15T21:49:27.171Z",
"contributors": [
"mfuji09",
"Zearin_Galaurum",
"sideshowbarker",
"samthor",
"LucasSouza6",
"ExE-Boss",
"progers",
"fscholz",
"chrisdavidmills",
"HolgerJeromin",
"mbhall88",
"david_ross",
"jpmedley"
]
},
"Web/API/DocumentTimeline": {
"modified": "2020-10-15T21:45:09.763Z",
"contributors": [
Expand Down Expand Up @@ -165777,6 +165743,38 @@
"david_ross"
]
},
"Web/API/Document/elementFromPoint": {
"modified": "2020-10-15T21:49:27.541Z",
"contributors": [
"Zearin_Galaurum",
"sideshowbarker",
"Nickolay",
"Sheppy",
"ExE-Boss",
"rsinohara",
"fscholz",
"chrisdavidmills",
"HolgerJeromin",
"david_ross",
"jpmedley"
]
},
"Web/API/Document/elementsFromPoint": {
"modified": "2020-10-15T21:49:27.171Z",
"contributors": [
"mfuji09",
"Zearin_Galaurum",
"sideshowbarker",
"samthor",
"LucasSouza6",
"ExE-Boss",
"progers",
"fscholz",
"chrisdavidmills",
"HolgerJeromin",
"mbhall88"
]
},
"Web/API/Document/caretPositionFromPoint": {
"modified": "2020-10-15T21:49:27.908Z",
"contributors": [
Expand All @@ -165788,4 +165786,4 @@
"jpmedley"
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<li>The Internet Explorer <code><a href="/en-US/docs/Web/API/Element/clientTop">clientTop</a></code> and <code><a href="/en-US/docs/Web/API/Element/clientLeft">clientLeft</a></code> DOM extensions are now supported.</li>
<li>The <code><a href="/en-US/docs/Web/API/Window/fullScreen">window.fullScreen</a></code> property is now always accurate no matter where it is read, even in content. Previously it would return <code>false</code> inaccurately ({{ Bug(127013) }}).</li>
<li>The <code><a href="/en-US/docs/Web/API/Element/getClientRects">getClientRects</a></code> and <code><a href="/en-US/docs/Web/API/Element/getBoundingClientRect">getBoundingClientRect</a></code> DOM extensions are now supported (see {{ Bug(174397) }}).</li>
<li>The Internet Explorer <code><a href="/en-US/docs/Web/API/DocumentOrShadowRoot/elementFromPoint">elementFromPoint</a></code> DOM extension is now supported ({{ Bug(199692) }}).</li>
<li>The Internet Explorer <code><a href="/en-US/docs/Web/API/Document/elementFromPoint">elementFromPoint</a></code> DOM extension is now supported ({{ Bug(199692) }}).</li>
<li>The Internet Explorer <code><a href="/en-US/docs/Web/API/HTMLElement/oncut">oncut</a></code>, <code><a href="/en-US/docs/Web/API/HTMLElement/oncopy">oncopy</a></code>, and <code><a href="/en-US/docs/Web/API/HTMLElement/onpaste">onpaste</a></code> DOM extensions are now supported ({{ Bug(280959) }}).</li>
<li>Added privileged-code-only getters for <code>Node.nodePrincipal</code>, <code>Node.baseURIObject</code>, and <code><a href="/en-US/docs/Web/API/Document/documentURIObject">document.documentURIObject</a></code>. Chrome code must not touch (get or set) these properties on an unwrapped content object (e.g. on a <code>wrappedJSObject</code> of an <code><a href="/en-US/XPCNativeWrapper">XPCNativeWrapper</a></code>), see {{ Bug(324464) }} for details.</li>
<li>The Web Applications 1.0 (HTML5) <code><a href="/en-US/docs/Web/API/Document/getElementsByClassName">getElementsByClassName()</a></code> DOM method is now supported.</li>
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/mozilla/firefox/releases/46/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ <h4 id="DOM_HTML_DOM">DOM &amp; HTML DOM</h4>

<ul>
<li>The deprecated {{domxref("Window.showModalDialog()")}} method is no more available when Firefox runs in multi-process mode (e10s) ({{bug(1234700)}}).</li>
<li>Added support for {{domxref("DocumentOrShadowRoot/elementsFromPoint", "Document.elementsFromPoint")}} ({{bug(1164427)}}).</li>
<li>Added support for {{domxref("Document.elementsFromPoint()")}} ({{bug(1164427)}}).</li>
<li>When a non-existent option of a {{HTMLElement("select")}} element is programmatically selected, instead of being incorrectly left unchanged, the {{htmlattrxref("selectedIndex", "select")}} value is now set to <code>-1</code>, the {{htmlattrxref("selectedOptions", "select")}} to an empty {{domxref("HTMLCollection")}}, and {{htmlattrxref("value", "select")}} to an empty string ({{bug(1203668)}}).</li>
</ul>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,17 @@
---
title: DocumentOrShadowRoot.elementFromPoint()
slug: Web/API/DocumentOrShadowRoot/elementFromPoint
title: Document.elementFromPoint()
slug: Web/API/Document/elementFromPoint
tags:
- API
- Coordinates
- Document
- DocumentOrShadowRoot
- Find Element
- Method
- Point
- Reference
- ShadowRoot
- elementFromPoint
- elementFromPoint()
- find
- shadow dom
---
<div>{{APIRef("DOM")}}</div>

<p><span class="seoSummary">The <strong><code>elementFromPoint()</code></strong>
method—available on both the {{domxref("Document")}} and {{domxref("ShadowRoot")}}
objects—returns the topmost {{domxref("Element")}} at the specified coordinates
method, available on the {{domxref("Document")}} object, returns the topmost {{domxref("Element")}} at the specified coordinates
(relative to the viewport).</span></p>

<p>If the element at the specified point belongs to another document (for example, the
Expand All @@ -45,7 +36,7 @@
<h2 id="Syntax">Syntax</h2>

<pre
class="brush: js">const <var>element</var> = document.elementFromPoint(<var>x</var>, <var>y</var>)</pre>
class="brush: js">elementFromPoint(x, y)</pre>

<h3 id="Parameters">Parameters</h3>

Expand Down Expand Up @@ -90,37 +81,29 @@ <h3 id="HTML">HTML</h3>

<h3 id="Result">Result</h3>

<p>{{EmbedLiveSample('Example', 400, 80)}}</p>
<p>{{EmbedLiveSample('Example', 400, 100)}}</p>

<h2 id="Specifications">Specifications</h2>

<table class="standard-table">
<thead>
<tr>
<th scope="col">Specification</th>
<th scope="col">Status</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{SpecName('Shadow
DOM','#dom-documentorshadowroot-elementsfrompoint','elementsFromPoint()')}}</td>
<td>{{Spec2('Shadow DOM')}}</td>
</tr>
<tr>
<td>{{SpecName('CSSOM View', '#dom-document-elementsfrompoint',
'elementsFromPoint()')}}</td>
<td>{{Spec2('CSSOM View')}}</td>
<td>{{SpecName('CSSOM View', '#dom-document-elementfrompoint', 'elementFromPoint()')}}</td>
</tr>
</tbody>
</table>

<h2 id="Browser_compatibility">Browser compatibility</h2>

<p>{{Compat("api.DocumentOrShadowRoot.elementFromPoint")}}</p>
<p>{{Compat("api.Document.elementFromPoint")}}</p>

<h2 id="See_also">See also</h2>

<ul>
<li>{{domxref("DocumentOrShadowRoot.elementsFromPoint()")}}</li>
<li>{{domxref("Document.elementsFromPoint()")}}</li>
</ul>
Original file line number Diff line number Diff line change
@@ -1,30 +1,26 @@
---
title: DocumentOrShadowRoot.elementsFromPoint()
slug: Web/API/DocumentOrShadowRoot/elementsFromPoint
title: Document.elementsFromPoint()
slug: Web/API/Document/elementsFromPoint
tags:
- API
- Document
- DocumentOrShadowRoot
- Method
- Reference
- ShadowRoot
- elementsFromPoint
- elementsFromPoint()
- shadow dom
- API
- Document
- Method
- Reference
- elementsFromPoint
---
<div>{{APIRef("DOM")}}{{SeeCompatTable}}</div>
<div>{{APIRef("DOM")}}</div>

<p><span class="seoSummary">The <strong><code>elementsFromPoint()</code></strong> method
of the {{domxref("DocumentOrShadowRoot")}} interface returns an array of all elements
of the {{domxref("Document")}} interface returns an array of all elements
at the specified coordinates (relative to the viewport).</span></p>

<p>It operates in a similar way to the {{domxref("DocumentOrShadowRoot.elementFromPoint",
<p>It operates in a similar way to the {{domxref("Document.elementFromPoint",
"elementFromPoint()")}} method.</p>

<h2 id="Syntax">Syntax</h2>

<pre
class="brush: js">const elements = document.elementsFromPoint(<var>x</var>, <var>y</var>);</pre>
class="brush: js">elementsFromPoint(x, y);</pre>

<h3 id="Parameters">Parameters</h3>

Expand Down Expand Up @@ -75,29 +71,21 @@ <h2 id="Specifications">Specifications</h2>
<thead>
<tr>
<th scope="col">Specification</th>
<th scope="col">Status</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{SpecName('Shadow
DOM','#dom-documentorshadowroot-elementsfrompoint','elementsFromPoint()')}}</td>
<td>{{Spec2('Shadow DOM')}}</td>
</tr>
<tr>
<td>{{SpecName('CSSOM View', '#dom-document-elementsfrompoint',
'elementsFromPoint()')}}</td>
<td>{{Spec2('CSSOM View')}}</td>
<td>{{SpecName('CSSOM View', '#dom-document-elementsfrompoint', 'elementsFromPoint()')}}</td>
</tr>
</tbody>
</table>

<h2 id="Browser_compatibility">Browser compatibility</h2>

<p>{{Compat("api.DocumentOrShadowRoot.elementsFromPoint")}}</p>
<p>{{Compat("api.Document.elementsFromPoint")}}</p>

<h2 id="See_also">See also</h2>

<ul>
<li>{{DOMxRef("DocumentOrShadowRoot.elementFromPoint()")}}</li>
<li>{{DOMxRef("Document.elementFromPoint()")}}</li>
</ul>
15 changes: 4 additions & 11 deletions files/en-us/web/api/document/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,10 @@ <h2 id="Methods">Methods</h2>
<dd>Creates a {{DOMxRef("TouchList")}} object.</dd>
<dt>{{DOMxRef("Document.createTreeWalker()")}}</dt>
<dd>Creates a {{DOMxRef("TreeWalker")}} object.</dd>
<dt>{{DOMxRef("Document.elementFromPoint()")}}</dt>
<dd>Returns the topmost element at the specified coordinates.</dd>
<dt>{{DOMxRef("Document.elementsFromPoint()")}}</dt>
<dd>Returns an array of all elements at the specified coordinates.</dd>
<dt>{{DOMxRef("Document.enableStyleSheetsForSet()")}} {{Obsolete_Inline}}</dt>
<dd>Enables the style sheets for the specified style sheet set.</dd>
<dt>{{DOMxRef("Document.exitPictureInPicture()")}}</dt>
Expand Down Expand Up @@ -333,17 +337,6 @@ <h3 id="Extension_for_HTML_documents">Extension for HTML documents</h3>
<dd>Writes a line of text in a document.</dd>
</dl>

<h3 id="Methods_included_from_DocumentOrShadowRoot">Methods included from DocumentOrShadowRoot</h3>

<p><em>The <code>Document</code> interface includes the following methods defined on the {{DOMxRef("DocumentOrShadowRoot")}} mixin. Note that this is currently only implemented by Chrome; other browsers still implement them on the {{DOMxRef("Document")}} interface.</em></p>

<dl>
<dt>{{DOMxRef("DocumentOrShadowRoot.elementFromPoint()")}}</dt>
<dd>Returns the topmost element at the specified coordinates.</dd>
<dt>{{DOMxRef("DocumentOrShadowRoot.elementsFromPoint()")}}</dt>
<dd>Returns an array of all elements at the specified coordinates.</dd>
</dl>

<h2 id="Events">Events</h2>

<p>Listen to these events using <code>addEventListener()</code> or by assigning an event listener to the <code>on<em>eventname</em></code> property of this interface.</p>
Expand Down