зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1698926 [wpt PR 28106] - [PaintTiming] Fix document notified by SVG paints, a=testonly
Automatic update from web-platform-tests [PaintTiming] Fix document notified by SVG paints Previously, the main frame would be notified of all SVG paints. This CL fixes this and adds a WPT. Bug: 1185509 Change-Id: I8a4435701227fdc2ff3fee20b5df1a2e14499e1f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2765485 Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org> Commit-Queue: Nicolás Peña Moreno <npm@chromium.org> Cr-Commit-Position: refs/heads/master@{#863470} -- wpt-commits: a2108adbb566d81747c4f906cfd93d2b238fe6b2 wpt-pr: 28106
This commit is contained in:
Родитель
d1c770d59e
Коммит
e072539e63
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Performance Paint Timing Test: SVG in iframe does not trigger FCP</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="../resources/utils.js"></script>
|
||||
<iframe src="../resources/svg.html"></iframe>
|
||||
<script>
|
||||
promise_test(async (t) => {
|
||||
await new Promise(resolve => {
|
||||
window.addEventListener("message", resolve);
|
||||
});
|
||||
return assertNoFirstContentfulPaint(t);
|
||||
}, "SVG in an iframe does not trigger FCP in the main frame");
|
||||
</script>
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<div id="main">
|
||||
<svg viewBox="0 0 10 10">
|
||||
<defs>
|
||||
<circle id="myCircle" cx="5" cy="5" r="4" stroke="blue" />
|
||||
</defs>
|
||||
<use id="circle" href="#myCircle" fill="green" />
|
||||
</svg>
|
||||
</div>
|
||||
<script>
|
||||
const observer = new PerformanceObserver(list => {
|
||||
const fcp = list.getEntriesByName("first-contentful-paint");
|
||||
if (!fcp.length)
|
||||
return;
|
||||
|
||||
// Message the parent when FCP has been reached.
|
||||
parent.postMessage("GotFCP", '*');
|
||||
});
|
||||
observer.observe({ type: "paint", buffered: true });
|
||||
</script>
|
Загрузка…
Ссылка в новой задаче