Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Web Inspector: Have separate path component for Script Timeline conte…
…nt views

https://bugs.webkit.org/show_bug.cgi?id=155075
<rdar://problem/24996564>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-03-05
Reviewed by Timothy Hatcher.

* UserInterface/Images/CallTrees.svg: Added.
* UserInterface/Images/Events.svg: Added.
New icons based off of ResultLine.svg.

* UserInterface/Views/PathComponentIcons.css:
(.events-icon .icon):
(.call-trees-icon .icon):
(body:not(.mac-platform, .windows-platform) .call-trees-icon .icon):
Use the new icons and fallback to ResultLine.svg for other ports.

* UserInterface/Views/ScriptClusterTimelineView.js:
(WebInspector.ScriptClusterTimelineView):
(WebInspector.ScriptClusterTimelineView.prototype.get eventsContentView):
(WebInspector.ScriptClusterTimelineView.prototype.showEvents):
(WebInspector.ScriptClusterTimelineView.prototype.showProfile):
(WebInspector.ScriptClusterTimelineView.prototype._pathComponentForContentView):
(WebInspector.ScriptClusterTimelineView.prototype._identifierForContentView):
(WebInspector.ScriptClusterTimelineView.prototype._showContentViewForIdentifier):
(WebInspector.ScriptClusterTimelineView.prototype._scriptClusterViewCurrentContentViewDidChange):
(WebInspector.ScriptClusterTimelineView.prototype.get detailsContentView): Deleted.
(WebInspector.ScriptClusterTimelineView.prototype.showDetails): Deleted.
Rename "Details" to "Events".

* UserInterface/Views/TimelineRecordingContentView.js:
(WebInspector.TimelineRecordingContentView.prototype.contentBrowserTreeElementForRepresentedObject): Deleted.
Always include the top level "Details" component.

Canonical link: https://commits.webkit.org/173159@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197625 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
JosephPecoraro authored and webkit-commit-queue committed Mar 6, 2016
1 parent 6b646a8 commit 303ffae
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 24 deletions.
35 changes: 35 additions & 0 deletions Source/WebInspectorUI/ChangeLog
@@ -1,3 +1,38 @@
2016-03-05 Joseph Pecoraro <pecoraro@apple.com>

Web Inspector: Have separate path component for Script Timeline content views
https://bugs.webkit.org/show_bug.cgi?id=155075
<rdar://problem/24996564>

Reviewed by Timothy Hatcher.

* UserInterface/Images/CallTrees.svg: Added.
* UserInterface/Images/Events.svg: Added.
New icons based off of ResultLine.svg.

* UserInterface/Views/PathComponentIcons.css:
(.events-icon .icon):
(.call-trees-icon .icon):
(body:not(.mac-platform, .windows-platform) .call-trees-icon .icon):
Use the new icons and fallback to ResultLine.svg for other ports.

* UserInterface/Views/ScriptClusterTimelineView.js:
(WebInspector.ScriptClusterTimelineView):
(WebInspector.ScriptClusterTimelineView.prototype.get eventsContentView):
(WebInspector.ScriptClusterTimelineView.prototype.showEvents):
(WebInspector.ScriptClusterTimelineView.prototype.showProfile):
(WebInspector.ScriptClusterTimelineView.prototype._pathComponentForContentView):
(WebInspector.ScriptClusterTimelineView.prototype._identifierForContentView):
(WebInspector.ScriptClusterTimelineView.prototype._showContentViewForIdentifier):
(WebInspector.ScriptClusterTimelineView.prototype._scriptClusterViewCurrentContentViewDidChange):
(WebInspector.ScriptClusterTimelineView.prototype.get detailsContentView): Deleted.
(WebInspector.ScriptClusterTimelineView.prototype.showDetails): Deleted.
Rename "Details" to "Events".

* UserInterface/Views/TimelineRecordingContentView.js:
(WebInspector.TimelineRecordingContentView.prototype.contentBrowserTreeElementForRepresentedObject): Deleted.
Always include the top level "Details" component.

