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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!doctype html>
2 <script src="../resources/runner.js"></script>
3 <div id="target">target</div>
4 <div id="sample" style="display: none"></div>
5 <script>
6 var selection = window.getSelection();
7 selection.selectAllChildren(document.getElementById('target'));
8 var sample = document.getElementById('sample');
9 for (var index = 0; index < 1000; ++index) {
10 var span = document.createElement('span');
11 span.textContent = `item ${index}\n`;
12 sample.appendChild(span);
13 }
14 PerfTestRunner.measureTime({
15 description: 'Measures performance of removeChild() with selection.',
16
17 run: function() {
18 var copy = sample.cloneNode(true);
19 while (sample.firstChild)
20 sample.removeChild(sample.firstChild);
21 while (copy.firstChild)
22 sample.appendChild(copy.firstChild);
23 },
24 });
25 </script>
OLDNEW
« 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