mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Auto merge of #19569 - asajeffrey:script-perf-measure-topLevelDomComplete, r=jdm
Add a topLevelDomComplete metric. <!-- Please describe your changes on the following line: --> Measure DOM completion without iframes. This is in support of measuring when the main document is loaded, ignoring secondary content, e.g. ads. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #19561 - [X] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19569) <!-- Reviewable:end -->
This commit is contained in:
commit
d832e1b8f8
7 changed files with 59 additions and 0 deletions
|
@ -40195,6 +40195,12 @@
|
|||
{}
|
||||
]
|
||||
],
|
||||
"mozilla/window_performance_topLevelDomComplete.html": [
|
||||
[
|
||||
"/_mozilla/mozilla/window_performance_topLevelDomComplete.html",
|
||||
{}
|
||||
]
|
||||
],
|
||||
"mozilla/window_requestAnimationFrame.html": [
|
||||
[
|
||||
"/_mozilla/mozilla/window_requestAnimationFrame.html",
|
||||
|
@ -72342,6 +72348,10 @@
|
|||
"f03283e68b82d972ad21f674243070643ef89489",
|
||||
"testharness"
|
||||
],
|
||||
"mozilla/window_performance_topLevelDomComplete.html": [
|
||||
"4b953e63ffa6bf4ed1bc9a2baaea457d46502b9d",
|
||||
"testharness"
|
||||
],
|
||||
"mozilla/window_requestAnimationFrame.html": [
|
||||
"86310f3e4b88cce70ef92b56e4f65f034999096e",
|
||||
"testharness"
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
[window_performance_topLevelDomComplete.html]
|
||||
type: testharness
|
||||
prefs: [dom.testperf.enabled:true]
|
|
@ -0,0 +1,18 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>Performance toLevelDomComplete</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
async_test(function(t) {
|
||||
window.onload = t.step_func(function() {
|
||||
assert_true(performance.timing.domLoading <= performance.timing.topLevelDomComplete);
|
||||
assert_true(performance.timing.topLevelDomComplete <= performance.timing.domComplete);
|
||||
t.done();
|
||||
});
|
||||
}, "performance.topLevelDomComplete");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue