Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!-- | |
| 2 The common.js file must be included before this file. | |
| 3 | |
| 4 This in an HTML Import-able file that contains the definition | |
| 5 of the following elements: | |
| 6 | |
| 7 <fuzzer-stacktrace-sk> | |
| 8 | |
| 9 <fuzzer-stacktrace-sk> displays a strack trace showing the first 8 frames and can be expanded with a click. | |
| 10 | |
| 11 To use this file import it: | |
| 12 | |
| 13 <link href="/res/imp/fuzzer-stacktrace-sk.html" rel="import" /> | |
| 14 | |
| 15 Usage: | |
| 16 | |
| 17 <fuzzer-stacktrace-sk></fuzzer-stacktrace-sk> | |
| 18 | |
| 19 Properties: | |
| 20 trace - The stack trace object. Expected to be provided. Expected to have t he following attributes: | |
| 21 - frames: An array of elements with the following attributes: | |
| 22 - packageName : String | |
| 23 - fileName : String | |
| 24 - lineNumber : Number | |
| 25 - functionName [optional] | |
| 26 | |
| 27 Methods: | |
| 28 None. | |
| 29 | |
| 30 Events: | |
| 31 None. | |
| 32 --> | |
| 33 <link rel="import" href="/res/imp/bower_components/iron-flex-layout/iron-flex-la yout.html"> | |
|
jcgregorio
2015/11/05 21:23:37
I don't think this is used anywhere.
KevinL
2015/11/06 13:56:54
You are correct - removed.
| |
| 34 <link rel="import" href="/res/imp/bower_components/iron-icons/iron-icons.html"> | |
| 35 <dom-module id="fuzzer-stacktrace-sk"> | |
| 36 <template> | |
| 37 <style> | |
| 38 .stacktrace{ | |
| 39 padding:4px 8px; | |
| 40 } | |
| 41 .frame { | |
| 42 padding:2px 10px; | |
| 43 border-radius:8px; | |
| 44 margin:1px; | |
| 45 } | |
| 46 .frame:nth-child(odd) { | |
| 47 background-color:#EEE; | |
| 48 } | |
| 49 .frame:nth-child(even) { | |
| 50 background-color:#DDF; | |
|
jcgregorio
2015/11/05 21:23:37
Alternating rows of #fff and #eee would be more re
KevinL
2015/11/06 13:56:54
Done.
| |
| 51 } | |
| 52 #expand{ | |
| 53 cursor:pointer; | |
| 54 /*Make this a bit bigger than normal (24px) */ | |
| 55 --iron-icon-height: 30px; | |
| 56 --iron-icon-width: 30px; | |
| 57 } | |
| 58 .hidden{ | |
| 59 display:none; | |
| 60 } | |
| 61 </style> | |
| 62 <div class="stacktrace"> | |
| 63 <template is="dom-repeat" items="{{frames}}" as="frame"> | |
| 64 <div class="frame"> | |
|
jcgregorio
2015/11/05 21:23:37
Can you make this a table so all the function name
KevinL
2015/11/06 13:56:54
Done.
| |
| 65 <span>{{frame.packageName}}{{frame.fileName}}:{{frame.lineNumber}}<spa n> | |
| 66 <template is="dom-if" if="{{frame.functionName}}"> | |
| 67 <span> --- {{frame.functionName}}</span> | |
| 68 </template> | |
| 69 </div> | |
| 70 </template> | |
| 71 | |
| 72 <iron-icon role="button" id="expand" icon="icons:more-horiz" on-click="showM ore" title="expand stacktrace"></iron-icon> | |
|
jcgregorio
2015/11/05 21:23:37
Making this an icon-button will make it clearer th
KevinL
2015/11/06 13:56:54
Changed to icon-button. I like the icon over the
| |
| 73 | |
| 74 <div> | |
| 75 </template> | |
| 76 | |
| 77 <script> | |
| 78 Polymer({ | |
| 79 is: 'fuzzer-stacktrace-sk', | |
| 80 | |
| 81 properties: { | |
| 82 trace: { | |
| 83 type: Object, | |
| 84 value: function() { return {}; }, | |
| 85 }, | |
| 86 expanded: { | |
| 87 type: Boolean, | |
| 88 value: false | |
| 89 }, | |
| 90 frames: { | |
| 91 type: Array, | |
| 92 computed: "_getStackFrames(trace, expanded)" | |
| 93 } | |
| 94 }, | |
| 95 | |
| 96 setStackTrace: function(trace) { | |
| 97 this.trace = trace; | |
| 98 }, | |
| 99 | |
| 100 _getStackFrames: function(trace, expanded) { | |
| 101 if (expanded || trace.frames.length < 8) { | |
| 102 return trace.frames; | |
| 103 } | |
| 104 return trace.frames.slice(0, 8); | |
| 105 }, | |
| 106 showMore: function() { | |
|
jcgregorio
2015/11/05 21:23:37
Blank line above this.
KevinL
2015/11/06 13:56:54
Done.
| |
| 107 this.expanded = true; | |
| 108 this.$.expand.toggleClass("hidden"); | |
| 109 } | |
| 110 }); | |
| 111 </script | |
| 112 </dom-module id="fuzzer-stacktrace-sk"> | |
| OLD | NEW |