Skip to content

Commit

Permalink
Bug 1553250 [wpt PR 16939] - [ElementTiming] Do not expose elements i…
Browse files Browse the repository at this point in the history
…n Shadow Trees, a=testonly

Automatic update from web-platform-tests
[ElementTiming] Do not expose elements in Shadow Trees

We initially exposed these elements but this seems to break design
invariants. It is still unclear what we can do with elements in shadow
trees, but for now it is safest to not expose them at all.

Relevant threads:
WICG/element-timing#3
WICG/webcomponents#816

Bug: 879270
Change-Id: Id4c0d65e0f0e086c6c6dfa29cc019a4c1ef6ab1f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1622470
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#662391}

--

wp5At-commits: 6272cd07e39bf7c67f58f30db41568033355b1dd
wpt-pr: 16939
  • Loading branch information
npm1 authored and jgraham committed Jun 19, 2019
1 parent deb99ce commit 7a2e249
Showing 1 changed file with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE HTML>
<meta charset=utf-8>
<title>Element Timing: observe image in shadow tree</title>
<title>Element Timing: do not observe image in shadow tree</title>
<style>
body {
margin: 0;
Expand All @@ -19,13 +19,7 @@
}
const observer = new PerformanceObserver(
t.step_func_done(function(entryList) {
assert_equals(entryList.getEntries().length, 1);
const entry = entryList.getEntries()[0];
const pathname = window.location.origin + '/element-timing/resources/square100.png';
checkElement(entry, pathname, 'my_image', 'my_id', beforeRender, img);
// Assume viewport has size at least 100, so the element is fully visible.
checkRect(entry, [0, 100, 0, 100]);
checkNaturalSize(entry, 100, 100);
assert_unreached('Should not observe elements in shadow trees!');
})
);
observer.observe({entryTypes: ['element']});
Expand All @@ -40,6 +34,10 @@
const shadowRoot = document.getElementById('target').attachShadow({mode: 'closed'});
shadowRoot.appendChild(img);
beforeRender = performance.now();
t.step_timeout(() => {
// Assume entry was not dispatched, so test passes.
t.done();
}, 500);
};
}, 'Image in shadow tree with elementtiming attribute is observable.');
}, 'Image in shadow tree with elementtiming attribute is not observable.');
</script>

0 comments on commit 7a2e249

Please sign in to comment.