Title: [191770] trunk/Source/WebInspectorUI
Revision
191770
Author
[email protected]
Date
2015-10-29 18:33:00 -0700 (Thu, 29 Oct 2015)

Log Message

Web Inspector: Make use of other Timer details in Timeline (timeout, singleShot)
https://bugs.webkit.org/show_bug.cgi?id=150697

Reviewed by Timothy Hatcher.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Controllers/TimelineManager.js:
(WebInspector.TimelineManager.prototype._processRecord):
Create a small object for timer details.

* UserInterface/Models/ScriptTimelineRecord.js:
(WebInspector.ScriptTimelineRecord.EventType.displayName):
New details object requires new path to timer identifier.

* UserInterface/Views/ScriptTimelineView.css:
(.sidebar > .panel.navigation.timeline:not(.timeline-recording-content-view-showing) .navigation-sidebar-panel-content-tree-outline.script .item .alternate-subtitle):
(.navigation-sidebar-panel-content-tree-outline .item .alternate-subtitle):
(.navigation-sidebar-panel-content-tree-outline:matches(:focus, .force-focus) .item.selected .alternate-subtitle):
(.navigation-sidebar-panel-content-tree-outline .item.small:not(.two-line) .alternate-subtitle::before):
Styles for an alternate-subtitle, a subtitle to show when the timeline
content view is showing and not a resource content view.

* UserInterface/Views/TimelineRecordTreeElement.js:
(WebInspector.TimelineRecordTreeElement):
Create alternate subtitle for Timers with the timeout millisecond details.
Differentiate between setTimeout / setInterval.

* UserInterface/Views/ScriptTimelineDataGridNode.js:
(WebInspector.ScriptTimelineDataGridNode.prototype.createCellContent): Deleted.
(WebInspector.ScriptTimelineDataGridNode): Deleted.
Remove dead code. Normally there would be a filter / scope bar for an eventType
column but no such column exists.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (191769 => 191770)


--- trunk/Source/WebInspectorUI/ChangeLog	2015-10-30 01:31:43 UTC (rev 191769)
+++ trunk/Source/WebInspectorUI/ChangeLog	2015-10-30 01:33:00 UTC (rev 191770)
@@ -1,5 +1,40 @@
 2015-10-29  Joseph Pecoraro  <[email protected]>
 
+        Web Inspector: Make use of other Timer details in Timeline (timeout, singleShot)
+        https://bugs.webkit.org/show_bug.cgi?id=150697
+
+        Reviewed by Timothy Hatcher.
+
+        * Localizations/en.lproj/localizedStrings.js:
+        * UserInterface/Controllers/TimelineManager.js:
+        (WebInspector.TimelineManager.prototype._processRecord):
+        Create a small object for timer details.
+
+        * UserInterface/Models/ScriptTimelineRecord.js:
+        (WebInspector.ScriptTimelineRecord.EventType.displayName):
+        New details object requires new path to timer identifier.
+
+        * UserInterface/Views/ScriptTimelineView.css:
+        (.sidebar > .panel.navigation.timeline:not(.timeline-recording-content-view-showing) .navigation-sidebar-panel-content-tree-outline.script .item .alternate-subtitle):
+        (.navigation-sidebar-panel-content-tree-outline .item .alternate-subtitle):
+        (.navigation-sidebar-panel-content-tree-outline:matches(:focus, .force-focus) .item.selected .alternate-subtitle):
+        (.navigation-sidebar-panel-content-tree-outline .item.small:not(.two-line) .alternate-subtitle::before):
+        Styles for an alternate-subtitle, a subtitle to show when the timeline
+        content view is showing and not a resource content view.
+
+        * UserInterface/Views/TimelineRecordTreeElement.js:
+        (WebInspector.TimelineRecordTreeElement):
+        Create alternate subtitle for Timers with the timeout millisecond details.
+        Differentiate between setTimeout / setInterval.
+
+        * UserInterface/Views/ScriptTimelineDataGridNode.js:
+        (WebInspector.ScriptTimelineDataGridNode.prototype.createCellContent): Deleted.
+        (WebInspector.ScriptTimelineDataGridNode): Deleted.
+        Remove dead code. Normally there would be a filter / scope bar for an eventType
+        column but no such column exists.
+
+2015-10-29  Joseph Pecoraro  <[email protected]>
+
         Web Inspector: Display console.timeStamp(title) title in timeline markers
         https://bugs.webkit.org/show_bug.cgi?id=150691
 

Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (191769 => 191770)


--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js	2015-10-30 01:31:43 UTC (rev 191769)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js	2015-10-30 01:33:00 UTC (rev 191770)
@@ -31,6 +31,8 @@
 localizedStrings["%s Event Dispatched"] = "%s Event Dispatched";
 localizedStrings["%s Prototype"] = "%s Prototype";
 localizedStrings["%s \u2014 %s"] = "%s \u2014 %s";
+localizedStrings["%s delay"] = "%s delay";
+localizedStrings["%s interval"] = "%s interval";
 localizedStrings["(Index)"] = "(Index)";
 localizedStrings["(anonymous function)"] = "(anonymous function)";
 localizedStrings["(many)"] = "(many)";

Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js (191769 => 191770)


--- trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js	2015-10-30 01:31:43 UTC (rev 191769)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js	2015-10-30 01:33:00 UTC (rev 191770)
@@ -394,8 +394,8 @@
             console.assert(isNaN(endTime));
 
             // Pass the startTime as the endTime since this record type has no duration.
-            // FIXME: Make use of "timeout" and "singleShot" payload properties.
-            return new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.TimerInstalled, startTime, startTime, callFrames, sourceCodeLocation, recordPayload.data.timerId);
+            let timerDetails = {timerId: recordPayload.data.timerId, timeout: recordPayload.data.timeout, repeating: !recordPayload.data.singleShot};
+            return new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.TimerInstalled, startTime, startTime, callFrames, sourceCodeLocation, timerDetails);
 
         case TimelineAgent.EventType.TimerRemove:
             console.assert(isNaN(endTime));

Modified: trunk/Source/WebInspectorUI/UserInterface/Models/ScriptTimelineRecord.js (191769 => 191770)


--- trunk/Source/WebInspectorUI/UserInterface/Models/ScriptTimelineRecord.js	2015-10-30 01:31:43 UTC (rev 191769)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/ScriptTimelineRecord.js	2015-10-30 01:33:00 UTC (rev 191770)
@@ -358,7 +358,7 @@
         return WebInspector.UIString("Timer Fired");
     case WebInspector.ScriptTimelineRecord.EventType.TimerInstalled:
         if (details && includeDetailsInMainTitle)
-            return WebInspector.UIString("Timer %s Installed").format(details);
+            return WebInspector.UIString("Timer %s Installed").format(details.timerId);
         return WebInspector.UIString("Timer Installed");
     case WebInspector.ScriptTimelineRecord.EventType.TimerRemoved:
         if (details && includeDetailsInMainTitle)

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineView.css (191769 => 191770)


--- trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineView.css	2015-10-30 01:31:43 UTC (rev 191769)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineView.css	2015-10-30 01:33:00 UTC (rev 191770)
@@ -38,3 +38,19 @@
 .sidebar > .panel.navigation.timeline.timeline-recording-content-view-showing .navigation-sidebar-panel-content-tree-outline.script .item .subtitle {
     display: none;
 }
+
+.sidebar > .panel.navigation.timeline:not(.timeline-recording-content-view-showing) .navigation-sidebar-panel-content-tree-outline.script .item .alternate-subtitle {
+    display: none;
+}
+
+.navigation-sidebar-panel-content-tree-outline .item .alternate-subtitle {
+    color: hsla(0, 0%, 0%, 0.7);
+}
+
+.navigation-sidebar-panel-content-tree-outline:matches(:focus, .force-focus) .item.selected .alternate-subtitle {
+    color: hsla(0, 0%, 100%, 0.9);
+}
+
+.navigation-sidebar-panel-content-tree-outline .item.small:not(.two-line) .alternate-subtitle::before {
+    content: " — ";
+}

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordTreeElement.js (191769 => 191770)


--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordTreeElement.js	2015-10-30 01:31:43 UTC (rev 191769)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordTreeElement.js	2015-10-30 01:33:00 UTC (rev 191770)
@@ -32,7 +32,8 @@
         sourceCodeLocation = sourceCodeLocation || timelineRecord.sourceCodeLocation || null;
 
         var title = "";
-        var subtitle = "";
+        var subtitle = null;
+        var alternateSubtitle = null;
 
         if (sourceCodeLocation) {
             subtitle = document.createElement("span");
@@ -90,8 +91,20 @@
             case WebInspector.ScriptTimelineRecord.EventType.GarbageCollected:
                 iconStyleClass = WebInspector.TimelineRecordTreeElement.GarbageCollectionIconStyleClass;
                 break;
+            case WebInspector.ScriptTimelineRecord.EventType.TimerInstalled:
+                if (includeDetailsInMainTitle) {
+                    let timeoutString =  Number.secondsToString(timelineRecord.details.timeout / 1000);
+                    alternateSubtitle = subtitle.appendChild(document.createElement("span"));
+                    alternateSubtitle.classList.add("alternate-subtitle");
+                    if (timelineRecord.details.repeating)
+                        alternateSubtitle.textContent = WebInspector.UIString("%s interval").format(timeoutString);
+                    else
+                        alternateSubtitle.textContent = WebInspector.UIString("%s delay").format(timeoutString);
+                }
+
+                iconStyleClass = WebInspector.TimelineRecordTreeElement.TimerRecordIconStyleClass;
+                break;
             case WebInspector.ScriptTimelineRecord.EventType.TimerFired:
-            case WebInspector.ScriptTimelineRecord.EventType.TimerInstalled:
             case WebInspector.ScriptTimelineRecord.EventType.TimerRemoved:
                 iconStyleClass = WebInspector.TimelineRecordTreeElement.TimerRecordIconStyleClass;
                 break;
@@ -124,6 +137,9 @@
 
         if (this._sourceCodeLocation)
             this.tooltipHandledSeparately = true;
+
+        if (alternateSubtitle)
+            this.titlesElement.appendChild(alternateSubtitle);
     }
 
     // Public
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to