Bug 1579783 [wpt PR 18922] - Remove dcheck for connected-ness in shadowRoot.elementsFromPoint, a=testonly
authorRakina Zata Amni <rakina@chromium.org>
Fri, 13 Sep 2019 10:32:53 +0000
changeset 554534 f81db294f97192d0ed80135af397129ca2809333
parent 554533 f56389cee0770f2f09c38585d494490e24f156d2
child 554535 c2b30176c31b2ab130558fba7ac99319a60f9942
push id12169
push userffxbld-merge
push dateMon, 14 Oct 2019 16:59:29 +0000
treeherdermozilla-beta@c819687300ed [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1579783, 18922, 999874, 1792203, 694666
milestone71.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1579783 [wpt PR 18922] - Remove dcheck for connected-ness in shadowRoot.elementsFromPoint, a=testonly Automatic update from web-platform-tests Remove dcheck for connected-ness in shadowRoot.elementsFromPoint This causes failing dchecks if we call on an unconnected shadowroot, which turns out to be allowed! Bug: 999874 Change-Id: Iecaa3786817cacaf4ffb02809c44a0c104fcdb6e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1792203 Commit-Queue: Rakina Zata Amni <rakina@chromium.org> Reviewed-by: Kent Tamura <tkent@chromium.org> Cr-Commit-Position: refs/heads/master@{#694666} -- wpt-commits: 2c64b0a15e26c1e8b576806d366917c8a5f7629b wpt-pr: 18922
testing/web-platform/tests/shadow-dom/DocumentOrShadowRoot-prototype-elementFromPoint.html
--- a/testing/web-platform/tests/shadow-dom/DocumentOrShadowRoot-prototype-elementFromPoint.html
+++ b/testing/web-platform/tests/shadow-dom/DocumentOrShadowRoot-prototype-elementFromPoint.html
@@ -245,12 +245,35 @@ test(function () {
   document.documentElement.style = 'background-attachment: scroll; height: 2px;';
   let boundingRect = host.getBoundingClientRect();
   assert_array_equals(document.elementsFromPoint(boundingRect.x, boundingRect.y), [host, aboveHost, container, document.body, document.documentElement]);
   assert_array_equals(shadow.elementsFromPoint(boundingRect.x, boundingRect.y), [host, aboveHost, container, document.body, document.documentElement]);
 }, 'shadowRoot.elementsFromPoint must behave the same with document.elementsFromPoint regarding HTML element');
 
 container.innerHTML = '';
 
-    </script>
-  </body>
+test(function(t) {
+  const container = document.createElement("div");
+  const span = document.createElement("span");
+  span.innerText = "foo";
+  document.body.appendChild(container);
+  container.appendChild(span);
+
+  let elements = document.elementsFromPoint(...pointInElement(span));
+  assert_equals(elements.length, 4);
+  assert_equals(elements[0], span);
+  assert_equals(elements[1], container);
+  assert_equals(elements[2].nodeName, 'BODY');
+  assert_equals(elements[3].nodeName, 'HTML');
+
+  const host = document.createElement("div");
+  const shadowRoot = host.attachShadow({ mode: "open" });
+  elements = shadowRoot.elementsFromPoint(...pointInElement(span));
+  assert_equals(elements.length, 4);
+  assert_equals(elements[0], span);
+  assert_equals(elements[1], container);
+  assert_equals(elements[2].nodeName, 'BODY');
+  assert_equals(elements[3].nodeName, 'HTML');
+}, "elementsFromPoint should return all elements under a point, even when context object is not connected");
+</script>
+</body>
 </html>