Bug 146119 - Web Inspector: Layout & Rendering timeline should show paint and layout records in separate rows
Summary: Web Inspector: Layout & Rendering timeline should show paint and layout recor...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Matt Baker
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-06-18 12:47 PDT by Matt Baker
Modified: 2015-06-23 09:27 PDT (History)
9 users (show)

See Also:


Attachments
[Image] Proposed UI (133.06 KB, image/jpeg)
2015-06-18 12:47 PDT, Matt Baker
no flags Details
[Patch] WIP (7.79 KB, patch)
2015-06-19 19:46 PDT, Matt Baker
no flags Details | Formatted Diff | Diff
[Image] Two-row layout (266.69 KB, image/png)
2015-06-19 21:04 PDT, Matt Baker
no flags Details
[Image] Two-rows, more padding (197.30 KB, image/png)
2015-06-22 15:21 PDT, Matt Baker
no flags Details
[Image] One row, overlapping records (155.80 KB, image/jpeg)
2015-06-22 16:07 PDT, Matt Baker
no flags Details
[Patch] Proposed Fix (9.55 KB, patch)
2015-06-22 16:47 PDT, Matt Baker
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Baker 2015-06-18 12:47:40 PDT
Created attachment 255125 [details]
[Image] Proposed UI

* SUMMARY
Layout & Rendering timeline should show paint and layout records in separate rows.

The Rendering Frames timeline displays paint events in green to distinguish them from layout events. This needs to be carried over to the Layout & Rendering timeline for consistency. However, using two colors in the same graph presents a problem, since closely spaced "pills" are combined.

This can be solved by creating separate rows for each record type (see attached screenshot).
Comment 1 Timothy Hatcher 2015-06-18 12:49:58 PDT
I know I mentioned separate rows for the two, but perhaps they can overlap. I am not sure we will see overlapping pills. (Basically have two rows on top of each other.)
Comment 2 Matt Baker 2015-06-18 12:59:35 PDT
(In reply to comment #1)
> I know I mentioned separate rows for the two, but perhaps they can overlap.
> I am not sure we will see overlapping pills. (Basically have two rows on top
> of each other.)

As far as I know layout and paint events will never overlap in time, but zooming out far enough could cause the pills to overlap if we overlay the two rows on top of each other. This would look similar to overlapping bars on the Timeline Overview when a resource is collapsed.
Comment 3 Timothy Hatcher 2015-06-18 14:52:09 PDT
(In reply to comment #2)
> (In reply to comment #1)
> > I know I mentioned separate rows for the two, but perhaps they can overlap.
> > I am not sure we will see overlapping pills. (Basically have two rows on top
> > of each other.)
> 
> As far as I know layout and paint events will never overlap in time, but
> zooming out far enough could cause the pills to overlap if we overlay the
> two rows on top of each other. This would look similar to overlapping bars
> on the Timeline Overview when a resource is collapsed.

Might be worth trying both ways to see how they feel.
Comment 4 Matt Baker 2015-06-19 19:46:30 PDT
Created attachment 255270 [details]
[Patch] WIP
Comment 5 Radar WebKit Bug Importer 2015-06-19 19:46:42 PDT
<rdar://problem/21472448>
Comment 6 Matt Baker 2015-06-19 19:54:36 PDT
This WIP patch splits the Layout & Rendering timeline into two rows, with layout records in the top row. Placing layout above paint is meant to exploit the direction the eye travels on the screen (top to bottom) to reinforce the cause-effect relationship between layout and paint events.
Comment 7 Matt Baker 2015-06-19 20:01:17 PDT
Comment on attachment 255270 [details]
[Patch] WIP

View in context: https://bugs.webkit.org/attachment.cgi?id=255270&action=review

> Source/WebInspectorUI/UserInterface/Views/TimelineRecordBar.js:211
> +                this._element.classList.remove("paint");

TimelineRecordBar shouldn't have to query the layout record subtype and add/remove this additional class. This could be avoided by creating a timeline record type for paint records, distinct from TimelineRecord.Type.Layout. This could complicate code elsewhere in Timelines however, as there would no longer be a one-to-one mapping between TimelineRecord.Type and a Timeline object in a recording.
Comment 8 Matt Baker 2015-06-19 21:04:23 PDT
Created attachment 255274 [details]
[Image] Two-row layout

Screenshot from WIP patch
Comment 9 Timothy Hatcher 2015-06-22 09:56:04 PDT
Comment on attachment 255270 [details]
[Patch] WIP

View in context: https://bugs.webkit.org/attachment.cgi?id=255270&action=review

Looks good. I'd still be curious to see the bars overlapping. As-is there is a lot of space between the two rows or the rows are too tall. There should be good padding above and below the bars.

> Source/WebInspectorUI/UserInterface/Models/LayoutTimelineRecord.js:109
> +    get isPaint()

This should be a function, if it begins with "is".

>> Source/WebInspectorUI/UserInterface/Views/TimelineRecordBar.js:211
>> +                this._element.classList.remove("paint");
> 
> TimelineRecordBar shouldn't have to query the layout record subtype and add/remove this additional class. This could be avoided by creating a timeline record type for paint records, distinct from TimelineRecord.Type.Layout. This could complicate code elsewhere in Timelines however, as there would no longer be a one-to-one mapping between TimelineRecord.Type and a Timeline object in a recording.

You could just add/remove record.eventType as the class.
Comment 10 Matt Baker 2015-06-22 15:21:08 PDT
Created attachment 255374 [details]
[Image] Two-rows, more padding

Looking much better with extra padding. Layout & Paint overlayed to follow...
Comment 11 Timothy Hatcher 2015-06-22 15:49:53 PDT
That looks good with the padding.
Comment 12 Matt Baker 2015-06-22 16:07:17 PDT
Created attachment 255376 [details]
[Image] One row, overlapping records

I don't think this works quite as well as the two row option.
Comment 13 Timothy Hatcher 2015-06-22 16:17:41 PDT
I agree.
Comment 14 Matt Baker 2015-06-22 16:47:39 PDT
Created attachment 255378 [details]
[Patch] Proposed Fix
Comment 15 WebKit Commit Bot 2015-06-23 09:26:57 PDT
Comment on attachment 255378 [details]
[Patch] Proposed Fix

Clearing flags on attachment: 255378

Committed r185875: <http://trac.webkit.org/changeset/185875>
Comment 16 WebKit Commit Bot 2015-06-23 09:27:01 PDT
All reviewed patches have been landed.  Closing bug.