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

Unified Diff: third_party/WebKit/PerformanceTests/DOM/remove_child_with_selection.html

Issue 2212293002: Use LayoutObject::selectionState() to check whether selection contains node or not (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-08-08T11:10:01 Created 4 years, 4 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/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>
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | third_party/WebKit/Source/core/editing/FrameSelection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698