2016-03-05 Joseph Pecoraro <pecoraro@apple.com>

Web Inspector: Add back support for a heavy / bottom up profile view
Expand Down
10 changes: 10 additions & 0 deletions Source/WebInspectorUI/UserInterface/Images/CallTrees.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions Source/WebInspectorUI/UserInterface/Images/Events.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions Source/WebInspectorUI/UserInterface/Views/PathComponentIcons.css
Expand Up @@ -74,3 +74,17 @@
.program-icon .icon {
content: url(../Images/Program.svg);
}

.events-icon .icon {
content: url(../Images/Events.svg);
}

.call-trees-icon .icon {
content: url(../Images/CallTrees.svg);
}

/* FIXME: <https://webkit.org/b/155077> [GTK] Web Inspector: Add new GTK+ icons for different Script Timeline Views */
body:not(.mac-platform, .windows-platform) .events-icon .icon,
body:not(.mac-platform, .windows-platform) .call-trees-icon .icon {
content: url(../Images/ResultLine.svg);
}
Expand Up @@ -33,7 +33,7 @@ WebInspector.ScriptClusterTimelineView = class ScriptClusterTimelineView extends

this._extraArguments = extraArguments;

this._currentContentViewSetting = new WebInspector.Setting("script-cluster-timeline-view-current-view", WebInspector.ScriptClusterTimelineView.DetailsIdentifier);
this._currentContentViewSetting = new WebInspector.Setting("script-cluster-timeline-view-current-view", WebInspector.ScriptClusterTimelineView.EventsIdentifier);

let showSelectorArrows = this._canShowProfileView();
function createPathComponent(displayName, className, identifier)
Expand All @@ -43,17 +43,16 @@ WebInspector.ScriptClusterTimelineView = class ScriptClusterTimelineView extends
return pathComponent;
}

let iconClassName = WebInspector.TimelineTabContentView.iconClassNameForTimeline(timeline);
this._detailsPathComponent = createPathComponent.call(this, WebInspector.UIString("Details"), iconClassName, WebInspector.ScriptClusterTimelineView.DetailsIdentifier);
this._profilePathComponent = createPathComponent.call(this, WebInspector.UIString("Call Trees"), iconClassName, WebInspector.ScriptClusterTimelineView.ProfileIdentifier);
this._eventsPathComponent = createPathComponent.call(this, WebInspector.UIString("Events"), "events-icon", WebInspector.ScriptClusterTimelineView.EventsIdentifier);
this._profilePathComponent = createPathComponent.call(this, WebInspector.UIString("Call Trees"), "call-trees-icon", WebInspector.ScriptClusterTimelineView.ProfileIdentifier);

if (this._canShowProfileView()) {
this._detailsPathComponent.nextSibling = this._profilePathComponent;
this._profilePathComponent.previousSibling = this._detailsPathComponent;
this._eventsPathComponent.nextSibling = this._profilePathComponent;
this._profilePathComponent.previousSibling = this._eventsPathComponent;
}

// FIXME: We should be able to create these lazily.
this._detailsContentView = new WebInspector.ScriptDetailsTimelineView(this.representedObject, this._extraArguments);
this._eventsContentView = new WebInspector.ScriptDetailsTimelineView(this.representedObject, this._extraArguments);
this._profileContentView = this._canShowProfileView() ? new WebInspector.ScriptProfileTimelineView(this.representedObject, this._extraArguments) : null;

this._showContentViewForIdentifier(this._currentContentViewSetting.value);
Expand All @@ -79,9 +78,9 @@ WebInspector.ScriptClusterTimelineView = class ScriptClusterTimelineView extends

// Public

get detailsContentView()
get eventsContentView()
{
return this._detailsContentView;
return this._eventsContentView;
}

get profileContentView()
Expand Down Expand Up @@ -112,15 +111,15 @@ WebInspector.ScriptClusterTimelineView = class ScriptClusterTimelineView extends
this._showContentViewForIdentifier(cookie[WebInspector.ScriptClusterTimelineView.ContentViewIdentifierCookieKey]);
}

