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

Side by Side Diff: runtime/observatory/lib/src/elements/script_inset.dart

Issue 1057793003: Fix missing annotations in script inset when first annotation is outside the subset of lines being … (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library script_inset_element; 5 library script_inset_element;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:html'; 8 import 'dart:html';
9 import 'observatory_element.dart'; 9 import 'observatory_element.dart';
10 import 'service_ref.dart'; 10 import 'service_ref.dart';
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 } 409 }
410 } 410 }
411 411
412 return table; 412 return table;
413 } 413 }
414 414
415 // Assumes annotations are sorted. 415 // Assumes annotations are sorted.
416 Annotation nextAnnotationOnLine(int line) { 416 Annotation nextAnnotationOnLine(int line) {
417 if (annotationsCursor >= annotations.length) return null; 417 if (annotationsCursor >= annotations.length) return null;
418 var annotation = annotations[annotationsCursor]; 418 var annotation = annotations[annotationsCursor];
419
420 // Fast-forward past any annotations before the first line that
421 // we are displaying.
422 while (annotation.line < line) {
423 annotationsCursor++;
424 if (annotationsCursor >= annotations.length) return null;
425 annotation = annotations[annotationsCursor];
426 }
427
428 // Next annotation is for a later line, don't advance past it.
419 if (annotation.line != line) return null; 429 if (annotation.line != line) return null;
420 annotationsCursor++; 430 annotationsCursor++;
421 return annotation; 431 return annotation;
422 } 432 }
423 433
424 Element lineElement(ScriptLine line) { 434 Element lineElement(ScriptLine line) {
425 var e = new DivElement(); 435 var e = new DivElement();
426 e.classes.add("sourceRow"); 436 e.classes.add("sourceRow");
427 e.append(lineBreakpointElement(line)); 437 e.append(lineBreakpointElement(line));
428 e.append(lineNumberElement(line)); 438 e.append(lineNumberElement(line));
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 annotation.applyStyleTo(consumeUntil(annotation.columnStop)); 547 annotation.applyStyleTo(consumeUntil(annotation.columnStop));
538 } 548 }
539 consumeUntil(line.text.length); 549 consumeUntil(line.text.length);
540 } 550 }
541 551
542 return e; 552 return e;
543 } 553 }
544 554
545 ScriptInsetElement.created() : super.created(); 555 ScriptInsetElement.created() : super.created();
546 } 556 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698