diff --git a/LayoutTests/TestExpectations b/LayoutTests/TestExpectations index 3244e483fa1f8..c9ec1396c329f 100644 --- a/LayoutTests/TestExpectations +++ b/LayoutTests/TestExpectations @@ -1377,32 +1377,29 @@ imported/w3c/web-platform-tests/resource-timing/fetch-cross-origin-redirect.http # Flaky timing tests: webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/click-timing.html [ Pass Failure ] +webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/crossiframe.html [ Pass Failure ] +webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/interactionid-click.html [ Pass Failure ] webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/timingconditions.html [ Pass Failure ] -# Requires interactionId: -webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/crossiframe.html [ Skip ] -webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/first-input-interactionid-click.html [ Skip ] -webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/first-input-interactionid-key.html [ Skip ] -webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/first-input-interactionid-tap.html [ Skip ] -webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/interactionid-aux-pointerdown.html [ Skip ] +# Timing out (missing auxclick automation?): webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/interactionid-aux-pointerdown-and-pointerdown.html [ Skip ] -webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/interactionid-auxclick.html [ Skip ] -webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/interactionid-click.html [ Skip ] -webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/interactionid-keyboard-event-simulated-click-checkbox-space.html [ Skip ] -webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/interactionid-keyboard-event-simulated-click-link-enter.html [ Skip ] -webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/interactionid-keyboard-event-simulated-click-button-space.html [ Skip ] -webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/interactionid-keypress.html [ Skip ] -webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/interactionid-orphan-pointerup.html [ Skip ] -webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/interactionid-press-key-as-input.html [ Skip ] -webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/interactionid-press-key-no-effect.html [ Skip ] -webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/interactionid-tap.html [ Skip ] -webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/retrieve-firstInput.html [ Skip ] +webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/interactionid-aux-pointerdown.html [ Skip ] + +# Fail on local machine, pass on EWS. Probably flaky timing: +webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/interactionid-keyboard-event-simulated-click-checkbox-space.html [ Pass Failure ] +webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/interactionid-keyboard-event-simulated-click-link-enter.html [ Pass Failure ] +webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/interactionid-keyboard-event-simulated-click-button-space.html [ Pass Failure ] # No browser passes, test is likely outdated: webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/modal-dialog-interrupt-paint.html [ Skip ] webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/TapToStopFling.html [ Skip ] -# Problems with event automation: +# Missing tap automation, times out: +webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/interactionid-tap.html [ Skip ] +webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/interaction-count-tap.html [ Skip ] +webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/first-input-interactionid-tap.html [ Skip ] + +# Missing automation: webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/event-click-visibilitychange.html [ Skip ] webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/selection-autoscroll.html [ Skip ] diff --git a/LayoutTests/imported/w3c/web-platform-tests/event-timing/crossiframe-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/event-timing/crossiframe-expected.txt index 6341db1ffce34..3ae524cf8cfec 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/event-timing/crossiframe-expected.txt +++ b/LayoutTests/imported/w3c/web-platform-tests/event-timing/crossiframe-expected.txt @@ -1,4 +1,4 @@ Generate a 'click' event -FAIL Event Timing: entries should only be observable by its own frame. assert_equals: There should be a single first-input entry expected 1 but got 0 +PASS Event Timing: entries should only be observable by its own frame. diff --git a/LayoutTests/imported/w3c/web-platform-tests/event-timing/disconnect-target-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/event-timing/disconnect-target-expected.txt index bc28f2dbf9320..60d62fa87b3e5 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/event-timing/disconnect-target-expected.txt +++ b/LayoutTests/imported/w3c/web-platform-tests/event-timing/disconnect-target-expected.txt @@ -1,4 +1,3 @@ -ClickMe -FAIL Event Timing: when target is disconnected, entry.target returns null. assert_equals: There should be a single first-input entry expected 1 but got 0 +PASS Event Timing: when target is disconnected, entry.target returns null. diff --git a/LayoutTests/imported/w3c/web-platform-tests/event-timing/event-click-visibilitychange-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/event-timing/event-click-visibilitychange-expected.txt index 0267a379e095c..835a1e2fafec1 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/event-timing/event-click-visibilitychange-expected.txt +++ b/LayoutTests/imported/w3c/web-platform-tests/event-timing/event-click-visibilitychange-expected.txt @@ -1,4 +1,6 @@ Click me -FAIL Event handlers which change visibility should not measure next paint. assert_implements: Event Timing is not supported. undefined +Harness Error (TIMEOUT), message = null + +TIMEOUT Event handlers which change visibility should not measure next paint. Test timed out diff --git a/LayoutTests/imported/w3c/web-platform-tests/event-timing/event-retarget-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/event-timing/event-retarget-expected.txt index 6cc91022b4653..164b3648f5779 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/event-timing/event-retarget-expected.txt +++ b/LayoutTests/imported/w3c/web-platform-tests/event-timing/event-retarget-expected.txt @@ -1,3 +1,3 @@ -FAIL Event Timing: target reports the last Event Target, i.e. nothing from shadow DOM. assert_equals: There should be a single first-input entry expected 1 but got 0 +PASS Event Timing: target reports the last Event Target, i.e. nothing from shadow DOM. diff --git a/LayoutTests/imported/w3c/web-platform-tests/event-timing/first-input-interactionid-click-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/event-timing/first-input-interactionid-click-expected.txt index 9bd09dcc610d5..15386ffbdfe7d 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/event-timing/first-input-interactionid-click-expected.txt +++ b/LayoutTests/imported/w3c/web-platform-tests/event-timing/first-input-interactionid-click-expected.txt @@ -1,4 +1,4 @@ Click me -FAIL The interactionId of the first input entry should match the same pointerdown entry of event timing when click. assert_implements: Event Timing is not supported. undefined +PASS The interactionId of the first input entry should match the same pointerdown entry of event timing when click. diff --git a/LayoutTests/imported/w3c/web-platform-tests/event-timing/first-input-interactionid-key-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/event-timing/first-input-interactionid-key-expected.txt index 9b8ed70457c0a..d54592e6deac6 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/event-timing/first-input-interactionid-key-expected.txt +++ b/LayoutTests/imported/w3c/web-platform-tests/event-timing/first-input-interactionid-key-expected.txt @@ -1,4 +1,4 @@ -FAIL The interactionId of the first input entry should match the same keydown entry of event timing when press a key. assert_implements: Event Timing is not supported. undefined +PASS The interactionId of the first input entry should match the same keydown entry of event timing when press a key. diff --git a/LayoutTests/imported/w3c/web-platform-tests/event-timing/first-input-shadow-dom-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/event-timing/first-input-shadow-dom-expected.txt index 27e992c92ed2b..fa85bd09128cc 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/event-timing/first-input-shadow-dom-expected.txt +++ b/LayoutTests/imported/w3c/web-platform-tests/event-timing/first-input-shadow-dom-expected.txt @@ -1,3 +1,3 @@ -FAIL Event Timing: test first input on shadow DOM. assert_equals: expected Element node but got Element node +PASS Event Timing: test first input on shadow DOM. diff --git a/LayoutTests/imported/w3c/web-platform-tests/event-timing/interaction-count-click-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/event-timing/interaction-count-click-expected.txt index 8463f79146c4b..d2843ffc3c5d0 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/event-timing/interaction-count-click-expected.txt +++ b/LayoutTests/imported/w3c/web-platform-tests/event-timing/interaction-count-click-expected.txt @@ -1,5 +1,5 @@ Click me Click me -FAIL EventTiming: verify interactionCount for click interaction step_wait_func: interactionCount did not increase enough Timed out waiting on condition +PASS EventTiming: verify interactionCount for click interaction diff --git a/LayoutTests/imported/w3c/web-platform-tests/event-timing/interaction-count-press-key-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/event-timing/interaction-count-press-key-expected.txt index 4c81c4ab78b19..d31b6fd65122a 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/event-timing/interaction-count-press-key-expected.txt +++ b/LayoutTests/imported/w3c/web-platform-tests/event-timing/interaction-count-press-key-expected.txt @@ -1,4 +1,4 @@ -FAIL EventTiming: verify interactionCount for key interaction step_wait_func: interactionCount did not increase enough Timed out waiting on condition +PASS EventTiming: verify interactionCount for key interaction diff --git a/LayoutTests/imported/w3c/web-platform-tests/event-timing/interactionid-auxclick-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/event-timing/interactionid-auxclick-expected.txt index d9715f160e424..0d314d8cf933f 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/event-timing/interactionid-auxclick-expected.txt +++ b/LayoutTests/imported/w3c/web-platform-tests/event-timing/interactionid-auxclick-expected.txt @@ -1,4 +1,4 @@ Right click me to bring up OS level contextmenu popup. -FAIL Event Timing: verify pointerdown & pointerup reporting for mouse aux click triggered contextmenu. assert_implements: Event Timing is not supported. undefined +PASS Event Timing: verify pointerdown & pointerup reporting for mouse aux click triggered contextmenu. diff --git a/LayoutTests/imported/w3c/web-platform-tests/event-timing/interactionid-click-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/event-timing/interactionid-click-expected.txt index e495595fd9192..ec29ca9f25cb7 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/event-timing/interactionid-click-expected.txt +++ b/LayoutTests/imported/w3c/web-platform-tests/event-timing/interactionid-click-expected.txt @@ -1,4 +1,4 @@ Click me. -FAIL Event Timing: compare event timing interactionId. assert_implements: Event Timing is not supported. undefined +PASS Event Timing: compare event timing interactionId. diff --git a/LayoutTests/imported/w3c/web-platform-tests/event-timing/interactionid-keyboard-event-simulated-click-button-space-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/event-timing/interactionid-keyboard-event-simulated-click-button-space-expected.txt index eaeaa08523121..dd6c744ff71cb 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/event-timing/interactionid-keyboard-event-simulated-click-button-space-expected.txt +++ b/LayoutTests/imported/w3c/web-platform-tests/event-timing/interactionid-keyboard-event-simulated-click-button-space-expected.txt @@ -1,6 +1,4 @@ Click me. -Harness Error (TIMEOUT), message = null - -TIMEOUT Click event triggered by space key in checkbox should have the same interaction id as that of the associated keyboard events. Test timed out +FAIL Click event triggered by space key in checkbox should have the same interaction id as that of the associated keyboard events. assert_equals: Click event should have the same interaction id as the keydown event. expected 1002 but got 0 diff --git a/LayoutTests/imported/w3c/web-platform-tests/event-timing/interactionid-keyboard-event-simulated-click-checkbox-space-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/event-timing/interactionid-keyboard-event-simulated-click-checkbox-space-expected.txt index 7fcdb4b03c618..0d0f17bd3f90c 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/event-timing/interactionid-keyboard-event-simulated-click-checkbox-space-expected.txt +++ b/LayoutTests/imported/w3c/web-platform-tests/event-timing/interactionid-keyboard-event-simulated-click-checkbox-space-expected.txt @@ -1,6 +1,4 @@ -Harness Error (TIMEOUT), message = null - -TIMEOUT Click event triggered by space key in checkbox should have the same interaction id as that of the associated keyboard events. Test timed out +FAIL Click event triggered by space key in checkbox should have the same interaction id as that of the associated keyboard events. assert_equals: Click event should have the same interaction id as the keydown event. expected 1002 but got 0 diff --git a/LayoutTests/imported/w3c/web-platform-tests/event-timing/interactionid-keyboard-event-simulated-click-link-enter-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/event-timing/interactionid-keyboard-event-simulated-click-link-enter-expected.txt index e0e4c2f6c45cb..46ee0e746df1a 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/event-timing/interactionid-keyboard-event-simulated-click-link-enter-expected.txt +++ b/LayoutTests/imported/w3c/web-platform-tests/event-timing/interactionid-keyboard-event-simulated-click-link-enter-expected.txt @@ -1,5 +1,3 @@ -Harness Error (TIMEOUT), message = null - -TIMEOUT Click event triggered by space key in checkbox should have the same interaction id as that of the associated keyboard events. Test timed out +FAIL Click event triggered by space key in checkbox should have the same interaction id as that of the associated keyboard events. assert_equals: Click event should have the same interaction id as the keydown event. expected 1002 but got 0 diff --git a/LayoutTests/imported/w3c/web-platform-tests/event-timing/interactionid-keypress-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/event-timing/interactionid-keypress-expected.txt index ab0b910e5e3a2..d985adeb69b83 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/event-timing/interactionid-keypress-expected.txt +++ b/LayoutTests/imported/w3c/web-platform-tests/event-timing/interactionid-keypress-expected.txt @@ -1,4 +1,4 @@ -FAIL Event Timing: compare event timing interactionId for keypress. assert_implements: Event Timing is not supported. undefined +FAIL Event Timing: compare event timing interactionId for keypress. assert_greater_than: Should have a non-trivial interactionId expected a number greater than 0 but got 0 diff --git a/LayoutTests/imported/w3c/web-platform-tests/event-timing/interactionid-orphan-pointerup-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/event-timing/interactionid-orphan-pointerup-expected.txt index 9266397d43a67..a822ee1c7e4fd 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/event-timing/interactionid-orphan-pointerup-expected.txt +++ b/LayoutTests/imported/w3c/web-platform-tests/event-timing/interactionid-orphan-pointerup-expected.txt @@ -1,4 +1,4 @@ Orphan Pointerup -FAIL Event Timing: Orphan pointerup should not be measured as an interaction. assert_implements: Event Timing is not supported. undefined +PASS Event Timing: Orphan pointerup should not be measured as an interaction. diff --git a/LayoutTests/imported/w3c/web-platform-tests/event-timing/interactionid-press-key-as-input-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/event-timing/interactionid-press-key-as-input-expected.txt index db3c80d269fcb..b670a3a4bd9e9 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/event-timing/interactionid-press-key-as-input-expected.txt +++ b/LayoutTests/imported/w3c/web-platform-tests/event-timing/interactionid-press-key-as-input-expected.txt @@ -1,4 +1,4 @@ -FAIL Event Timing: compare event timing interactionId for key press as input. assert_implements: Event Timing is not supported. undefined +PASS Event Timing: compare event timing interactionId for key press as input. diff --git a/LayoutTests/imported/w3c/web-platform-tests/event-timing/interactionid-press-key-no-effect-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/event-timing/interactionid-press-key-no-effect-expected.txt index 136b570358917..bac7dec3f7c2e 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/event-timing/interactionid-press-key-no-effect-expected.txt +++ b/LayoutTests/imported/w3c/web-platform-tests/event-timing/interactionid-press-key-no-effect-expected.txt @@ -1,5 +1,5 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec tempus lacinia nisi, eget tempor orci. Nullam congue pharetra arcu, et consectetur massa mollis tincidunt. Quisque odio sapien, viverra finibus lectus ac, consectetur ornare quam. In hac habitasse platea dictumst. Morbi cursus est odio, non fermentum ligula posuere vitae. Sed ullamcorper convallis rhoncus. In condimentum neque nec metus hendrerit, et cursus ipsum aliquet. -FAIL Event Timing: compare event timing interactionId for key press with no effect. assert_implements: Event Timing is not supported. undefined +PASS Event Timing: compare event timing interactionId for key press with no effect. diff --git a/LayoutTests/imported/w3c/web-platform-tests/event-timing/only-observe-firstInput-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/event-timing/only-observe-firstInput-expected.txt index ef5522a5bad6e..df30f81c418ae 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/event-timing/only-observe-firstInput-expected.txt +++ b/LayoutTests/imported/w3c/web-platform-tests/event-timing/only-observe-firstInput-expected.txt @@ -1,4 +1,4 @@ Generate a 'click' event -FAIL Event Timing: check first-input for a PerformanceObserver observing only first-input. assert_equals: expected 1 but got 0 +PASS Event Timing: check first-input for a PerformanceObserver observing only first-input. diff --git a/LayoutTests/imported/w3c/web-platform-tests/event-timing/programmatic-click-not-observed-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/event-timing/programmatic-click-not-observed-expected.txt index 3dec5bf1fb24d..9eea2f49b7acd 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/event-timing/programmatic-click-not-observed-expected.txt +++ b/LayoutTests/imported/w3c/web-platform-tests/event-timing/programmatic-click-not-observed-expected.txt @@ -1,5 +1,5 @@ Click me No, click me! -FAIL Event Timing: events from programmatic click are not observed assert_equals: There should be a single first-input entry expected 1 but got 0 +PASS Event Timing: events from programmatic click are not observed diff --git a/LayoutTests/imported/w3c/web-platform-tests/event-timing/retrieve-firstInput-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/event-timing/retrieve-firstInput-expected.txt index 77658ba451db1..7981cba04f227 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/event-timing/retrieve-firstInput-expected.txt +++ b/LayoutTests/imported/w3c/web-platform-tests/event-timing/retrieve-firstInput-expected.txt @@ -1,4 +1,4 @@ Generate a 'click' event -FAIL Event Timing: check first-input after onload, observer, click, click. assert_implements: Event Timing is not supported. undefined +PASS Event Timing: check first-input after onload, observer, click, click. diff --git a/LayoutTests/platform/gtk/TestExpectations b/LayoutTests/platform/gtk/TestExpectations index 249ca6aaf198b..37a178b763108 100644 --- a/LayoutTests/platform/gtk/TestExpectations +++ b/LayoutTests/platform/gtk/TestExpectations @@ -99,7 +99,11 @@ webkit.org/b/290522 imported/w3c/web-platform-tests/html/canvas/offscreen/manual webkit.org/b/285993 imported/w3c/web-platform-tests/html/canvas/offscreen/manual/text/canvas.2d.offscreen.worker.lang.html [ ImageOnlyFailure Crash ] webkit.org/b/285993 imported/w3c/web-platform-tests/html/canvas/offscreen/manual/text/canvas.2d.offscreen.worker.lang.inherit.html [ ImageOnlyFailure Crash ] +# Times out, possibly missing automation: +webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/interactionid-auxclick.html [ Skip ] + # Crash mentioning WTR::UIScriptController::notImplemented() with the EventTimingEnabled feature flag +webkit.org/b/296246 imported/w3c/web-platform-tests/event-timing/first-input-interactionid-key.html [ Crash ] webkit.org/b/296246 imported/w3c/web-platform-tests/event-timing/interaction-count-tap.html [ Crash ] webkit.org/b/296246 imported/w3c/web-platform-tests/event-timing/TapToStopFling.html [ Crash ] diff --git a/LayoutTests/platform/ios/TestExpectations b/LayoutTests/platform/ios/TestExpectations index 94086399125df..760be5ffc0994 100644 --- a/LayoutTests/platform/ios/TestExpectations +++ b/LayoutTests/platform/ios/TestExpectations @@ -4497,11 +4497,22 @@ webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/buffered-flag.h webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/click-timing.html [ Skip ] webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/click.html [ Skip ] webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/contextmenu.html [ Skip ] +webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/crossiframe.html [ Skip ] webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/dblclick.html [ Skip ] webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/disconnect-target.html [ Skip ] webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/duration-with-target-low.html [ Skip ] webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/event-retarget.html [ Skip ] +webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/first-input-interactionid-click.html [ Skip ] +webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/first-input-interactionid-key.html [ Skip ] webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/first-input-shadow-dom.html [ Skip ] +webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/interaction-count-click.html [ Skip ] +webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/interaction-count-press-key.html [ Skip ] +webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/interactionid-auxclick.html [ Skip ] +webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/interactionid-click.html [ Skip ] +webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/interactionid-keypress.html [ Skip ] +webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/interactionid-orphan-pointerup.html [ Skip ] +webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/interactionid-press-key-as-input.html [ Skip ] +webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/interactionid-press-key-no-effect.html [ Skip ] webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/keydown.html [ Skip ] webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/keyup.html [ Skip ] webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/large-duration-threshold.html [ Skip ] @@ -4521,6 +4532,7 @@ webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/pointerover.htm webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/pointerup.html [ Skip ] webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/programmatic-click-not-observed.html [ Skip ] webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/retrievability.html [ Skip ] +webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/retrieve-firstInput.html [ Skip ] webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/shadow-dom-null-target.html [ Skip ] webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/toJSON.html [ Skip ] diff --git a/LayoutTests/platform/mac-wk1/TestExpectations b/LayoutTests/platform/mac-wk1/TestExpectations index bb35673a295de..6afeffee729b4 100644 --- a/LayoutTests/platform/mac-wk1/TestExpectations +++ b/LayoutTests/platform/mac-wk1/TestExpectations @@ -867,6 +867,7 @@ imported/w3c/web-platform-tests/webtransport/ [ Skip ] # Event timing: times out, missing automation webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/contextmenu.html [ Skip ] +webkit.org/b/214677 imported/w3c/web-platform-tests/event-timing/interactionid-orphan-pointerup.html [ Skip ] # WebKitLegacy doesn't support https-based WPT webkit.org/b/246719 imported/w3c/web-platform-tests/reporting/generateTestReport-honors-endpoint.https.sub.html [ Failure ] diff --git a/LayoutTests/platform/win/TestExpectations b/LayoutTests/platform/win/TestExpectations index dfc9d68be039a..a3f1080817f84 100644 --- a/LayoutTests/platform/win/TestExpectations +++ b/LayoutTests/platform/win/TestExpectations @@ -1977,6 +1977,14 @@ imported/w3c/web-platform-tests/event-timing/interaction-count-tap.html [ Crash imported/w3c/web-platform-tests/event-timing/interaction-count-click.html [ Skip ] imported/w3c/web-platform-tests/event-timing/interaction-count-press-key.html [ Skip ] +# Timeout: +imported/w3c/web-platform-tests/event-timing/interactionid-orphan-pointerup.html [ Skip ] + +# Fail with AccessDeniedAccess +imported/w3c/web-platform-tests/event-timing/contextmenu.html [ Skip ] +imported/w3c/web-platform-tests/event-timing/interactionid-auxclick.html [ Skip ] +imported/w3c/web-platform-tests/event-timing/first-input-interactionid-key.html [ Skip ] + compositing/video [ Skip ] editing/pasteboard [ Skip ] fast/attachment [ Skip ] diff --git a/LayoutTests/platform/wpe/TestExpectations b/LayoutTests/platform/wpe/TestExpectations index d032fbdcac8ea..2f50a6d6c2ce9 100644 --- a/LayoutTests/platform/wpe/TestExpectations +++ b/LayoutTests/platform/wpe/TestExpectations @@ -567,9 +567,10 @@ webkit.org/b/244186 imported/w3c/web-platform-tests/dom/events/non-cancelable-wh webkit.org/b/286930 media/modern-media-controls/scrubber-support/scrubber-support-seek-back.html [ Crash ] -# Crash mentioning WTR::UIScriptController::notImplemented() with the EventTimingEnabled feature flag -webkit.org/b/244186 imported/w3c/web-platform-tests/event-timing/TapToStopFling.html [ Crash ] +# Crashes with WTR::UIScriptController::notImplemented(): +webkit.org/b/296246 imported/w3c/web-platform-tests/event-timing/first-input-interactionid-key.html [ Crash ] webkit.org/b/244186 imported/w3c/web-platform-tests/event-timing/interaction-count-tap.html [ Crash ] +webkit.org/b/244186 imported/w3c/web-platform-tests/event-timing/TapToStopFling.html [ Crash ] # Event timing: times out, probably missing automation webkit.org/b/244186 imported/w3c/web-platform-tests/event-timing/click-timing.html [ Skip ] @@ -579,11 +580,16 @@ webkit.org/b/244186 imported/w3c/web-platform-tests/event-timing/disconnect-targ webkit.org/b/244186 imported/w3c/web-platform-tests/event-timing/duration-with-target-low.html [ Skip ] webkit.org/b/244186 imported/w3c/web-platform-tests/event-timing/event-retarget.html [ Skip ] webkit.org/b/244186 imported/w3c/web-platform-tests/event-timing/first-input-shadow-dom.html [ Skip ] +webkit.org/b/244186 imported/w3c/web-platform-tests/event-timing/interactionid-auxclick.html [ Skip ] +webkit.org/b/244186 imported/w3c/web-platform-tests/event-timing/interactionid-orphan-pointerup.html [ Skip ] webkit.org/b/244186 imported/w3c/web-platform-tests/event-timing/keydown.html [ Skip ] webkit.org/b/244186 imported/w3c/web-platform-tests/event-timing/large-duration-threshold.html [ Skip ] webkit.org/b/244186 imported/w3c/web-platform-tests/event-timing/medium-duration-threshold.html [ Skip ] webkit.org/b/244186 imported/w3c/web-platform-tests/event-timing/retrievability.html [ Skip ] +webkit.org/b/244186 imported/w3c/web-platform-tests/event-timing/interactionid-click.html [ Pass ] +webkit.org/b/244186 imported/w3c/web-platform-tests/event-timing/retrieve-firstInput.html [ Pass ] + # notImplemented in WTR::UIScriptController::isShowingDateTimePicker fast/forms/datalist [ Skip ] fast/forms/date/date-show-hide-picker.html [ Skip ] diff --git a/Source/WebCore/Headers.cmake b/Source/WebCore/Headers.cmake index 15e49a27877b6..08115d6744527 100644 --- a/Source/WebCore/Headers.cmake +++ b/Source/WebCore/Headers.cmake @@ -2009,6 +2009,7 @@ set(WebCore_PRIVATE_FRAMEWORK_HEADERS page/ElementTargetingTypes.h page/EmptyAttachmentElementClient.h page/EventHandler.h + page/EventTimingInteractionID.h page/FocusController.h page/FocusDirection.h page/FocusEventData.h @@ -2061,8 +2062,7 @@ set(WebCore_PRIVATE_FRAMEWORK_HEADERS page/PageOverlayController.h page/PagePasteboardContext.h page/PartitionedSecurityOrigin.h - page/PerformanceEntry.h - page/PerformanceEventTiming.h + page/PerformanceEventTimingCandidate.h page/PerformanceLogging.h page/PerformanceLoggingClient.h page/PointerCaptureController.h diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj index a5c251fb50d4f..e32abd6b98300 100644 --- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj +++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj @@ -1833,6 +1833,7 @@ 4822970E29C8EBC00033A126 /* RegionContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 4822970C29C8EBC00033A126 /* RegionContext.h */; settings = {ATTRIBUTES = (Private, ); }; }; 4822FD1D2E2A7FA1004CAFF9 /* EventCounts.h in Headers */ = {isa = PBXBuildFile; fileRef = 4822FD1B2E2A7FA1004CAFF9 /* EventCounts.h */; }; 4822FD232E2A8058004CAFF9 /* PerformanceEventTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = 4822FD212E2A8058004CAFF9 /* PerformanceEventTiming.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 4869472D2E54CE1800C708D8 /* PerformanceEventTimingCandidate.h in Headers */ = {isa = PBXBuildFile; fileRef = 4869472C2E54CE1800C708D8 /* PerformanceEventTimingCandidate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 486B8DC72A043C0600E00E73 /* AXGeometryManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 486B8DC62A043C0600E00E73 /* AXGeometryManager.h */; }; 48B0242A2B2A65AA0083D122 /* AXTextRun.h in Headers */ = {isa = PBXBuildFile; fileRef = 48B024282B2A65AA0083D122 /* AXTextRun.h */; settings = {ATTRIBUTES = (Private, ); }; }; 48B187762E54CC85009B57A9 /* AXUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 80A24B442E486831006FF9DB /* AXUtilities.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -1840,6 +1841,7 @@ 48B187782E54CC95009B57A9 /* AXTableHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = 48B187742E54CC65009B57A9 /* AXTableHelpers.h */; settings = {ATTRIBUTES = (Private, ); }; }; 48B5BF3729CA691700FEBE3B /* AccessibilityRegionContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 48B5BF3529CA691700FEBE3B /* AccessibilityRegionContext.h */; settings = {ATTRIBUTES = (Private, ); }; }; 48D0E12929F7329E00263857 /* ElementAnimationContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 48D0E12829F7322900263857 /* ElementAnimationContext.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 48EA8D102E56212B00B1183B /* EventTimingInteractionID.h in Headers */ = {isa = PBXBuildFile; fileRef = 48EA8D0F2E56212B00B1183B /* EventTimingInteractionID.h */; settings = {ATTRIBUTES = (Private, ); }; }; 490D51012B698A8300C6B266 /* PseudoElementIdentifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 490D51002B698A8300C6B266 /* PseudoElementIdentifier.h */; settings = {ATTRIBUTES = (Private, ); }; }; 491342E32B43FFEF00FEEF18 /* CSSSelectorInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 491342DA2B43FAA800FEEF18 /* CSSSelectorInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; 491342E42B43FFEF00FEEF18 /* CSSSelectorEnums.h in Headers */ = {isa = PBXBuildFile; fileRef = 491342D92B43FAA700FEEF18 /* CSSSelectorEnums.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -3451,7 +3453,7 @@ 86AA52712937ADB50065399E /* TextManipulationItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 86AA52702937ADB40065399E /* TextManipulationItem.h */; settings = {ATTRIBUTES = (Private, ); }; }; 86AA527C2937BD620065399E /* TextManipulationToken.h in Headers */ = {isa = PBXBuildFile; fileRef = 86AA527B2937BD610065399E /* TextManipulationToken.h */; settings = {ATTRIBUTES = (Private, ); }; }; 86BBA9F02987EBF300A78986 /* ImageBufferBackendParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 86BBA9EF2987EBF100A78986 /* ImageBufferBackendParameters.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86BE340115058CB200CE0FD8 /* PerformanceEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 86BE33FB15058CB200CE0FD8 /* PerformanceEntry.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 86BE340115058CB200CE0FD8 /* PerformanceEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 86BE33FB15058CB200CE0FD8 /* PerformanceEntry.h */; }; 86D1969629A674390083B077 /* ServiceWorkerImportedScript.h in Headers */ = {isa = PBXBuildFile; fileRef = 86D1969529A674390083B077 /* ServiceWorkerImportedScript.h */; settings = {ATTRIBUTES = (Private, ); }; }; 86D196DD29ACE0930083B077 /* TextManipulationItemIdentifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 86D196DC29ACE0920083B077 /* TextManipulationItemIdentifier.h */; settings = {ATTRIBUTES = (Private, ); }; }; 86D982F7125C154000AD9E3D /* DocumentEventTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = 86D982F6125C154000AD9E3D /* DocumentEventTiming.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -11367,6 +11369,7 @@ 4822FD222E2A8058004CAFF9 /* PerformanceEventTiming.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = PerformanceEventTiming.cpp; sourceTree = ""; }; 4822FD252E2A8082004CAFF9 /* PerformanceEventTiming.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = PerformanceEventTiming.idl; sourceTree = ""; }; 484F5FBD2CEFA23700E7B1B1 /* AXCoreObjectCocoa.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = AXCoreObjectCocoa.mm; sourceTree = ""; }; + 4869472C2E54CE1800C708D8 /* PerformanceEventTimingCandidate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PerformanceEventTimingCandidate.h; sourceTree = ""; }; 486B8DC62A043C0600E00E73 /* AXGeometryManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AXGeometryManager.h; sourceTree = ""; }; 486B8DC82A04500F00E00E73 /* AXGeometryManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AXGeometryManager.cpp; sourceTree = ""; }; 48AA91ED2DD7BDFD0038F076 /* AXTreeStore.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = AXTreeStore.cpp; sourceTree = ""; }; @@ -11379,6 +11382,7 @@ 48B5BF3629CA691700FEBE3B /* AccessibilityRegionContext.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityRegionContext.cpp; sourceTree = ""; }; 48C4E83C2B34D8380083460A /* AXTextRun.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = AXTextRun.cpp; sourceTree = ""; }; 48D0E12829F7322900263857 /* ElementAnimationContext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ElementAnimationContext.h; sourceTree = ""; }; + 48EA8D0F2E56212B00B1183B /* EventTimingInteractionID.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EventTimingInteractionID.h; sourceTree = ""; }; 490D51002B698A8300C6B266 /* PseudoElementIdentifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PseudoElementIdentifier.h; sourceTree = ""; }; 491342962B425C0100FEEF18 /* CSSPseudoSelectors.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = CSSPseudoSelectors.json; sourceTree = ""; }; 491342D92B43FAA700FEEF18 /* CSSSelectorEnums.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = CSSSelectorEnums.h; sourceTree = ""; }; @@ -29067,6 +29071,7 @@ E0FEF371B27C53EAC1C1FBEE /* EventSource.cpp */, E0FEF371B17C53EAC1C1FBEE /* EventSource.h */, E0FEF371B07C53EAC1C1FBEE /* EventSource.idl */, + 48EA8D0F2E56212B00B1183B /* EventTimingInteractionID.h */, 14993BE30B2F2B1C0050497F /* FocusController.cpp */, 14993BE40B2F2B1C0050497F /* FocusController.h */, 062287830B4DB322000C34DF /* FocusDirection.h */, @@ -29233,6 +29238,7 @@ 4822FD222E2A8058004CAFF9 /* PerformanceEventTiming.cpp */, 4822FD212E2A8058004CAFF9 /* PerformanceEventTiming.h */, 4822FD252E2A8082004CAFF9 /* PerformanceEventTiming.idl */, + 4869472C2E54CE1800C708D8 /* PerformanceEventTimingCandidate.h */, AD5A0C211DECA10100707054 /* PerformanceLogging.cpp */, AD5A0C201DECA0B500707054 /* PerformanceLogging.h */, 0FF2E80C1EE0D430009EABD4 /* PerformanceLoggingClient.cpp */, @@ -42219,6 +42225,7 @@ 97AA3CA5145237CC003E1DA6 /* EventTargetHeaders.h in Headers */, 9BDF285C2DC0AC8B0096B893 /* EventTargetInlines.h in Headers */, 97AA3CA6145237CC003E1DA6 /* EventTargetInterfaces.h in Headers */, + 48EA8D102E56212B00B1183B /* EventTimingInteractionID.h in Headers */, 262EC41A1D078FB900BA78FC /* EventTrackingRegions.h in Headers */, 93D196331D6CAB8200FC7E47 /* Exception.h in Headers */, 935FBCF209BA143B00E230B1 /* ExceptionCode.h in Headers */, @@ -44570,6 +44577,7 @@ 8A844D0511D3C18E0014065C /* Performance.h in Headers */, 86BE340115058CB200CE0FD8 /* PerformanceEntry.h in Headers */, 4822FD232E2A8058004CAFF9 /* PerformanceEventTiming.h in Headers */, + 4869472D2E54CE1800C708D8 /* PerformanceEventTimingCandidate.h in Headers */, AD5A0C251DECACCC00707054 /* PerformanceLogging.h in Headers */, 0F850FE31ED7C18300FB77A7 /* PerformanceLoggingClient.h in Headers */, 37C738E91EDBD2FA003F2B0B /* PerformanceMark.h in Headers */, diff --git a/Source/WebCore/bindings/js/JSPerformanceEntryCustom.cpp b/Source/WebCore/bindings/js/JSPerformanceEntryCustom.cpp index 9dfe6be398eee..fb36791f17cef 100644 --- a/Source/WebCore/bindings/js/JSPerformanceEntryCustom.cpp +++ b/Source/WebCore/bindings/js/JSPerformanceEntryCustom.cpp @@ -66,7 +66,6 @@ JSValue toJSNewlyCreated(JSGlobalObject*, JSDOMGlobalObject* globalObject, Ref

