Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(177)

Unified Diff: third_party/WebKit/PerformanceTests/ShadowDOM/SlotDistibutedNextPrevious.html

Issue 1611413005: Make HTMLSlotElement.distributedNodeNextTo&distributedNodePreviousTo faster (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clean up code Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/PerformanceTests/ShadowDOM/SlotDistibutedNextPrevious.html
diff --git a/third_party/WebKit/PerformanceTests/ShadowDOM/SlotDistibutedNextPrevious.html b/third_party/WebKit/PerformanceTests/ShadowDOM/SlotDistibutedNextPrevious.html
new file mode 100644
index 0000000000000000000000000000000000000000..438cd7342a191a9784305cb958b40f9d3a7af647
--- /dev/null
+++ b/third_party/WebKit/PerformanceTests/ShadowDOM/SlotDistibutedNextPrevious.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<script src="../resources/runner.js"></script>
+<div id="host">
+</div>
+<script>
+'use strict';
+const numAssignedDivs = 100;
+
+const host = document.getElementById('host');
+for (let i = 0; i < numAssignedDivs; ++i){
+ let div = document.createElement('div');
+ div.setAttribute('slot', 's1');
+ div.appendChild(document.createTextNode('div' + i));
+ host.appendChild(div);
+}
+
+const slot = document.createElement('slot');
+slot.setAttribute('name', 's1');
+const shadowRoot = host.attachShadow({mode: 'open'});
+shadowRoot.appendChild(slot);
+
+function run() {
+ slot.innerText;
+}
+
+PerfTestRunner.measureRunsPerSecond({
+ description: 'Measure Slot Distribution Calculation',
+ run: run,
+ done: () => {
+ }
+});
+</script>
+

Powered by Google App Engine
This is Rietveld 408576698