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

Unified Diff: tools/turbolizer/text-view.js

Issue 2234523002: [turbolizer] Fix selection bugs and performance problems (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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
« no previous file with comments | « tools/turbolizer/disassembly-view.js ('k') | tools/turbolizer/turbo-visualizer.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/turbolizer/text-view.js
diff --git a/tools/turbolizer/text-view.js b/tools/turbolizer/text-view.js
index 5a3639d5bc7c0b14031a027b6af1cefd4d2f82a1..eb86bf62735f9c723595e0b8eb3aac63a0f6c23d 100644
--- a/tools/turbolizer/text-view.js
+++ b/tools/turbolizer/text-view.js
@@ -168,14 +168,16 @@ class TextView extends View {
selectLocations(locations, selected, makeVisible) {
let view = this;
+ let s = new Set();
for (let l of locations) {
for (let i = 0; i < view.textListNode.children.length; ++i) {
let child = view.textListNode.children[i];
if (child.location != undefined && view.sameLocation(l, child.location)) {
- view.selectCommon(child, selected, makeVisible);
+ s.add(child);
}
}
}
+ view.selectCommon(s, selected, makeVisible);
}
getRanges(items) {
@@ -301,7 +303,7 @@ class TextView extends View {
view.selection.select(child, selected);
}
}
- } else if (s.length) {
+ } else if (typeof s[Symbol.iterator] === 'function') {
for (let i of s) {
if (firstSelect) {
makeContainerPosVisible(view.parentNode, i.offsetTop);
@@ -312,7 +314,6 @@ class TextView extends View {
} else {
if (firstSelect) {
makeContainerPosVisible(view.parentNode, s.offsetTop);
- firstSelect = false;
}
view.selection.select(s, selected);
}
@@ -368,6 +369,7 @@ class TextView extends View {
initializeContent(data, rememberedSelection) {
let view = this;
+ view.selection.clear();
view.clearText();
view.processText(data);
var fillerSize = document.documentElement.clientHeight -
« no previous file with comments | « tools/turbolizer/disassembly-view.js ('k') | tools/turbolizer/turbo-visualizer.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698