| Index: third_party/WebKit/PerformanceTests/DOM/remove_child_with_selection.html
|
| diff --git a/third_party/WebKit/PerformanceTests/DOM/remove_child_with_selection.html b/third_party/WebKit/PerformanceTests/DOM/remove_child_with_selection.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..06a94415d3de7a5edf965586101688e09b6ffd68
|
| --- /dev/null
|
| +++ b/third_party/WebKit/PerformanceTests/DOM/remove_child_with_selection.html
|
| @@ -0,0 +1,25 @@
|
| +<!doctype html>
|
| +<script src="../resources/runner.js"></script>
|
| +<div id="target">target</div>
|
| +<div id="sample" style="display: none"></div>
|
| +<script>
|
| +var selection = window.getSelection();
|
| +selection.selectAllChildren(document.getElementById('target'));
|
| +var sample = document.getElementById('sample');
|
| +for (var index = 0; index < 1000; ++index) {
|
| + var span = document.createElement('span');
|
| + span.textContent = `item ${index}\n`;
|
| + sample.appendChild(span);
|
| +}
|
| +PerfTestRunner.measureTime({
|
| + description: 'Measures performance of removeChild() with selection.',
|
| +
|
| + run: function() {
|
| + var copy = sample.cloneNode(true);
|
| + while (sample.firstChild)
|
| + sample.removeChild(sample.firstChild);
|
| + while (copy.firstChild)
|
| + sample.appendChild(copy.firstChild);
|
| + },
|
| +});
|
| +</script>
|
|
|