@@ -85,13 +85,14 @@ var ProfilerTemplates = function()
8585 var profiler_event_decl = style_sheets . getDeclaration ( ".profiler-event" ) ;
8686 var profiler_event_small_decl = style_sheets . getDeclaration ( ".profiler-event-small" ) ;
8787 var profiler_timeline_row_decl = style_sheets . getDeclaration ( ".profiler-timeline-row" ) ;
88- var EVENT_MIN_WIDTH = profiler_event_decl ? parseInt ( profiler_event_decl . minWidth ) : 0 ;
89- var EVENT_SMALL_MIN_WIDTH = profiler_event_decl ? parseInt ( profiler_event_small_decl . minWidth ) : 0 ;
90- var BAR_HEIGHT = profiler_timeline_row_decl
91- ? ( parseInt ( style_sheets . getDeclaration ( ".profiler-timeline-row" ) . height ) +
92- parseInt ( style_sheets . getDeclaration ( ".profiler-timeline-row" ) . paddingTop ) +
93- parseInt ( style_sheets . getDeclaration ( ".profiler-timeline-row" ) . paddingBottom ) )
94- : 0 ;
88+ var EVENT_MIN_WIDTH = profiler_event_decl ? parseInt ( profiler_event_decl . minWidth ) : 1 ;
89+ var EVENT_SMALL_MIN_WIDTH = profiler_event_decl ? parseInt ( profiler_event_small_decl . minWidth ) : 1 ;
90+ var EVENT_HEIGHT = profiler_timeline_row_decl
91+ ? ( parseInt ( style_sheets . getDeclaration ( ".profiler-timeline-row" ) . height ) +
92+ parseInt ( style_sheets . getDeclaration ( ".profiler-timeline-row" ) . paddingTop ) +
93+ parseInt ( style_sheets . getDeclaration ( ".profiler-timeline-row" ) . paddingBottom ) )
94+ : 1 ;
95+ var EVENT_SMALL_HEIGHT = profiler_event_decl ? parseInt ( profiler_event_small_decl . height ) : 1 ;
9596
9697 var MIN_DURATION = ProfilerView . MIN_DURATION ;
9798
@@ -227,8 +228,8 @@ var ProfilerTemplates = function()
227228 "style" ,
228229 "width: " + width + "px; " +
229230 "left: " + left + "px; " +
230- "top: " + ( column * 3 + 1 ) + "px;" , // TODO: 3 -> constant
231- "class" , "profiler-event-small event-type-" + event . type + "-selftime" // FIXME: not actually selftime
231+ "top: " + ( column * EVENT_SMALL_HEIGHT ) + "px;" ,
232+ "class" , "profiler-event-small event-type-" + event . type + "-selftime" // not actually selftime, just using that color
232233 ]
233234 ) ;
234235 } ;
@@ -249,7 +250,7 @@ var ProfilerTemplates = function()
249250 "style" ,
250251 "width: " + width + "px; " +
251252 "left: " + left + "px; " +
252- "top: " + ( column * BAR_HEIGHT + 1 ) + "px; " +
253+ "top: " + ( column * EVENT_HEIGHT ) + "px; " +
253254 ( width > 46340 ? ( "background-size: " + Math . floor ( 46340 / width * 100 ) + "%; " ) : "" ) + // workaround for CORE-48579
254255 ( HAS_UNPREFIXED_GRADIENTS
255256 ? "background-image: linear-gradient(0deg, transparent 0, rgba(255, 255, 255, .25) 100%), " +
0 commit comments