ContainerTiming: regression tests for cross-frame isolation
Each frame has its own ContainerTiming Supplement and tracker; paints
inside an iframe must not surface in the parent.
Adds a blink_unittests case using SingleChildLocalFrameClient plus
same-origin and cross-origin WPTs (parent observer must stay silent;
subframe postMessages its own entries to prove paint occurred).
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
// does not deliver its paint-presentation callback in content_shell, so
// this signal may never arrive there.(btw, thanks for all the comments, very nice to read!).
It's a little unfortunate that we have to incorporate content_shell (i.e. Chromium) details into a WPT test. Do we get the presentation callback with `-enable-threaded-compositing`, or doesn't that work either? Is there any prior art here, or is this test paving the way?
(I wouldn't block on this, but it might be good to think about).
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
// does not deliver its paint-presentation callback in content_shell, so
// this signal may never arrive there.(btw, thanks for all the comments, very nice to read!).
It's a little unfortunate that we have to incorporate content_shell (i.e. Chromium) details into a WPT test. Do we get the presentation callback with `-enable-threaded-compositing`, or doesn't that work either? Is there any prior art here, or is this test paving the way?
(I wouldn't block on this, but it might be good to think about).
Checked it: --enable-threaded-compositing fixes it.
Cross-origin subframe, entries reaching its own observer:
single-threaded (default): paint 0, element 0, LCP 0, container 0
threaded compositing: paint 2, element 1, LCP 1, container 1
same-process cross-origin: paint 2, element 1, LCP 1, container 1
Not container-timing or origins: an out-of-process iframe gets no presentation feedback under the single-threaded web-test default, so every paint-timing API dies with it. Prior art: element-timing/cross-origin-iframe-element.sub.html (same test, weaker), and threaded-composited-iframes for the virtual-suite treatment.
So, comments no longer mention content_shell, the cross-origin test asserts the child's entry when it arrives, and a container-timing-threaded virtual suite runs
both tests with threaded compositing.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
The changes are not trivial, so this requires review again.
"Container Timing entries are reported from a paint-presentation callback. ",Since this doesn't need any additional flags, maybe just add these to the "threaded" test suite? These should probably be exclusive_tests too, to force the config?
// - 'child-entries': this frame's own container-timing entry. Reporting it
// requires the implementation to resolve a paint-presentation time for
// this frame, which an embedder is not obliged to do for an iframe that
// renders in a separate process.I find this surprising. Is this specced to that way? Would this change if using an exclusive_test for the VirtualTestSuite to mimic production? I'd have to poke at LCP to see what we do in production, but I thought the OOPIF would have its own isolated performance timeline and the APIs should just work (currently ICP doesn't for any iframes, which is a WIP). But I haven't dug too much into iframes for the other perf APIs...
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
"Container Timing entries are reported from a paint-presentation callback. ",Since this doesn't need any additional flags, maybe just add these to the "threaded" test suite? These should probably be exclusive_tests too, to force the config?
Done: moved both into the threaded suite (bases + exclusive_tests) and dropped the
container-timing-threaded suite. With the config forced, the cross-origin test now
asserts the child's entry outright.
// - 'child-entries': this frame's own container-timing entry. Reporting it
// requires the implementation to resolve a paint-presentation time for
// this frame, which an embedder is not obliged to do for an iframe that
// renders in a separate process.I find this surprising. Is this specced to that way? Would this change if using an exclusive_test for the VirtualTestSuite to mimic production? I'd have to poke at LCP to see what we do in production, but I thought the OOPIF would have its own isolated performance timeline and the APIs should just work (currently ICP doesn't for any iframes, which is a WIP). But I haven't dug too much into iframes for the other perf APIs...
My comment was wrong. I assumed that the single threaded behavior was expected. Well, it is, but because of the restriction of the tests by default.
Cross-origin subframe reading its own observer:
The OOPIF timeline works as expected. But the single threaded web test config never delivers presentation feedback to an out-of-process widget, so paint timing APIs did not work. With the new configuration they just work.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
LGTM
+pdr can you PTAL at VirtualTestSuites?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
LGTM
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Exportable changes to web-platform-tests were detected in this CL and a pull request in the upstream repo has been made: https://github.com/web-platform-tests/wpt/pull/61663.
When this CL lands, the bot will automatically merge the PR on GitHub if the required GitHub checks pass; otherwise, ecosystem-infra@ team will triage the failures and may contact you.
WPT Export docs:
https://chromium.googlesource.com/chromium/src/+/main/docs/testing/web_platform_tests.md#Automatic-export-process
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
ContainerTiming: regression tests for cross-frame isolation
Each frame has its own ContainerTiming Supplement and tracker; paints
inside an iframe must not surface in the parent.
Adds a blink_unittests case using SingleChildLocalFrameClient,
parameterized over both the pre-paint and the fallback attribution
paths: it simulates a paint in a child frame and asserts the entry
appears only in the child's performance timeline, never the parent's.
Adds same-origin and cross-origin WPTs where the parent observer must
stay silent. The subframe postMessages its own container entry, so that
parent silence is meaningful rather than vacuous.
Web tests run single-threaded by default, and in that configuration an
out-of-process iframe never gets presentation feedback, so it reports no
paint timing at all (element timing and LCP alike). Both WPTs therefore
run exclusively under the existing threaded virtual suite, where the
subframe reliably reports its entry and the tests can assert it outright.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
The WPT PR for this CL has been merged upstream! https://github.com/web-platform-tests/wpt/pull/61663
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |