From 908f4c158d1acf2899ec99721c40036d2a09be07 Mon Sep 17 00:00:00 2001 From: estelle Date: Thu, 5 Dec 2024 18:42:20 -0800 Subject: [PATCH 01/12] New pages: ShadowRoot.elementFromPoint() --- .../api/shadowroot/elementfrompoint/index.md | 66 +++++++++++++++++ .../api/shadowroot/elementsfrompoint/index.md | 71 +++++++++++++++++++ 2 files changed, 137 insertions(+) create mode 100644 files/en-us/web/api/shadowroot/elementfrompoint/index.md create mode 100644 files/en-us/web/api/shadowroot/elementsfrompoint/index.md diff --git a/files/en-us/web/api/shadowroot/elementfrompoint/index.md b/files/en-us/web/api/shadowroot/elementfrompoint/index.md new file mode 100644 index 000000000000000..617a70fc6d03c80 --- /dev/null +++ b/files/en-us/web/api/shadowroot/elementfrompoint/index.md @@ -0,0 +1,66 @@ +--- +title: "ShadowRoot: elementFromPoint() method" +short-title: elementFromPoint() +slug: Web/API/ShadowRoot/elementFromPoint +page-type: web-api-instance-method +browser-compat: api.ShadowRoot.elementFromPoint +--- + +{{APIRef("DOM")}}{{Non-standard_Header}} + +The **`elementFromPoint()`** method, available on the {{domxref("ShadowRoot")}} object, returns the topmost shadowroot element at the specified coordinates relative to the viewport that does not have {{cssxref("pointer-events")}} set to `none`. + +If the specified point is outside the bounds of the shadowRoot, the result is `undefined`. + +## Syntax + +```js-nolint +elementFromPoint(x, y) +``` + +### Parameters + +- `x` + - : The horizontal coordinate of a point, relative to the left edge of the current + {{Glossary("viewport")}}. +- `y` + - : The vertical coordinate of a point, relative to the top edge of the current + viewport. + +### Return value + +The topmost shadowRoot {{domxref("Element")}} object located at the specified coordinates, if any. + +## Examples + +In this example, assuming the existence of a {{htmlelement("template")}} in the HTML, we define a `` and, if the custom element abuts the top-left corner of the viewport, the topmost element in the top-left corner of that custom element is set to have a thin, dashed red border. + +```js +customElements.define( + "my-custom-element", + class extends HTMLElement { + constructor() { + super(); + let template = document.getElementById("my-custom-element-template"); + let templateContent = template.content; + const sRoot = this.attachShadow({ mode: "open" }); + sRoot.appendChild(templateContent.cloneNode(true)); + let srElement = this.shadowRoot.elementFromPoint(0, 0); + srElement.style.border = "1px dashed red"; + } + }, +); +``` + +## Specifications + +Not part of any standard. + +## Browser compatibility + +{{Compat}} + +## See also + +- {{domxref("ShadowRoot.elementsFromPoint()")}} +- {{domxref("Document.elementFromPoint()")}} diff --git a/files/en-us/web/api/shadowroot/elementsfrompoint/index.md b/files/en-us/web/api/shadowroot/elementsfrompoint/index.md new file mode 100644 index 000000000000000..ea3ef83bf6a605e --- /dev/null +++ b/files/en-us/web/api/shadowroot/elementsfrompoint/index.md @@ -0,0 +1,71 @@ +--- +title: "ShadowRoot: elementsFromPoint() method" +short-title: elementsFromPoint() +slug: Web/API/ShadowRoot/elementsFromPoint +page-type: web-api-instance-method +browser-compat: api.ShadowRoot.elementsFromPoint +--- + +{{APIRef("DOM")}}{{Non-standard_Header}} + +The **`elementsFromPoint()`** method of the {{domxref("ShadowRoot")}} interface returns an array of all the shadow root elements +at the specified coordinates (relative to the viewport). The elements are ordered from the topmost descendant to the bottommost element. + +It operates in a similar way to the {{domxref("ShadowRoot.elementFromPoint", "elementFromPoint()")}} method. Some browsers return only the shadow root elements present at that location. Other browsers include elements outside of the {{glossary("shadow DOM")}}, from the topmost shadow DOM element to the document root node, such as the {{htmlelement("html")}} or {{SVGElement("svg")}} root element. In these browsers, it operates similar to the {{domxref("Document.elementsFromPoint", "elementFromPoint()")}} method, but with the ability to cross the [shadow boundary](/en-US/docs/Glossary/Shadow_tree). + +## Syntax + +```js-nolint +elementsFromPoint(x, y) +``` + +### Parameters + +- `x` + - : The horizontal coordinate of a point. +- `y` + - : The vertical coordinate of a point. + +### Return value + +An array of {{domxref('Element')}} objects. + +## Examples + +```js +let customElem = document.querySelector("my-custom-element"); +let shadow = customElem.shadowRoot; +let msg = ""; +let elements = shadow.elementsFromPoint(20, 20); +elements.forEach((el, i) => { + msg += el.localName; + if (i < elements.length - 1) { + msg += " < "; + } +}); +if (msg) { + console.log(msg); +} else { + console.log("The custom element had no descendants at x: 20, y: 20."); +} +``` + +If `` is near the top left corner of the viewport, and contains a single `
`, the above may return either of the following, depending on the browser implementation: + +```plain +div +div > my-custom-element > body > html +``` + +## Specifications + +Not part of any standard. + +## Browser compatibility + +{{Compat}} + +## See also + +- {{DOMxRef("ShadowRoot.elementFromPoint()")}} +- {{DOMxRef("Document.elementsFromPoint()")}} From c5bea04d3b148492c3992a54a71bbdde1976c6f4 Mon Sep 17 00:00:00 2001 From: Estelle Weyl Date: Thu, 12 Dec 2024 13:11:16 -0800 Subject: [PATCH 02/12] return value --- files/en-us/web/api/shadowroot/elementfrompoint/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/web/api/shadowroot/elementfrompoint/index.md b/files/en-us/web/api/shadowroot/elementfrompoint/index.md index 617a70fc6d03c80..15260c95ec89110 100644 --- a/files/en-us/web/api/shadowroot/elementfrompoint/index.md +++ b/files/en-us/web/api/shadowroot/elementfrompoint/index.md @@ -29,7 +29,7 @@ elementFromPoint(x, y) ### Return value -The topmost shadowRoot {{domxref("Element")}} object located at the specified coordinates, if any. +An {{domxref("Element")}}; the topmost shadowRoot object located at the specified coordinates, if any. ## Examples From 087a658c2bce11a746befbd8f82fea919601b543 Mon Sep 17 00:00:00 2001 From: estelle Date: Sat, 11 Jan 2025 15:48:13 -0500 Subject: [PATCH 03/12] edits based on review --- .../api/shadowroot/elementfrompoint/index.md | 24 ++++++++++--------- .../api/shadowroot/elementsfrompoint/index.md | 6 ++--- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/files/en-us/web/api/shadowroot/elementfrompoint/index.md b/files/en-us/web/api/shadowroot/elementfrompoint/index.md index 15260c95ec89110..ac7f1d7566977da 100644 --- a/files/en-us/web/api/shadowroot/elementfrompoint/index.md +++ b/files/en-us/web/api/shadowroot/elementfrompoint/index.md @@ -8,9 +8,9 @@ browser-compat: api.ShadowRoot.elementFromPoint {{APIRef("DOM")}}{{Non-standard_Header}} -The **`elementFromPoint()`** method, available on the {{domxref("ShadowRoot")}} object, returns the topmost shadowroot element at the specified coordinates relative to the viewport that does not have {{cssxref("pointer-events")}} set to `none`. +The **`elementFromPoint()`** method, available on the {{domxref("ShadowRoot")}} object, returns the element at the topmost shadow root layer at the specified coordinates relative to the viewport. Shadow root elements that have {{cssxref("pointer-events")}} set to `none` are ignored. -If the specified point is outside the bounds of the shadowRoot, the result is `undefined`. +If the specified point is outside the bounds of the shadow root, the result is `undefined`. ## Syntax @@ -21,19 +21,17 @@ elementFromPoint(x, y) ### Parameters - `x` - - : The horizontal coordinate of a point, relative to the left edge of the current - {{Glossary("viewport")}}. + - : The horizontal coordinate of a point, relative to the left edge of the current {{Glossary("viewport")}}. - `y` - - : The vertical coordinate of a point, relative to the top edge of the current - viewport. + - : The vertical coordinate of a point, relative to the top edge of the current viewport. ### Return value -An {{domxref("Element")}}; the topmost shadowRoot object located at the specified coordinates, if any. +An {{domxref("Element")}}; the topmost shadow root element located at the specified coordinates, if any. ## Examples -In this example, assuming the existence of a {{htmlelement("template")}} in the HTML, we define a `` and, if the custom element abuts the top-left corner of the viewport, the topmost element in the top-left corner of that custom element is set to have a thin, dashed red border. +In this example, assuming the existence of a {{htmlelement("template")}} in the HTML, we define a ``. If the appended custom element abuts the top-left corner of the viewport, or any portion of it overlaps that corner, the element that is the topmost layer at that point in the custom element will have a thin, dashed red border. ```js customElements.define( @@ -41,11 +39,15 @@ customElements.define( class extends HTMLElement { constructor() { super(); - let template = document.getElementById("my-custom-element-template"); - let templateContent = template.content; + const templateContent = document.getElementById( + "my-custom-element-template", + ).content; const sRoot = this.attachShadow({ mode: "open" }); sRoot.appendChild(templateContent.cloneNode(true)); - let srElement = this.shadowRoot.elementFromPoint(0, 0); + + // get the top most Element in the top left corner of the viewport + const srElement = this.shadowRoot.elementFromPoint(0, 0); + // apply a border to that element srElement.style.border = "1px dashed red"; } }, diff --git a/files/en-us/web/api/shadowroot/elementsfrompoint/index.md b/files/en-us/web/api/shadowroot/elementsfrompoint/index.md index ea3ef83bf6a605e..2ea53dba313c793 100644 --- a/files/en-us/web/api/shadowroot/elementsfrompoint/index.md +++ b/files/en-us/web/api/shadowroot/elementsfrompoint/index.md @@ -9,9 +9,9 @@ browser-compat: api.ShadowRoot.elementsFromPoint {{APIRef("DOM")}}{{Non-standard_Header}} The **`elementsFromPoint()`** method of the {{domxref("ShadowRoot")}} interface returns an array of all the shadow root elements -at the specified coordinates (relative to the viewport). The elements are ordered from the topmost descendant to the bottommost element. +at the specified coordinates (relative to the viewport). The elements are ordered from the element in the top most layer, to the bottommost element. -It operates in a similar way to the {{domxref("ShadowRoot.elementFromPoint", "elementFromPoint()")}} method. Some browsers return only the shadow root elements present at that location. Other browsers include elements outside of the {{glossary("shadow DOM")}}, from the topmost shadow DOM element to the document root node, such as the {{htmlelement("html")}} or {{SVGElement("svg")}} root element. In these browsers, it operates similar to the {{domxref("Document.elementsFromPoint", "elementFromPoint()")}} method, but with the ability to cross the [shadow boundary](/en-US/docs/Glossary/Shadow_tree). +It operates in a similar way to the {{domxref("ShadowRoot.elementFromPoint")}} method. Some browsers return only the shadow root elements present at that location. Other browsers include elements outside of the {{glossary("shadow DOM")}}, from the shadow DOM element in the topmost layer to the document root node, such as the {{htmlelement("html")}} or {{SVGElement("svg")}} root element. In these browsers, it operates similar to the {{domxref("Document.elementsFromPoint")}} method, but with the ability to cross the [shadow boundary](/en-US/docs/Glossary/Shadow_tree). ## Syntax @@ -54,7 +54,7 @@ If `` is near the top left corner of the viewport, and contai ```plain div -div > my-custom-element > body > html +div < my-custom-element < body < html ``` ## Specifications From c480c757d754afd62ef78e8d14355bc140535a59 Mon Sep 17 00:00:00 2001 From: Estelle Weyl Date: Thu, 23 Jan 2025 15:47:44 -0800 Subject: [PATCH 04/12] Update files/en-us/web/api/shadowroot/elementsfrompoint/index.md Co-authored-by: Hamish Willee --- files/en-us/web/api/shadowroot/elementsfrompoint/index.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/files/en-us/web/api/shadowroot/elementsfrompoint/index.md b/files/en-us/web/api/shadowroot/elementsfrompoint/index.md index 2ea53dba313c793..f4590af75095bdb 100644 --- a/files/en-us/web/api/shadowroot/elementsfrompoint/index.md +++ b/files/en-us/web/api/shadowroot/elementsfrompoint/index.md @@ -8,8 +8,7 @@ browser-compat: api.ShadowRoot.elementsFromPoint {{APIRef("DOM")}}{{Non-standard_Header}} -The **`elementsFromPoint()`** method of the {{domxref("ShadowRoot")}} interface returns an array of all the shadow root elements -at the specified coordinates (relative to the viewport). The elements are ordered from the element in the top most layer, to the bottommost element. +The **`elementsFromPoint()`** method of the {{domxref("ShadowRoot")}} interface returns an array of all the shadow root elements at the specified coordinates (relative to the viewport). The elements are ordered from the element in the topmost layer, to the bottommost element. It operates in a similar way to the {{domxref("ShadowRoot.elementFromPoint")}} method. Some browsers return only the shadow root elements present at that location. Other browsers include elements outside of the {{glossary("shadow DOM")}}, from the shadow DOM element in the topmost layer to the document root node, such as the {{htmlelement("html")}} or {{SVGElement("svg")}} root element. In these browsers, it operates similar to the {{domxref("Document.elementsFromPoint")}} method, but with the ability to cross the [shadow boundary](/en-US/docs/Glossary/Shadow_tree). From a804380227076578482cb69525c72663cc994c10 Mon Sep 17 00:00:00 2001 From: Estelle Weyl Date: Thu, 23 Jan 2025 15:51:59 -0800 Subject: [PATCH 05/12] Update files/en-us/web/api/shadowroot/elementfrompoint/index.md Co-authored-by: Hamish Willee --- files/en-us/web/api/shadowroot/elementfrompoint/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/web/api/shadowroot/elementfrompoint/index.md b/files/en-us/web/api/shadowroot/elementfrompoint/index.md index ac7f1d7566977da..b98ed5d4e2c407c 100644 --- a/files/en-us/web/api/shadowroot/elementfrompoint/index.md +++ b/files/en-us/web/api/shadowroot/elementfrompoint/index.md @@ -8,7 +8,7 @@ browser-compat: api.ShadowRoot.elementFromPoint {{APIRef("DOM")}}{{Non-standard_Header}} -The **`elementFromPoint()`** method, available on the {{domxref("ShadowRoot")}} object, returns the element at the topmost shadow root layer at the specified coordinates relative to the viewport. Shadow root elements that have {{cssxref("pointer-events")}} set to `none` are ignored. +The **`elementFromPoint()`** method, available on the {{domxref("ShadowRoot")}} object, returns the element at the topmost shadow root layer at the specified coordinates relative to the viewport (the shadow root highest in the display z-order, that is able to receive pointer events). Shadow root elements that have {{cssxref("pointer-events")}} set to `none` are ignored. If the specified point is outside the bounds of the shadow root, the result is `undefined`. From 2fcc30f28bcbc1a13c8c327be4cf1db1bde732d8 Mon Sep 17 00:00:00 2001 From: Estelle Weyl Date: Thu, 23 Jan 2025 15:52:35 -0800 Subject: [PATCH 06/12] Update files/en-us/web/api/shadowroot/elementsfrompoint/index.md --- files/en-us/web/api/shadowroot/elementsfrompoint/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/web/api/shadowroot/elementsfrompoint/index.md b/files/en-us/web/api/shadowroot/elementsfrompoint/index.md index f4590af75095bdb..e7f579d1d42ff7e 100644 --- a/files/en-us/web/api/shadowroot/elementsfrompoint/index.md +++ b/files/en-us/web/api/shadowroot/elementsfrompoint/index.md @@ -10,7 +10,7 @@ browser-compat: api.ShadowRoot.elementsFromPoint The **`elementsFromPoint()`** method of the {{domxref("ShadowRoot")}} interface returns an array of all the shadow root elements at the specified coordinates (relative to the viewport). The elements are ordered from the element in the topmost layer, to the bottommost element. -It operates in a similar way to the {{domxref("ShadowRoot.elementFromPoint")}} method. Some browsers return only the shadow root elements present at that location. Other browsers include elements outside of the {{glossary("shadow DOM")}}, from the shadow DOM element in the topmost layer to the document root node, such as the {{htmlelement("html")}} or {{SVGElement("svg")}} root element. In these browsers, it operates similar to the {{domxref("Document.elementsFromPoint")}} method, but with the ability to cross the [shadow boundary](/en-US/docs/Glossary/Shadow_tree). +It operates in a similar way to the {{domxref("ShadowRoot.elementFromPoint")}} method. Some browsers return only the shadow root elements present at that location. Other browsers include elements outside of the [shadow DOM](/en-US/docs/Web/API/Web_components/Using_shadow_DOM), from the shadow DOM element in the topmost layer to the document root node, such as the {{htmlelement("html")}} or {{SVGElement("svg")}} root element. In these browsers, it operates similar to the {{domxref("Document.elementsFromPoint")}} method, but with the ability to cross the [shadow boundary](/en-US/docs/Glossary/Shadow_tree). ## Syntax From 79b37390c93bd493aaea450c657ebe07bcfa99aa Mon Sep 17 00:00:00 2001 From: Estelle Weyl Date: Thu, 23 Jan 2025 15:52:58 -0800 Subject: [PATCH 07/12] Update files/en-us/web/api/shadowroot/elementsfrompoint/index.md Co-authored-by: wbamberg --- .../web/api/shadowroot/elementsfrompoint/index.md | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/files/en-us/web/api/shadowroot/elementsfrompoint/index.md b/files/en-us/web/api/shadowroot/elementsfrompoint/index.md index e7f579d1d42ff7e..bd757efa032e407 100644 --- a/files/en-us/web/api/shadowroot/elementsfrompoint/index.md +++ b/files/en-us/web/api/shadowroot/elementsfrompoint/index.md @@ -34,14 +34,8 @@ An array of {{domxref('Element')}} objects. ```js let customElem = document.querySelector("my-custom-element"); let shadow = customElem.shadowRoot; -let msg = ""; -let elements = shadow.elementsFromPoint(20, 20); -elements.forEach((el, i) => { - msg += el.localName; - if (i < elements.length - 1) { - msg += " < "; - } -}); +const elements = shadow.elementsFromPoint(20, 20); +const msg = elements.map(el => el.localName).join(" < "); if (msg) { console.log(msg); } else { From 223b5d26d766a90b04f6ec2c736f20fed9a774a3 Mon Sep 17 00:00:00 2001 From: Estelle Weyl Date: Thu, 23 Jan 2025 15:54:25 -0800 Subject: [PATCH 08/12] Update index.md --- files/en-us/web/api/shadowroot/elementsfrompoint/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/en-us/web/api/shadowroot/elementsfrompoint/index.md b/files/en-us/web/api/shadowroot/elementsfrompoint/index.md index bd757efa032e407..860af724d131afe 100644 --- a/files/en-us/web/api/shadowroot/elementsfrompoint/index.md +++ b/files/en-us/web/api/shadowroot/elementsfrompoint/index.md @@ -21,9 +21,9 @@ elementsFromPoint(x, y) ### Parameters - `x` - - : The horizontal coordinate of a point. + - : The horizontal coordinate of a point, relative to the left edge of the current {{Glossary("viewport")}}. - `y` - - : The vertical coordinate of a point. + - : The vertical coordinate of a point, relative to the top edge of the current viewport. ### Return value From 0014b3f6f1d931b5a2dee33f26795bf96871e0f8 Mon Sep 17 00:00:00 2001 From: Estelle Weyl Date: Thu, 23 Jan 2025 15:54:41 -0800 Subject: [PATCH 09/12] Update files/en-us/web/api/shadowroot/elementsfrompoint/index.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- files/en-us/web/api/shadowroot/elementsfrompoint/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/web/api/shadowroot/elementsfrompoint/index.md b/files/en-us/web/api/shadowroot/elementsfrompoint/index.md index 860af724d131afe..8e752fdb40380a2 100644 --- a/files/en-us/web/api/shadowroot/elementsfrompoint/index.md +++ b/files/en-us/web/api/shadowroot/elementsfrompoint/index.md @@ -35,7 +35,7 @@ An array of {{domxref('Element')}} objects. let customElem = document.querySelector("my-custom-element"); let shadow = customElem.shadowRoot; const elements = shadow.elementsFromPoint(20, 20); -const msg = elements.map(el => el.localName).join(" < "); +const msg = elements.map((el) => el.localName).join(" < "); if (msg) { console.log(msg); } else { From d951c46f5b6052a6e06ad54729b46d85e069bb4f Mon Sep 17 00:00:00 2001 From: Estelle Weyl Date: Fri, 24 Jan 2025 12:28:58 -0800 Subject: [PATCH 10/12] Update files/en-us/web/api/shadowroot/elementsfrompoint/index.md Co-authored-by: Hamish Willee --- files/en-us/web/api/shadowroot/elementsfrompoint/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/web/api/shadowroot/elementsfrompoint/index.md b/files/en-us/web/api/shadowroot/elementsfrompoint/index.md index 8e752fdb40380a2..2c3ff8f6bbdcb3e 100644 --- a/files/en-us/web/api/shadowroot/elementsfrompoint/index.md +++ b/files/en-us/web/api/shadowroot/elementsfrompoint/index.md @@ -8,7 +8,7 @@ browser-compat: api.ShadowRoot.elementsFromPoint {{APIRef("DOM")}}{{Non-standard_Header}} -The **`elementsFromPoint()`** method of the {{domxref("ShadowRoot")}} interface returns an array of all the shadow root elements at the specified coordinates (relative to the viewport). The elements are ordered from the element in the topmost layer, to the bottommost element. +The **`elementsFromPoint()`** method of the {{domxref("ShadowRoot")}} interface returns an array of all the shadow root elements at the specified coordinates (relative to the viewport). The elements are ordered from the topmost element (highest in the display z-order), to the bottommost element. It operates in a similar way to the {{domxref("ShadowRoot.elementFromPoint")}} method. Some browsers return only the shadow root elements present at that location. Other browsers include elements outside of the [shadow DOM](/en-US/docs/Web/API/Web_components/Using_shadow_DOM), from the shadow DOM element in the topmost layer to the document root node, such as the {{htmlelement("html")}} or {{SVGElement("svg")}} root element. In these browsers, it operates similar to the {{domxref("Document.elementsFromPoint")}} method, but with the ability to cross the [shadow boundary](/en-US/docs/Glossary/Shadow_tree). From fc931f2a2f3b39c6c9db7dec3fb8d651d76fb9de Mon Sep 17 00:00:00 2001 From: wbamberg Date: Wed, 29 Jan 2025 10:09:25 -0800 Subject: [PATCH 11/12] Update files/en-us/web/api/shadowroot/elementfrompoint/index.md --- files/en-us/web/api/shadowroot/elementfrompoint/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/web/api/shadowroot/elementfrompoint/index.md b/files/en-us/web/api/shadowroot/elementfrompoint/index.md index b98ed5d4e2c407c..20f3a0a41681b38 100644 --- a/files/en-us/web/api/shadowroot/elementfrompoint/index.md +++ b/files/en-us/web/api/shadowroot/elementfrompoint/index.md @@ -45,7 +45,7 @@ customElements.define( const sRoot = this.attachShadow({ mode: "open" }); sRoot.appendChild(templateContent.cloneNode(true)); - // get the top most Element in the top left corner of the viewport + // get the topmost element in the top left corner of the viewport const srElement = this.shadowRoot.elementFromPoint(0, 0); // apply a border to that element srElement.style.border = "1px dashed red"; From ab29701a381ab85557d1f27285e2b6c56cba94a3 Mon Sep 17 00:00:00 2001 From: wbamberg Date: Wed, 29 Jan 2025 10:11:47 -0800 Subject: [PATCH 12/12] Update files/en-us/web/api/shadowroot/elementsfrompoint/index.md --- files/en-us/web/api/shadowroot/elementsfrompoint/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/en-us/web/api/shadowroot/elementsfrompoint/index.md b/files/en-us/web/api/shadowroot/elementsfrompoint/index.md index 2c3ff8f6bbdcb3e..8e420243de56014 100644 --- a/files/en-us/web/api/shadowroot/elementsfrompoint/index.md +++ b/files/en-us/web/api/shadowroot/elementsfrompoint/index.md @@ -32,8 +32,8 @@ An array of {{domxref('Element')}} objects. ## Examples ```js -let customElem = document.querySelector("my-custom-element"); -let shadow = customElem.shadowRoot; +const customElem = document.querySelector("my-custom-element"); +const shadow = customElem.shadowRoot; const elements = shadow.elementsFromPoint(20, 20); const msg = elements.map((el) => el.localName).join(" < "); if (msg) {