Automatic update from web-platform-tests
[event-timing] Early Interaction ID assignment, and less UKM buffering.
This patch refactors the architectural model for Interaction ID
assignment and metrics reporting to be more robust, performant, and
aligned with the Performance Timeline specification.
The major changes include:
1. Removing Renderer-side UKM Buffering: Previously, the renderer
buffered Event Timing data to identify and report only the single
longest event per interaction ("max event duration"). We now report
every part of every interaction to the browser. The Browser's
PageLoadMetricsObserver (PLMO) is now responsible for assembling these
parts. This drastically simplifies the renderer logic by removing
complex data structures, copies, timers, and flushing logic. This change
in reporting granularity was reviewed and accepted by the Chrome
Guardrail Council.
(Note: the PLMO infra was updated earlier to expect this change, without
any effect on PageLoad UKM: https://crrev.com/c/7551230).
2. Early Interaction ID Assignment: Interaction IDs are now assigned as
the first step of event timing (at processingStart), before the event is
even processed. This decouples the interaction state machine from
asynchronous presentationTime measurements. By assigning IDs based on
the order of event dispatch rather than the order of measurement
resolution, we eliminate out-of-order reporting and "orphaned" events
caused by fallback times (e.g., context menus, visibility changes) or
out-of-order presentation feedback.
3. Synchronous Event Queuing: While we still may need to wait for a
"pending pointerdown" to determine an interaction ID, we now hold back
the event queue to ensure all events are flushed in their original order
once all interaction IDs are known.
Bug: 328902994, 350934029
Change-Id: I816d31d72a019045d1cf1111b16407496a6a6964
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7596544
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Michal Mocny <mmocny@chromium.org>
Reviewed-by: Scott Haseley <shaseley@chromium.org>
Reviewed-by: Johannes Henkel <johannes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1591277}
--
wpt-commits: 4c4e1f2c3c9f95688f02298ddb33fdc79af17489
wpt-pr: 58087
110 lines
3.7 KiB
HTML
110 lines
3.7 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<meta charset=utf-8 />
|
|
<title></title>
|
|
<style>
|
|
#targetDiv {
|
|
width: 200px;
|
|
height: 200px;
|
|
overflow: scroll;
|
|
}
|
|
|
|
#innerDiv {
|
|
width: 4000px;
|
|
height: 4000px;
|
|
}
|
|
</style>
|
|
<body style="margin:0">
|
|
<div id="targetDiv">
|
|
<div id="innerDiv">
|
|
<p>Test test test test test test...</p>
|
|
<p>Test test test test test test...</p>
|
|
<p>Test test test test test test...</p>
|
|
<p>Test test test test test test...</p>
|
|
<p>Test test test test test test...</p>
|
|
<p>Test test test test test test...</p>
|
|
<p>Test test test test test test...</p>
|
|
<p>Test test test test test test...</p>
|
|
<p>Test test test test test test...</p>
|
|
<p>Test test test test test test...</p>
|
|
<p>Test test test test test test...</p>
|
|
<p>Test test test test test test...</p>
|
|
<p>Test test test test test test...</p>
|
|
<p>Test test test test test test...</p>
|
|
<p>Test test test test test test...</p>
|
|
<p>Test test test test test test...</p>
|
|
<p>Test test test test test test...</p>
|
|
<p>Test test test test test test...</p>
|
|
<p>Test test test test test test...</p>
|
|
<p>Test test test test test test...</p>
|
|
<p>Test test test test test test...</p>
|
|
<p>Test test test test test test...</p>
|
|
<p>Test test test test test test...</p>
|
|
<p>Test test test test test test...</p>
|
|
<p>Test test test test test test...</p>
|
|
</div>
|
|
</div>
|
|
<script src=/resources/testharness.js></script>
|
|
<script src=/resources/testharnessreport.js></script>
|
|
<script src=/resources/testdriver.js></script>
|
|
<script src=/resources/testdriver-actions.js></script>
|
|
<script src=/resources/testdriver-vendor.js></script>
|
|
<script src=resources/event-timing-test-utils.js></script>
|
|
<script>
|
|
|
|
function validateEntries(entries) {
|
|
assert_equals(entries.length, 2, "two pointer entries should be received");
|
|
let entry = entries[0];
|
|
assert_equals(entry.name, 'pointerdown');
|
|
assert_greater_than(entry.interactionId, 0);
|
|
entry = entries[1];
|
|
assert_equals(entry.name, 'pointerup');
|
|
// The pointerup event is connected with an active autoscroll,
|
|
// and therefore does not have an interaction id.
|
|
assert_equals(entry.interactionId, 0);
|
|
}
|
|
|
|
promise_test(async t => {
|
|
assert_implements(window.PerformanceEventTiming, 'Event Timing is not supported.');
|
|
// Skip the test on a Mac as they do not support touch screens.
|
|
const isMac = navigator.platform.toUpperCase().indexOf('MAC')>=0;
|
|
if (isMac)
|
|
return;
|
|
|
|
// Wait for load event so we can interact on the page.
|
|
if (document.readyState !== 'complete') {
|
|
await new Promise(resolve => {
|
|
window.addEventListener('load', resolve);
|
|
});
|
|
}
|
|
|
|
let observedEntries = [];
|
|
const observerPromise = new Promise(resolve => {
|
|
let pointerdown_count = 0;
|
|
new PerformanceObserver(entryList => {
|
|
entryList.getEntries().forEach(e => {
|
|
if(e.name.includes('pointerdown')) {
|
|
pointerdown_count += 1;
|
|
observedEntries.push(e);
|
|
}
|
|
if(e.name.includes('pointerup')) {
|
|
pointerdown_count += 1;
|
|
observedEntries.push(e);
|
|
}
|
|
if(pointerdown_count == 2){
|
|
resolve(observedEntries);
|
|
}
|
|
});
|
|
}).observe({type: 'event',
|
|
durationThreshold: 0,
|
|
buffered: true});
|
|
})
|
|
|
|
const target = document.getElementById('targetDiv');
|
|
await interactAndObserve('selection-scroll', target, observerPromise);
|
|
validateEntries(observedEntries);
|
|
}, "Event Timing: test that the events received in PerformanceObserver during an active text selection autoscroll does not have interaction id.");
|
|
</script>
|
|
</body>
|
|
</html>
|