| Index: third_party/WebKit/PerformanceTests/Editing/move-down-with-hidden-elements.html
|
| diff --git a/third_party/WebKit/PerformanceTests/Editing/move-down-with-hidden-elements.html b/third_party/WebKit/PerformanceTests/Editing/move-down-with-hidden-elements.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..17b86fd104afa223de3633286c2d3e33a03a6721
|
| --- /dev/null
|
| +++ b/third_party/WebKit/PerformanceTests/Editing/move-down-with-hidden-elements.html
|
| @@ -0,0 +1,33 @@
|
| +<!doctype html>
|
| +<script src="../resources/runner.js"></script>
|
| +<div id="sample"></div>
|
| +<script>
|
| +const kCount = 10;
|
| +const kElements = 10000;
|
| +
|
| +const metaElements = (() => {
|
| + const result = [];
|
| + for (let count = 0; count < kElements; ++count)
|
| + result.push('<meta>', '</meta>');
|
| + return result;
|
| +})();
|
| +const sample = document.getElementById('sample');
|
| +sample.innerHTML = [
|
| + '<div hiddent>', ...metaElements, '</div>',
|
| + '<h1 id="target">first line of renderered text</h1>',
|
| + '<div hiddent>', ...metaElements, '</div>',
|
| +].join('');
|
| +
|
| +const selection = window.getSelection();
|
| +const target = document.getElementById('target');
|
| +
|
| +PerfTestRunner.measureRunsPerSecond({
|
| + description: 'Measures performance of move-down through non-renderered elements',
|
| + run: () => {
|
| + selection.collapse(target, 0);
|
| + selection.extend(target, target.childNodes.length);
|
| + for (let counter = 0; counter < kCount; ++counter)
|
| + selection.modify('move', 'forward', 'line');
|
| + },
|
| +});
|
| +</script>
|
|
|