From 94fc42181b5a7921ed396a0c8b0ad9a88e653922 Mon Sep 17 00:00:00 2001 From: Florian Scholz Date: Fri, 12 Mar 2021 16:32:53 +0100 Subject: [PATCH 1/3] Move DocumentOrShadowRoot.elementFromPoint to Document.elementFromPoint --- files/en-us/_redirects.txt | 10 +++--- files/en-us/_wikihistory.json | 32 +++++++++--------- .../releases/3/dom_improvements/index.html | 2 +- .../elementfrompoint/index.html | 33 +++++-------------- files/en-us/web/api/document/index.html | 4 +-- 5 files changed, 32 insertions(+), 49 deletions(-) rename files/en-us/web/api/{documentorshadowroot => document}/elementfrompoint/index.html (74%) diff --git a/files/en-us/_redirects.txt b/files/en-us/_redirects.txt index 852e7f8287d309f..068f94579f00918 100644 --- a/files/en-us/_redirects.txt +++ b/files/en-us/_redirects.txt @@ -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 @@ -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 @@ -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 @@ -7513,7 +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 @@ -7555,6 +7554,7 @@ /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/fullscreenElement /en-US/docs/Web/API/Document/fullscreenElement /en-US/docs/Web/API/DocumentOrShadowRoot/getAnimations /en-US/docs/Web/API/Document/getAnimations /en-US/docs/Web/API/DocumentOrShadowRoot/getSelection /en-US/docs/Web/API/Document/getSelection @@ -9292,7 +9292,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 diff --git a/files/en-us/_wikihistory.json b/files/en-us/_wikihistory.json index b20ad9bf66ba63d..213d65ad677dd56 100644 --- a/files/en-us/_wikihistory.json +++ b/files/en-us/_wikihistory.json @@ -44300,22 +44300,6 @@ "jpmedley" ] }, - "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": [ @@ -165787,5 +165771,21 @@ "bede", "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" + ] } } \ No newline at end of file diff --git a/files/en-us/mozilla/firefox/releases/3/dom_improvements/index.html b/files/en-us/mozilla/firefox/releases/3/dom_improvements/index.html index 98bb9cc7817bc29..65099ef51489d55 100644 --- a/files/en-us/mozilla/firefox/releases/3/dom_improvements/index.html +++ b/files/en-us/mozilla/firefox/releases/3/dom_improvements/index.html @@ -13,7 +13,7 @@
  • The Internet Explorer clientTop and clientLeft DOM extensions are now supported.
  • The window.fullScreen property is now always accurate no matter where it is read, even in content. Previously it would return false inaccurately ({{ Bug(127013) }}).
  • The getClientRects and getBoundingClientRect DOM extensions are now supported (see {{ Bug(174397) }}).
  • -
  • The Internet Explorer elementFromPoint DOM extension is now supported ({{ Bug(199692) }}).
  • +
  • The Internet Explorer elementFromPoint DOM extension is now supported ({{ Bug(199692) }}).
  • The Internet Explorer oncut, oncopy, and onpaste DOM extensions are now supported ({{ Bug(280959) }}).
  • Added privileged-code-only getters for Node.nodePrincipal, Node.baseURIObject, and document.documentURIObject. Chrome code must not touch (get or set) these properties on an unwrapped content object (e.g. on a wrappedJSObject of an XPCNativeWrapper), see {{ Bug(324464) }} for details.
  • The Web Applications 1.0 (HTML5) getElementsByClassName() DOM method is now supported.
  • diff --git a/files/en-us/web/api/documentorshadowroot/elementfrompoint/index.html b/files/en-us/web/api/document/elementfrompoint/index.html similarity index 74% rename from files/en-us/web/api/documentorshadowroot/elementfrompoint/index.html rename to files/en-us/web/api/document/elementfrompoint/index.html index bb4f2258063564a..14d6d5ec19305d7 100644 --- a/files/en-us/web/api/documentorshadowroot/elementfrompoint/index.html +++ b/files/en-us/web/api/document/elementfrompoint/index.html @@ -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 ---
    {{APIRef("DOM")}}

    The elementFromPoint() - 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).

    If the element at the specified point belongs to another document (for example, the @@ -45,7 +36,7 @@

    Syntax

    const element = document.elementFromPoint(x, y)
    + class="brush: js">elementFromPoint(x, y)

    Parameters

    @@ -90,7 +81,7 @@

    HTML

    Result

    -

    {{EmbedLiveSample('Example', 400, 80)}}

    +

    {{EmbedLiveSample('Example', 400, 100)}}

    Specifications

    @@ -98,29 +89,21 @@

    Specifications

    Specification - Status - {{SpecName('Shadow - DOM','#dom-documentorshadowroot-elementsfrompoint','elementsFromPoint()')}} - {{Spec2('Shadow DOM')}} - - - {{SpecName('CSSOM View', '#dom-document-elementsfrompoint', - 'elementsFromPoint()')}} - {{Spec2('CSSOM View')}} + {{SpecName('CSSOM View', '#dom-document-elementfrompoint', 'elementFromPoint()')}}

    Browser compatibility

    -

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

    +

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

    See also

    diff --git a/files/en-us/web/api/document/index.html b/files/en-us/web/api/document/index.html index c72d65137bf1b46..828a99add0871a2 100644 --- a/files/en-us/web/api/document/index.html +++ b/files/en-us/web/api/document/index.html @@ -242,6 +242,8 @@

    Methods

    Creates a {{DOMxRef("TouchList")}} object.
    {{DOMxRef("Document.createTreeWalker()")}}
    Creates a {{DOMxRef("TreeWalker")}} object.
    +
    {{DOMxRef("Document.elementFromPoint()")}}
    +
    Returns the topmost element at the specified coordinates.
    {{DOMxRef("Document.enableStyleSheetsForSet()")}} {{Obsolete_Inline}}
    Enables the style sheets for the specified style sheet set.
    {{DOMxRef("Document.exitPictureInPicture()")}}
    @@ -338,8 +340,6 @@

    Methods included from Docume
    {{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.
    From 063f7946d4c7aa779c2df272b033b008b1753f80 Mon Sep 17 00:00:00 2001 From: Florian Scholz Date: Fri, 12 Mar 2021 16:44:25 +0100 Subject: [PATCH 2/3] Move DocumentOrShadowRoot.elementsFromPoint to Document.elementsFromPoint --- files/en-us/_redirects.txt | 2 +- files/en-us/_wikihistory.json | 36 ++++++++--------- .../mozilla/firefox/releases/46/index.html | 2 +- .../elementsfrompoint/index.html | 40 +++++++------------ files/en-us/web/api/document/index.html | 4 +- 5 files changed, 36 insertions(+), 48 deletions(-) rename files/en-us/web/api/{documentorshadowroot => document}/elementsfrompoint/index.html (64%) diff --git a/files/en-us/_redirects.txt b/files/en-us/_redirects.txt index 068f94579f00918..20c52c91b9887fa 100644 --- a/files/en-us/_redirects.txt +++ b/files/en-us/_redirects.txt @@ -7513,7 +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/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 @@ -7555,6 +7554,7 @@ /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/fullscreenElement /en-US/docs/Web/API/Document/fullscreenElement /en-US/docs/Web/API/DocumentOrShadowRoot/getAnimations /en-US/docs/Web/API/Document/getAnimations /en-US/docs/Web/API/DocumentOrShadowRoot/getSelection /en-US/docs/Web/API/Document/getSelection diff --git a/files/en-us/_wikihistory.json b/files/en-us/_wikihistory.json index 213d65ad677dd56..63af2bb8cc74778 100644 --- a/files/en-us/_wikihistory.json +++ b/files/en-us/_wikihistory.json @@ -44300,24 +44300,6 @@ "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": [ @@ -165787,5 +165769,23 @@ "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", + "david_ross", + "jpmedley" + ] } } \ No newline at end of file diff --git a/files/en-us/mozilla/firefox/releases/46/index.html b/files/en-us/mozilla/firefox/releases/46/index.html index 5374848b6534afb..ae98d5dc0d61bea 100644 --- a/files/en-us/mozilla/firefox/releases/46/index.html +++ b/files/en-us/mozilla/firefox/releases/46/index.html @@ -62,7 +62,7 @@

    DOM & HTML DOM

    • The deprecated {{domxref("Window.showModalDialog()")}} method is no more available when Firefox runs in multi-process mode (e10s) ({{bug(1234700)}}).
    • -
    • Added support for {{domxref("DocumentOrShadowRoot/elementsFromPoint", "Document.elementsFromPoint")}} ({{bug(1164427)}}).
    • +
    • Added support for {{domxref("Document.elementsFromPoint()")}} ({{bug(1164427)}}).
    • 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 -1, the {{htmlattrxref("selectedOptions", "select")}} to an empty {{domxref("HTMLCollection")}}, and {{htmlattrxref("value", "select")}} to an empty string ({{bug(1203668)}}).
    diff --git a/files/en-us/web/api/documentorshadowroot/elementsfrompoint/index.html b/files/en-us/web/api/document/elementsfrompoint/index.html similarity index 64% rename from files/en-us/web/api/documentorshadowroot/elementsfrompoint/index.html rename to files/en-us/web/api/document/elementsfrompoint/index.html index de5d415626de034..63f79afd76f86cf 100644 --- a/files/en-us/web/api/documentorshadowroot/elementsfrompoint/index.html +++ b/files/en-us/web/api/document/elementsfrompoint/index.html @@ -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 --- -
    {{APIRef("DOM")}}{{SeeCompatTable}}
    +
    {{APIRef("DOM")}}

    The elementsFromPoint() 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).

    -

    It operates in a similar way to the {{domxref("DocumentOrShadowRoot.elementFromPoint", +

    It operates in a similar way to the {{domxref("Document.elementFromPoint", "elementFromPoint()")}} method.

    Syntax

    const elements = document.elementsFromPoint(x, y);
    + class="brush: js">elementsFromPoint(x, y);

    Parameters

    @@ -75,29 +71,21 @@

    Specifications

    Specification - Status - {{SpecName('Shadow - DOM','#dom-documentorshadowroot-elementsfrompoint','elementsFromPoint()')}} - {{Spec2('Shadow DOM')}} - - - {{SpecName('CSSOM View', '#dom-document-elementsfrompoint', - 'elementsFromPoint()')}} - {{Spec2('CSSOM View')}} + {{SpecName('CSSOM View', '#dom-document-elementsfrompoint', 'elementsFromPoint()')}}

    Browser compatibility

    -

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

    +

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

    See also

      -
    • {{DOMxRef("DocumentOrShadowRoot.elementFromPoint()")}}
    • +
    • {{DOMxRef("Document.elementFromPoint()")}}
    diff --git a/files/en-us/web/api/document/index.html b/files/en-us/web/api/document/index.html index 828a99add0871a2..9f75882b4439319 100644 --- a/files/en-us/web/api/document/index.html +++ b/files/en-us/web/api/document/index.html @@ -244,6 +244,8 @@

    Methods

    Creates a {{DOMxRef("TreeWalker")}} object.
    {{DOMxRef("Document.elementFromPoint()")}}
    Returns the topmost element at the specified coordinates.
    +
    {{DOMxRef("Document.elementsFromPoint()")}}
    +
    Returns an array of all elements at the specified coordinates.
    {{DOMxRef("Document.enableStyleSheetsForSet()")}} {{Obsolete_Inline}}
    Enables the style sheets for the specified style sheet set.
    {{DOMxRef("Document.exitPictureInPicture()")}}
    @@ -340,8 +342,6 @@

    Methods included from Docume
    {{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.elementsFromPoint()")}}
    -
    Returns an array of all elements at the specified coordinates.

    Events

    From a2fa3912072dd0e30e3768f355d6c04536039793 Mon Sep 17 00:00:00 2001 From: Florian Scholz Date: Mon, 15 Mar 2021 12:06:09 +0100 Subject: [PATCH 3/3] merge redirect into correct position --- files/en-us/_redirects.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/_redirects.txt b/files/en-us/_redirects.txt index 46cc45a31fb82e3..64d7c2f0bd58bd5 100644 --- a/files/en-us/_redirects.txt +++ b/files/en-us/_redirects.txt @@ -7553,9 +7553,9 @@ /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/caretPositionFromPoint /en-US/docs/Web/API/Document/caretPositionFromPoint /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 /en-US/docs/Web/API/DocumentOrShadowRoot/getSelection /en-US/docs/Web/API/Document/getSelection