Revision 81ce07e8bb1c1f692944a32cdf8a271aa40acede authored by Morten Stenshorne on 10 April 2018, 10:57:45 UTC, committed by Chromium WPT Sync on 10 April 2018, 10:57:45 UTC
We used to rely on this taking place lazily via MinPreferredLogicalWidth(), but that method won't necessarily be called if the table is a flex/grid item. Bug: 810327 Change-Id: Ic817bd109544d4b9e961552d0a3a38f127e6e548 Reviewed-on: https://chromium-review.googlesource.com/1000781 Commit-Queue: Morten Stenshorne <mstensho@chromium.org> Reviewed-by: David Grogan <dgrogan@chromium.org> Reviewed-by: Christian Biesinger <cbiesinger@chromium.org> Cr-Commit-Position: refs/heads/master@{#549479}
1 parent 429e62e
po-observe.html
<!DOCTYPE HTML>
<meta charset=utf-8>
<title>PerformanceObservers: PerformanceObserverInit.buffered</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="performanceobservers.js"></script>
<h1>PerformanceObservers: PerformanceObserverInit.buffered</h1>
<p>
PerformanceObserverInit.buffered should retrieve previously buffered entries
</p>
<div id="log"></div>
<script>
async_test(function (t) {
function initTest() {
new PerformanceObserver(function (entryList, observer) {
entryList.getEntries().forEach(function(entry) {
if (shouldExclude(entry)) {
return;
}
observedEntries.push(entry);
if (observedEntries.length === entryTypes.length) {
observer.disconnect();
runTest();
}
});
}).observe({entryTypes});
// creates a `resource` entry
var img = document.createElement("img");
img.src = "./resources/square.png";
document.body.appendChild(img);
performance.mark("markName"); // creates a `mark` entry
performance.measure("measureName"); // creates a `measure` entry
}
function shouldExclude(entry) {
// exclude all `resource` entries that aren't for "square.png"
return entry.entryType === "resource" &&
entry.name.indexOf("square.png") === -1;
}
function runTest() {
// this PerformanceObserver is a nop because we've already been notified about all of our `entryTypes`
var po_nop = new PerformanceObserver(function (entryList, observer) {
if (entryList.getEntries().find(function(entry) {
return !shouldExclude(entry);
})) {
assert_unreached("this PerformanceObserver callback should never be called");
}
});
po_nop.observe({
entryTypes,
buffered: false
});
// this PerformanceObserver should be notified about the previously buffered entries
const bufferedEntries = [];
new PerformanceObserver(function (entryList, observer) {
entryList.getEntries().forEach(function(entry) {
if (shouldExclude(entry)) {
return;
}
bufferedEntries.push(entry);
if (bufferedEntries.length === entryTypes.length) {
observer.disconnect();
po_nop.disconnect();
checkEntries(bufferedEntries, observedEntries);
t.done();
}
});
}).observe({
entryTypes,
buffered: true
});
}
const entryTypes = ["navigation", "resource", "mark", "measure"];
const observedEntries = [];
initTest();
}, "PerformanceObserverInit.buffered should retrieve previously buffered entries");
</script>
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...