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