blob: 23b068168296c5429b2050cdeaa0a50f04ecad88 [file] [log] [blame]
<!DOCTYPE html>
<body>
<script src="../resources/runner.js"></script>
<script src="resources/line-layout-perf-test.js"></script>
<style>
#container {
width: 120ch;
white-space: pre-wrap;
overflow-wrap: break-word;
}
</style>
<pre id="container">A</pre>
<script>
const kNumberOfWords = 100;
const kSampleText = (() => {
const words = [];
for (let i = 1; i <= kNumberOfWords; ++i) {
words.push(TextGenerator.createWord(i % 12 + 3));
if (i % 10 === 0)
words.push('\n');
}
return words.join(' ');
})().repeat(1);
const kCount = 10;
const container = document.getElementById('container');
const editable = container.firstChild;
PerfTestRunner.measureRunsPerSecond({
run: function() {
for (let i = 0; i < kCount; ++i) {
editable.nodeValue = kSampleText;
PerfTestRunner.forceLayout();
editable.insertData(0, 'xyz');
PerfTestRunner.forceLayout();
}
},
});
</script>