(globalObject, WTFMove(entry)); - return createWrapper(globalObject, WTFMove(entry)); } ASSERT_NOT_REACHED(); diff --git a/Source/WebCore/dom/EventDispatcher.cpp b/Source/WebCore/dom/EventDispatcher.cpp index 925038740a804..8595d40eb9519 100644 --- a/Source/WebCore/dom/EventDispatcher.cpp +++ b/Source/WebCore/dom/EventDispatcher.cpp @@ -179,9 +179,9 @@ void EventDispatcher::dispatchEvent(Node& node, Event& event) bool shouldDispatchEventToScripts = hasRelevantEventListener(document, event); RefPtr window = document->window(); - std::optional pendingEventTiming; + std::optional pendingEventTiming; if (typeInfo.isInCategory(EventCategory::EventTimingEligible) && window && document->settings().eventTimingEnabled() && event.isTrusted()) - pendingEventTiming = window->initializeEventTimingEntry(event, typeInfo); + pendingEventTiming = window->initializeEventTimingEntry(event, typeInfo.type()); auto finalizeEntry(WTF::makeScopeExit([&, event = Ref(event)] { if (pendingEventTiming) window->finalizeEventTimingEntry(*pendingEventTiming, event); diff --git a/Source/WebCore/page/EventTimingInteractionID.h b/Source/WebCore/page/EventTimingInteractionID.h new file mode 100644 index 0000000000000..d416eea36c70b --- /dev/null +++ b/Source/WebCore/page/EventTimingInteractionID.h @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2025 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#pragma once + +#include + +namespace WebCore { + +struct EventTimingInteractionID { + uint64_t value { 0 }; +}; + +} + +namespace WTF { + +template<> +struct MarkableTraits { + static bool isEmptyValue(WebCore::EventTimingInteractionID eventTimingInteractionID) + { + return !eventTimingInteractionID.value; + } + + static constexpr WebCore::EventTimingInteractionID emptyValue() + { + return WebCore::EventTimingInteractionID(); + } +}; + +} diff --git a/Source/WebCore/page/LocalDOMWindow.cpp b/Source/WebCore/page/LocalDOMWindow.cpp index 8aedaa3ccbca8..15b9b542034a6 100644 --- a/Source/WebCore/page/LocalDOMWindow.cpp +++ b/Source/WebCore/page/LocalDOMWindow.cpp @@ -75,6 +75,7 @@ #include "HTTPParsers.h" #include "History.h" #include "IdleRequestOptions.h" +#include "InputEvent.h" #include "InspectorInstrumentation.h" #include "JSDOMExceptionHandling.h" #include "JSDOMPromiseDeferred.h" @@ -137,12 +138,14 @@ #include "WindowFocusAllowedIndicator.h" #include "WindowPostMessageOptions.h" #include "WindowProxy.h" +#include "page/EventTimingInteractionID.h" #include #include #include #include #include #include +#include #include #include #include @@ -2458,39 +2461,196 @@ void LocalDOMWindow::finishedLoading() } } -PerformanceEventTiming::Candidate LocalDOMWindow::initializeEventTimingEntry(const Event& event, EventTypeInfo typeInfo) +EventTimingInteractionID LocalDOMWindow::computeInteractionID(const Event& event, EventType type) { - // FIXME: implement InteractionId logic + auto finalizePendingPointerDown = [this]() { + auto interactionID = generateInteractionID(); + m_pointerMap = interactionID; + m_pendingPointerDown->interactionID = interactionID; + m_performanceEventTimingCandidates.append(*m_pendingPointerDown); + m_pendingPointerDown.reset(); + return interactionID; + }; + + switch (type) { + case EventType::keyup: { + ASSERT(event.isKeyboardEvent()); + auto keyboardEvent = downcast(&event); + ASSERT(keyboardEvent); + if (keyboardEvent->isComposing()) + return EventTimingInteractionID(); + + auto it = m_pendingKeyDowns.find(keyboardEvent->keyCode()); + if (it == m_pendingKeyDowns.end()) + return EventTimingInteractionID(); + + auto interactionID = generateInteractionID(); + it->value.interactionID = interactionID; + m_performanceEventTimingCandidates.append(it->value); + m_pendingKeyDowns.remove(it); + return interactionID; + } + case EventType::compositionstart: { + for (auto& pendingEntry : m_pendingKeyDowns) + m_performanceEventTimingCandidates.append(pendingEntry.value); + + m_pendingKeyDowns.clear(); + return EventTimingInteractionID(); + } + case EventType::input: { + if (!event.isInputEvent()) + return EventTimingInteractionID(); + + ASSERT(event.isInputEvent()); + auto inputEvent = downcast(&event); + ASSERT(inputEvent); + if (!inputEvent->isInputMethodComposing()) + return EventTimingInteractionID(); + + return generateInteractionID(); + } + case EventType::click: { + if (!m_pointerMap) + return EventTimingInteractionID(); + + auto interactionID = *m_pointerMap; + m_pointerMap.reset(); + return interactionID; + } + case EventType::pointerup: { + if (!m_pendingPointerDown) { + if (!m_contextMenuTriggered) + return EventTimingInteractionID(); + + m_contextMenuTriggered = false; + return currentInteractionID(); + } + return finalizePendingPointerDown(); + } + case EventType::pointercancel: { + if (m_pendingPointerDown) { + // Cancelled pointerDowns are finalized without receiving an interactionID: + m_performanceEventTimingCandidates.append(*m_pendingPointerDown); + m_pendingPointerDown.reset(); + } + return EventTimingInteractionID(); + } + case EventType::contextmenu: { + if (!m_pendingPointerDown) + return currentInteractionID(); + + m_contextMenuTriggered = true; + return finalizePendingPointerDown(); + } + default: + return EventTimingInteractionID(); + } +} + +EventTimingInteractionID LocalDOMWindow::currentInteractionID() +{ + return ensureUserInteractionValue(); +} + +EventTimingInteractionID& LocalDOMWindow::ensureUserInteractionValue() +{ + // Should be initialized with a random number from 100 to 10000: + if (!m_userInteractionValue) [[unlikely]] + m_userInteractionValue = EventTimingInteractionID { .value = 100 + WTF::cryptographicallyRandomNumber() % 9901 }; + return *m_userInteractionValue; +} + +EventTimingInteractionID LocalDOMWindow::generateInteractionID() +{ + ++m_interactionCount; + return generateInteractionIDWithoutIncreasingInteractionCount(); +} + +EventTimingInteractionID LocalDOMWindow::generateInteractionIDWithoutIncreasingInteractionCount() +{ + // User interaction value should be increased by a small integer to + // "discourage developers from considering it as a counter": + ensureUserInteractionValue().value += 7; + return ensureUserInteractionValue(); +} + +PerformanceEventTimingCandidate LocalDOMWindow::initializeEventTimingEntry(const Event& event, EventType type) +{ + auto startTime = performance().relativeTimeFromTimeOriginInReducedResolutionSeconds(event.timeStamp()); auto processingStart = performance().nowInReducedResolutionSeconds(); - LOG_WITH_STREAM(PerformanceTimeline, stream << "Initializing event timing entry (type=" << event.type() << ") at t=" << processingStart); - return PerformanceEventTiming::Candidate { - .typeInfo = typeInfo, + LOG_WITH_STREAM(PerformanceTimeline, stream << "Initializing event timing entry (type=" << event.type() << "; tstamp=" << startTime << ") at t=" << processingStart); + if (startTime > processingStart) + startTime = processingStart; + + return PerformanceEventTimingCandidate { + .type = type, .cancelable = event.cancelable(), - // Account for event.timeStamp() unreliability (based on wall clock): - .startTime = std::min(processingStart, performance().relativeTimeFromTimeOriginInReducedResolutionSeconds(event.timeStamp())), - .processingStart = processingStart + .startTime = startTime, + .processingStart = processingStart, + .processingEnd = { }, + .duration = { }, + .target = { }, + .interactionID = computeInteractionID(event, type) }; } -void LocalDOMWindow::finalizeEventTimingEntry(const PerformanceEventTiming::Candidate& entry, const Event& event) +void LocalDOMWindow::finalizeEventTimingEntry(PerformanceEventTimingCandidate& entry, const Event& event) { + auto processingEnd = performance().nowInReducedResolutionSeconds(); + entry.processingEnd = processingEnd; + entry.target = event.target(); + if (event.type() == eventNames().pointerdownEvent) [[unlikely]] { + if (m_pendingPointerDown) { + m_performanceEventTimingCandidates.append(*m_pendingPointerDown); + LOG_WITH_STREAM(PerformanceTimeline, stream << "Repeated pointerdown entries at t=" << processingEnd); + } + + LOG_WITH_STREAM(PerformanceTimeline, stream << "Adding pending pointerdown at t=" << processingEnd); + m_pendingPointerDown = entry; + m_contextMenuTriggered = false; + return; + } + if (event.type() == eventNames().keydownEvent) [[unlikely]] { + ASSERT(event.isKeyboardEvent()); + auto keyboardEvent = downcast(&event); + ASSERT(keyboardEvent); + if (keyboardEvent->isComposing()) { + m_performanceEventTimingCandidates.append(entry); + return; + } + auto code = keyboardEvent->keyCode(); + auto it = m_pendingKeyDowns.find(code); + if (it == m_pendingKeyDowns.end()) { + m_pendingKeyDowns.set(code, entry); + return; + } + // Code 229 corresponds to IME keyboard events + // (https://www.w3.org/TR/event-timing/#sec-fin-event-timing) + if (code != 229) + it->value.interactionID = generateInteractionIDWithoutIncreasingInteractionCount(); + + m_performanceEventTimingCandidates.append(it->value); + it->value = entry; + return; + } + m_performanceEventTimingCandidates.append(entry); - // FIXME: implement InteractionId logic - m_performanceEventTimingCandidates.last().target = event.target(); - m_performanceEventTimingCandidates.last().processingEnd = performance().nowInReducedResolutionSeconds(); } void LocalDOMWindow::dispatchPendingEventTimingEntries() { + auto renderingTime = performance().nowInReducedResolutionSeconds(); + if (m_pendingPointerDown && !m_pendingPointerDown->duration) + m_pendingPointerDown->duration = renderingTime - m_pendingPointerDown->startTime; + if (m_performanceEventTimingCandidates.isEmpty()) return; - auto renderingTime = performance().nowInReducedResolutionSeconds(); LOG_WITH_STREAM(PerformanceTimeline, stream << "Dispatching " << m_performanceEventTimingCandidates.size() << " event timing entries at t=" << renderingTime); for (auto& candidateEntry : m_performanceEventTimingCandidates) { - performance().countEvent(candidateEntry.typeInfo.type()); - auto duration = renderingTime - candidateEntry.startTime; - performance().processEventEntry(candidateEntry, duration); + performance().countEvent(candidateEntry.type); + candidateEntry.duration = renderingTime - candidateEntry.startTime; + performance().processEventEntry(candidateEntry); } m_performanceEventTimingCandidates.clear(); } diff --git a/Source/WebCore/page/LocalDOMWindow.h b/Source/WebCore/page/LocalDOMWindow.h index 4e6e50286f619..e05e0f998d66c 100644 --- a/Source/WebCore/page/LocalDOMWindow.h +++ b/Source/WebCore/page/LocalDOMWindow.h @@ -30,9 +30,8 @@ #include #include #include -#include #include -#include +#include #include #include #include @@ -282,9 +281,10 @@ class LocalDOMWindow final void finishedLoading(); // EventTiming API - PerformanceEventTiming::Candidate initializeEventTimingEntry(const Event&, EventTypeInfo); - void finalizeEventTimingEntry(const PerformanceEventTiming::Candidate&, const Event&); + PerformanceEventTimingCandidate initializeEventTimingEntry(const Event&, EventType); + void finalizeEventTimingEntry(PerformanceEventTimingCandidate&, const Event&); void dispatchPendingEventTimingEntries(); + uint64_t interactionCount() { return m_interactionCount; } // HTML 5 key/value storage ExceptionOr sessionStorage(); @@ -397,6 +397,12 @@ class LocalDOMWindow final void failedToRegisterDeviceMotionEventListener(); #endif + EventTimingInteractionID computeInteractionID(const Event&, EventType); + EventTimingInteractionID currentInteractionID(); + EventTimingInteractionID& ensureUserInteractionValue(); + EventTimingInteractionID generateInteractionID(); + EventTimingInteractionID generateInteractionIDWithoutIncreasingInteractionCount(); + bool isSameSecurityOriginAsMainFrame() const; #if ENABLE(GAMEPAD) @@ -439,7 +445,18 @@ class LocalDOMWindow final mutable RefPtr m_closeWatcherManager; // Equivalent to the list of PerformanceEventTiming objects mentioned in https://www.w3.org/TR/event-timing/#sec-modifications-HTML : - Vector m_performanceEventTimingCandidates; + Vector m_performanceEventTimingCandidates; + + // FIXME: support multiple pointers by replacing std::optional + // with map objects using PointerID as key: + Markable m_pointerMap; + std::optional m_pendingPointerDown; + + bool m_contextMenuTriggered { false }; + + HashMap, WTF::SignedWithZeroKeyHashTraits> m_pendingKeyDowns; + std::optional m_userInteractionValue; + uint64_t m_interactionCount { 0 }; String m_status; diff --git a/Source/WebCore/page/Performance.cpp b/Source/WebCore/page/Performance.cpp index 8327ae9bea631..29e6d7b735cff 100644 --- a/Source/WebCore/page/Performance.cpp +++ b/Source/WebCore/page/Performance.cpp @@ -42,6 +42,7 @@ #include "EventNames.h" #include "ExceptionOr.h" #include "LocalFrame.h" +#include "Logging.h" #include "PerformanceEntry.h" #include "PerformanceEventTiming.h" #include "PerformanceMarkOptions.h" @@ -163,6 +164,13 @@ EventCounts* Performance::eventCounts() return m_eventCounts.get(); } +uint64_t Performance::interactionCount() +{ + ASSERT(is(scriptExecutionContext())); + ASSERT(isMainThread()); + return downcast(*scriptExecutionContext()).window()->interactionCount(); +} + PerformanceNavigation* Performance::navigation() { if (!is(scriptExecutionContext())) @@ -202,6 +210,9 @@ Vector> Performance::getEntries() const if (m_firstContentfulPaint) entries.append(*m_firstContentfulPaint); + if (m_firstInput) + entries.append(*m_firstInput); + std::ranges::sort(entries, PerformanceEntry::startTimeCompareLessThan); return entries; } @@ -226,6 +237,9 @@ Vector> Performance::getEntriesByType(const String& entryT entries.appendVector(m_userTiming->getMeasures()); } + if (entryType == "first-input"_s && m_firstInput) + entries.append(*m_firstInput); + std::ranges::sort(entries, PerformanceEntry::startTimeCompareLessThan); return entries; } @@ -254,6 +268,11 @@ Vector> Performance::getEntriesByName(const String& name, entries.appendVector(m_userTiming->getMeasures(name)); } + if (entryType.isNull() || entryType == "first-input"_s) { + if (m_firstInput && name == m_firstInput->name()) + entries.append(*m_firstInput); + } + std::ranges::sort(entries, PerformanceEntry::startTimeCompareLessThan); return entries; } @@ -293,25 +312,29 @@ void Performance::countEvent(EventType type) eventCounts()->add(type); } -void Performance::processEventEntry(PerformanceEventTiming::Candidate& candidate, Seconds duration) +void Performance::processEventEntry(const PerformanceEventTimingCandidate& candidate) { - // FIXME: handle firstInput based on InteractionId - if (!m_firstInput) { - m_firstInput = PerformanceEventTiming::create(candidate, duration, true); + // Constants to avoid the need to round to the appropriate resolution + // (PerformanceEventTiming::durationResolution) when filtering candidates: + static constexpr Seconds minDurationCutoffBeforeRounding = PerformanceEventTiming::minimumDurationThreshold - (PerformanceEventTiming::durationResolution / 2); + static constexpr Seconds defaultDurationCutoffBeforeRounding = PerformanceEventTiming::defaultDurationThreshold - (PerformanceEventTiming::durationResolution / 2); + + if (!m_firstInput && candidate.interactionID.value) { + m_firstInput = PerformanceEventTiming::create(candidate, true); queueEntry(*m_firstInput); } - if (duration < minDurationCutoffBeforeRounding) + if (candidate.duration < minDurationCutoffBeforeRounding) return; // FIXME: early return more often by keeping track of m_observers; we // should keep track of the minimum defaultThreshold and whether any // observers are interested in 'event' entries: - if (duration <= defaultDurationCutoffBeforeRounding && !m_observers.size()) + if (candidate.duration <= defaultDurationCutoffBeforeRounding && !m_observers.size()) return; - auto entry = PerformanceEventTiming::create(candidate, duration); - if (m_eventTimingBuffer.size() < m_eventTimingBufferSize && duration > defaultDurationCutoffBeforeRounding) + auto entry = PerformanceEventTiming::create(candidate); + if (m_eventTimingBuffer.size() < m_eventTimingBufferSize && candidate.duration > defaultDurationCutoffBeforeRounding) m_eventTimingBuffer.append(entry); queueEntry(entry); @@ -536,6 +559,7 @@ void Performance::queueEntry(PerformanceEntry& entry) if (!shouldScheduleTask) return; + LOG_WITH_STREAM(PerformanceTimeline, stream << "PerformanceEntry of type " << entry.name() << " dispatched to interested observer at t=" << now()); scheduleTaskIfNeeded(); } diff --git a/Source/WebCore/page/Performance.h b/Source/WebCore/page/Performance.h index 1f2d385420ce6..e4b09eb830275 100644 --- a/Source/WebCore/page/Performance.h +++ b/Source/WebCore/page/Performance.h @@ -36,7 +36,6 @@ #include "DOMHighResTimeStamp.h" #include "EventTarget.h" #include "EventTargetInterfaces.h" -#include "PerformanceEventTiming.h" #include "ReducedResolutionSeconds.h" #include "ScriptExecutionContext.h" #include "Timer.h" @@ -69,6 +68,7 @@ class ResourceResponse; class ResourceTiming; class ScriptExecutionContext; enum class EventType : uint16_t; +struct PerformanceEventTimingCandidate; struct PerformanceMarkOptions; struct PerformanceMeasureOptions; template class ExceptionOr; @@ -87,7 +87,7 @@ class Performance final : public RefCounted, public ContextDestruct PerformanceTiming* timing(); EventCounts* eventCounts(); - unsigned interactionCount() { return 0; } + uint64_t interactionCount(); Vector> getEntries() const; Vector> getEntriesByType(const String& entryType) const; @@ -95,7 +95,7 @@ class Performance final : public RefCounted, public ContextDestruct void appendBufferedEntriesByType(const String& entryType, Vector>&, PerformanceObserver&) const; void countEvent(EventType); - void processEventEntry(PerformanceEventTiming::Candidate&, Seconds duration); + void processEventEntry(const PerformanceEventTimingCandidate&); void clearResourceTimings(); void setResourceTimingBufferSize(unsigned); @@ -160,18 +160,13 @@ class Performance final : public RefCounted, public ContextDestruct Timer m_resourceTimingBufferFullTimer; Vector> m_backupResourceTimingBuffer; - RefPtr m_firstInput; - Vector> m_eventTimingBuffer; + RefPtr m_firstInput; + Vector> m_eventTimingBuffer; // Sizes recommended by https://w3c.github.io/timing-entrytypes-registry/#registry: unsigned m_eventTimingBufferSize { 150 }; unsigned m_resourceTimingBufferSize { 250 }; - // Constants to avoid the need to round to PerformanceEventTiming::durationResolution - // when filtering candidate entries: - static constexpr Seconds minDurationCutoffBeforeRounding = PerformanceEventTiming::minimumDurationThreshold - (PerformanceEventTiming::durationResolution / 2); - static constexpr Seconds defaultDurationCutoffBeforeRounding = PerformanceEventTiming::defaultDurationThreshold - (PerformanceEventTiming::durationResolution / 2); - // https://w3c.github.io/resource-timing/#dfn-resource-timing-buffer-full-flag bool m_resourceTimingBufferFullFlag { false }; bool m_waitingForBackupBufferToBeProcessed { false }; diff --git a/Source/WebCore/page/PerformanceEventTiming.cpp b/Source/WebCore/page/PerformanceEventTiming.cpp index 6d8864bcca464..842d226c8544e 100644 --- a/Source/WebCore/page/PerformanceEventTiming.cpp +++ b/Source/WebCore/page/PerformanceEventTiming.cpp @@ -28,23 +28,26 @@ #include "Document.h" #include "DocumentInlines.h" +#include "EventNames.h" #include "EventTargetInlines.h" #include "Node.h" +#include "PerformanceEventTimingCandidate.h" #include namespace WebCore { -Ref PerformanceEventTiming::create(const Candidate& candidate, Seconds duration, bool isFirst) +Ref PerformanceEventTiming::create(const PerformanceEventTimingCandidate& candidate, bool isFirst) { - return adoptRef(*new PerformanceEventTiming(candidate, duration, isFirst)); + return adoptRef(*new PerformanceEventTiming(candidate, isFirst)); } -PerformanceEventTiming::PerformanceEventTiming(const Candidate& candidate, Seconds duration, bool isFirst) - : PerformanceEntry(eventNames().eventNameFromEventType(candidate.typeInfo.type()), candidate.startTime.milliseconds(), candidate.startTime.milliseconds() + durationResolutionInMilliseconds*std::round(duration.milliseconds() / durationResolutionInMilliseconds)) +PerformanceEventTiming::PerformanceEventTiming(const PerformanceEventTimingCandidate& candidate, bool isFirst) + : PerformanceEntry(eventNames().eventNameFromEventType(candidate.type), candidate.startTime.milliseconds(), candidate.startTime.milliseconds() + durationResolutionInMilliseconds*std::round(candidate.duration.milliseconds() / durationResolutionInMilliseconds)) , m_isFirst(isFirst) , m_cancelable(candidate.cancelable) , m_processingStart(candidate.processingStart) , m_processingEnd(candidate.processingEnd) + , m_interactionID(candidate.interactionID) , m_target(candidate.target) { } @@ -76,9 +79,9 @@ ASCIILiteral PerformanceEventTiming::entryType() const return m_isFirst ? "first-input"_s : "event"_s; } -unsigned PerformanceEventTiming::interactionId() const +uint64_t PerformanceEventTiming::interactionId() const { - return 0; + return m_interactionID.value; } } // namespace WebCore diff --git a/Source/WebCore/page/PerformanceEventTiming.h b/Source/WebCore/page/PerformanceEventTiming.h index d09960d392f04..53da240347c6a 100644 --- a/Source/WebCore/page/PerformanceEventTiming.h +++ b/Source/WebCore/page/PerformanceEventTiming.h @@ -26,35 +26,27 @@ #pragma once -#include -#include -#include -#include +#include "DOMHighResTimeStamp.h" +#include "EventTarget.h" +#include "EventTimingInteractionID.h" +#include "PerformanceEntry.h" #include namespace WebCore { -class EventTarget; class Node; +struct PerformanceEventTimingCandidate; class PerformanceEventTiming final : public PerformanceEntry { public: - struct Candidate { - EventTypeInfo typeInfo { }; - bool cancelable { false }; - Seconds startTime { 0 }; - Seconds processingStart { 0 }; - Seconds processingEnd { 0 }; - WeakPtr target { nullptr }; - }; - static Ref create(const Candidate&, Seconds duration, bool isFirst = false); + static Ref create(const PerformanceEventTimingCandidate&, bool isFirst = false); ~PerformanceEventTiming(); DOMHighResTimeStamp processingStart() const { return m_processingStart.milliseconds(); } DOMHighResTimeStamp processingEnd() const { return m_processingEnd.milliseconds(); } bool cancelable() const { return m_cancelable; } Node* target() const; - unsigned interactionId() const; + uint64_t interactionId() const; Type performanceEntryType() const final; ASCIILiteral entryType() const final; @@ -65,11 +57,13 @@ class PerformanceEventTiming final : public PerformanceEntry { static constexpr Seconds defaultDurationThreshold = 104_ms; private: - PerformanceEventTiming(const Candidate&, Seconds duration, bool isFirst); + PerformanceEventTiming(const PerformanceEventTimingCandidate&, bool isFirst); + bool m_isFirst; bool m_cancelable; Seconds m_processingStart; Seconds m_processingEnd; + EventTimingInteractionID m_interactionID; WeakPtr m_target; }; diff --git a/Source/WebCore/page/PerformanceEventTimingCandidate.h b/Source/WebCore/page/PerformanceEventTimingCandidate.h new file mode 100644 index 0000000000000..21f4ac237875e --- /dev/null +++ b/Source/WebCore/page/PerformanceEventTimingCandidate.h @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2025 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#pragma once + +#include "EventTarget.h" +#include "EventTimingInteractionID.h" +#include + +namespace WebCore { + +enum class EventType : uint16_t; + +struct PerformanceEventTimingCandidate { + EventType type { }; + bool cancelable { false }; + Seconds startTime; + Seconds processingStart; + Seconds processingEnd; + Seconds duration; + WeakPtr target; + EventTimingInteractionID interactionID; +}; + +} diff --git a/Source/WebCore/page/PerformanceObserver.cpp b/Source/WebCore/page/PerformanceObserver.cpp index 76ef48f34ef39..cf4228d92a7e3 100644 --- a/Source/WebCore/page/PerformanceObserver.cpp +++ b/Source/WebCore/page/PerformanceObserver.cpp @@ -30,6 +30,7 @@ #include "InspectorInstrumentation.h" #include "LocalDOMWindow.h" #include "Performance.h" +#include "PerformanceEventTiming.h" #include "PerformanceObserverEntryList.h" #include "WorkerGlobalScope.h" @@ -37,6 +38,7 @@ namespace WebCore { PerformanceObserver::PerformanceObserver(ScriptExecutionContext& scriptExecutionContext, Ref&& callback) : m_callback(WTFMove(callback)) + , m_durationThreshold(PerformanceEventTiming::defaultDurationThreshold) { if (RefPtr document = dynamicDowncast(scriptExecutionContext)) { if (auto* window = document->window()) diff --git a/Source/WebCore/page/PerformanceObserver.h b/Source/WebCore/page/PerformanceObserver.h index 6db6759565cfe..4e3baa45ab337 100644 --- a/Source/WebCore/page/PerformanceObserver.h +++ b/Source/WebCore/page/PerformanceObserver.h @@ -83,10 +83,10 @@ class PerformanceObserver : public RefCounted { Vector> m_entriesToDeliver; const Ref m_callback; OptionSet m_typeFilter; + Seconds m_durationThreshold; bool m_registered { false }; bool m_isTypeObserver { false }; bool m_hasNavigationTiming { false }; - Seconds m_durationThreshold = PerformanceEventTiming::defaultDurationThreshold; }; } // namespace WebCore