OLD | NEW |
| (Empty) |
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 | |
3 // BSD-style license that can be found in the LICENSE file. | |
4 | |
5 import 'dart:html'; | |
6 | |
7 import 'package:observatory/app.dart'; | |
8 import 'package:observatory/service.dart'; | |
9 import 'package:observatory/repositories.dart'; | |
10 import 'package:observatory/src/elements/helpers/tag.dart'; | |
11 import 'package:observatory/src/elements/object_common.dart'; | |
12 import 'package:observatory/src/elements/shims/binding.dart'; | |
13 | |
14 @bindable | |
15 class ObjectCommonElementWrapper extends HtmlElement { | |
16 | |
17 static const binder = const Binder<ObjectCommonElementWrapper>(const { | |
18 'object': #object | |
19 }); | |
20 | |
21 static const tag = const Tag<ObjectCommonElementWrapper>('object-common'); | |
22 | |
23 HeapObject _object; | |
24 | |
25 HeapObject get object => _object; | |
26 | |
27 void set object(HeapObject value) { | |
28 _object = value; | |
29 render(); | |
30 } | |
31 | |
32 ObjectCommonElementWrapper.created() : super.created() { | |
33 binder.registerCallback(this); | |
34 createShadowRoot(); | |
35 render(); | |
36 } | |
37 | |
38 @override | |
39 void attached() { | |
40 super.attached(); | |
41 render(); | |
42 } | |
43 | |
44 void render() { | |
45 shadowRoot.children = []; | |
46 if (_object == null) { | |
47 return; | |
48 } | |
49 | |
50 shadowRoot.children = [ | |
51 new StyleElement() | |
52 ..text = ''' | |
53 object-common-wrapped a[href]:hover { | |
54 text-decoration: underline; | |
55 } | |
56 object-common-wrapped a[href] { | |
57 color: #0489c3; | |
58 text-decoration: none; | |
59 } | |
60 object-common-wrapped .memberList { | |
61 display: table; | |
62 } | |
63 object-common-wrapped .memberItem { | |
64 display: table-row; | |
65 } | |
66 object-common-wrapped .memberName, | |
67 object-common-wrapped .memberValue { | |
68 display: table-cell; | |
69 vertical-align: top; | |
70 padding: 3px 0 3px 1em; | |
71 font: 400 14px 'Montserrat', sans-serif; | |
72 } | |
73 object-common-wrapped button:hover { | |
74 background-color: transparent; | |
75 border: none; | |
76 text-decoration: underline; | |
77 } | |
78 | |
79 object-common-wrapped button { | |
80 background-color: transparent; | |
81 border: none; | |
82 color: #0489c3; | |
83 padding: 0; | |
84 margin: -8px 4px; | |
85 font-size: 20px; | |
86 text-decoration: none; | |
87 } | |
88 object-common-wrapped .indent { | |
89 margin-left: 1.5em; | |
90 font: 400 14px 'Montserrat', sans-serif; | |
91 line-height: 150%; | |
92 } | |
93 object-common-wrapped .stackTraceBox { | |
94 margin-left: 1.5em; | |
95 background-color: #f5f5f5; | |
96 border: 1px solid #ccc; | |
97 padding: 10px; | |
98 font-family: consolas, courier, monospace; | |
99 font-size: 12px; | |
100 white-space: pre; | |
101 overflow-x: auto; | |
102 }''', | |
103 new ObjectCommonElement(_object.isolate, _object, | |
104 new RetainedSizeRepository(), | |
105 new ReachableSizeRepository(), | |
106 new InboundReferencesRepository(), | |
107 new RetainingPathRepository(), | |
108 new InstanceRepository(), | |
109 queue: ObservatoryApplication.app.queue) | |
110 ]; | |
111 } | |
112 } | |
OLD | NEW |