showDetails()
showEvents()
{
return this._showContentViewForIdentifier(WebInspector.ScriptClusterTimelineView.DetailsIdentifier);
return this._showContentViewForIdentifier(WebInspector.ScriptClusterTimelineView.EventsIdentifier);
}

showProfile()
{
if (!this._canShowProfileView())
return showDetails();
return this.showEvents();

return this._showContentViewForIdentifier(WebInspector.ScriptClusterTimelineView.ProfileIdentifier);
}
Expand All @@ -138,8 +137,8 @@ WebInspector.ScriptClusterTimelineView = class ScriptClusterTimelineView extends
console.assert(contentView);
if (!contentView)
return null;
if (contentView === this._detailsContentView)
return this._detailsPathComponent;
if (contentView === this._eventsContentView)
return this._eventsPathComponent;
if (contentView === this._profileContentView)
return this._profilePathComponent;
console.error("Unknown contentView.");
Expand All @@ -151,8 +150,8 @@ WebInspector.ScriptClusterTimelineView = class ScriptClusterTimelineView extends
console.assert(contentView);
if (!contentView)
return null;
if (contentView === this._detailsContentView)
return WebInspector.ScriptClusterTimelineView.DetailsIdentifier;
if (contentView === this._eventsContentView)
return WebInspector.ScriptClusterTimelineView.EventsIdentifier;
if (contentView === this._profileContentView)
return WebInspector.ScriptClusterTimelineView.ProfileIdentifier;
console.error("Unknown contentView.");
Expand All @@ -164,16 +163,16 @@ WebInspector.ScriptClusterTimelineView = class ScriptClusterTimelineView extends
let contentViewToShow = null;

switch (identifier) {
case WebInspector.ScriptClusterTimelineView.DetailsIdentifier:
contentViewToShow = this.detailsContentView;
case WebInspector.ScriptClusterTimelineView.EventsIdentifier:
contentViewToShow = this.eventsContentView;
break;
case WebInspector.ScriptClusterTimelineView.ProfileIdentifier:
contentViewToShow = this.profileContentView;
break;
}

if (!contentViewToShow)
contentViewToShow = this.detailsContentView;
contentViewToShow = this.eventsContentView;

console.assert(contentViewToShow);

Expand All @@ -190,7 +189,7 @@ WebInspector.ScriptClusterTimelineView = class ScriptClusterTimelineView extends
_scriptClusterViewCurrentContentViewDidChange(event)
{
let currentContentView = this._contentViewContainer.currentContentView;
let previousContentView = currentContentView === this._detailsContentView ? this._profileContentView : this._detailsContentView;
let previousContentView = currentContentView === this._eventsContentView ? this._profileContentView : this._eventsContentView;

currentContentView.zeroTime = previousContentView.zeroTime;
currentContentView.startTime = previousContentView.startTime;
Expand All @@ -203,5 +202,5 @@ WebInspector.ScriptClusterTimelineView = class ScriptClusterTimelineView extends

WebInspector.ScriptClusterTimelineView.ContentViewIdentifierCookieKey = "script-cluster-timeline-view-identifier";

WebInspector.ScriptClusterTimelineView.DetailsIdentifier = "details";
WebInspector.ScriptClusterTimelineView.EventsIdentifier = "events";
WebInspector.ScriptClusterTimelineView.ProfileIdentifier = "profile";
Expand Up @@ -337,9 +337,6 @@ WebInspector.TimelineRecordingContentView = class TimelineRecordingContentView e
if (!(representedObject instanceof WebInspector.Timeline) && !(representedObject instanceof WebInspector.TimelineRecording))
return null;

if (this.currentTimelineView instanceof WebInspector.ClusterContentView)
return null;

let iconClassName;
let title;
if (representedObject instanceof WebInspector.Timeline) {
Expand Down

0 comments on commit 303ffae

Please sign in to comment.