forked from mirrors/gecko-dev
Bug 1899597 - Add a perf test for DOM removal with positional pseudo-classes. r=perftest-reviewers,sparky
Differential Revision: https://phabricator.services.mozilla.com/D212038
This commit is contained in:
parent
631a06aa55
commit
9aa3960059
3 changed files with 44 additions and 0 deletions
|
|
@ -39,4 +39,6 @@
|
|||
% http://localhost/tests/perf-reftest-singletons/remove-front-has-pseudo.html
|
||||
% http://localhost/tests/perf-reftest-singletons/append-nth-edge-has-pseudo.html
|
||||
% http://localhost/tests/perf-reftest-singletons/insert-nth-edge-has-pseudo.html
|
||||
% http://localhost/tests/perf-reftest-singletons/remove-children-positional-1.html
|
||||
% http://localhost/tests/perf-reftest-singletons/remove-children-positional-2.html
|
||||
# When modifying this list, please also update build/pgo/index.html (If relevant to profile-guided optimzation).
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
<!doctype html>
|
||||
<script src="util.js"></script>
|
||||
<style>
|
||||
:nth-child(2n - 1) {
|
||||
color: green;
|
||||
}
|
||||
</style>
|
||||
<div id="container"></div>
|
||||
<script>
|
||||
onload = function() {
|
||||
const kElementCount = 10000;
|
||||
for (let i = 0; i < kElementCount; ++i)
|
||||
container.appendChild(document.createElement("div"));
|
||||
flush_layout();
|
||||
perf_start();
|
||||
while (container.firstChild)
|
||||
container.firstChild.remove();
|
||||
flush_layout();
|
||||
perf_finish();
|
||||
};
|
||||
</script>
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
<!doctype html>
|
||||
<script src="util.js"></script>
|
||||
<style>
|
||||
:nth-child(2n - 1) {
|
||||
color: green;
|
||||
}
|
||||
</style>
|
||||
<div id="container"></div>
|
||||
<script>
|
||||
onload = function() {
|
||||
const kElementCount = 10000;
|
||||
for (let i = 0; i < kElementCount; ++i)
|
||||
container.appendChild(document.createElement("div"));
|
||||
flush_layout();
|
||||
perf_start();
|
||||
while (container.lastChild)
|
||||
container.lastChild.remove();
|
||||
flush_layout();
|
||||
perf_finish();
|
||||
}
|
||||
</script>
|
||||
Loading…
Reference in a new issue