mirror of
https://github.com/servo/servo.git
synced 2025-09-10 15:08:21 +01:00
Vendors the [blink perf tests](https://chromium.googlesource.com/chromium/src/+/HEAD/third_party/blink/perf_tests/). These perf tests are useful to evaluate the performance of servo. The license that governs the perf tests is included in the folder. Running benchmark cases automatically is left to future work. The update.py script is taken from mozjs and slightly adapted, so we can easily filter (and patch if this should be necessary in the future. Testing: This PR just adds the perf_tests, but does not use or modify them in any way. --------- Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
37 lines
1.3 KiB
HTML
Vendored
37 lines
1.3 KiB
HTML
Vendored
<!DOCTYPE html>
|
|
<title>Custom Highlights Painting</title>
|
|
<style>
|
|
::highlight(example) {
|
|
color: blue;
|
|
background: yellow;
|
|
}
|
|
.lime ::highlight(example) {
|
|
background: lime;
|
|
}
|
|
</style>
|
|
<script src="../resources/runner.js"></script>
|
|
<script src="resources/paint.js"></script>
|
|
<main></main>
|
|
<pre id="log"></pre>
|
|
<script>
|
|
const LOREM_IPSUM = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. ".repeat(42);
|
|
|
|
const highlight = new Highlight;
|
|
const main = document.querySelector("main");
|
|
main.textContent = LOREM_IPSUM;
|
|
|
|
for (let i = 0; i < LOREM_IPSUM.length; i += 2) {
|
|
const range = new Range;
|
|
range.setStart(main.firstChild, i);
|
|
range.setEnd(main.firstChild, i + 1);
|
|
highlight.add(range);
|
|
}
|
|
|
|
CSS.highlights.set("example", highlight);
|
|
|
|
measurePaint({
|
|
description: "Measure time for painting Custom Highlights (emulates searching 'a' in a large text)",
|
|
run: () => document.body.classList.toggle("lime"),
|
|
});
|
|
|
|
</script>
|