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

Unified Diff: runtime/observatory/lib/src/elements/containers/virtual_collection.dart

Issue 2237383004: Fixed Observatory class-view crash (Closed) Base URL: git@github.com:dart-lang/sdk.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
Index: runtime/observatory/lib/src/elements/containers/virtual_collection.dart
diff --git a/runtime/observatory/lib/src/elements/containers/virtual_collection.dart b/runtime/observatory/lib/src/elements/containers/virtual_collection.dart
index e45a1439e6a5372c67a86c5a568200430aacd540..049081de046459ab7645d5eaf4b26fa08eb985f6 100644
--- a/runtime/observatory/lib/src/elements/containers/virtual_collection.dart
+++ b/runtime/observatory/lib/src/elements/containers/virtual_collection.dart
@@ -106,8 +106,8 @@ class VirtualCollectionElement extends HtmlElement implements Renderable {
_top = (scrollTop / _itemHeight).floor();
_scroller.style.height = '${_itemHeight*(_items.length)}px';
- _shifter.style.top = '${_itemHeight*_top}px';
final tail_length = (_height / _itemHeight / _preload).ceil();
+ _shifter.style.top = '${_itemHeight*(_top - tail_length)}px';
final length = tail_length * 2 + tail_length * _preload;
if (_shifter.children.length < length) {
@@ -116,7 +116,6 @@ class VirtualCollectionElement extends HtmlElement implements Renderable {
e..style.display = 'hidden';
_shifter.children.add(e);
}
- _shifter.style.height = '${_itemHeight*length}px';
children = [
_scroller
..children = [_shifter]
@@ -152,7 +151,10 @@ class VirtualCollectionElement extends HtmlElement implements Renderable {
}
void _onResize(_) {
- _height = getBoundingClientRect().height;
- _r.dirty();
+ final newHeight = getBoundingClientRect().height;
+ if (newHeight > _height) {
+ _height = newHeight;
+ _r.dirty();
+ }
}
}
« no previous file with comments | « runtime/observatory/lib/src/elements/class_view.dart ('k') | runtime/observatory/lib/src/elements/css/shared.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698