Title: [197102] releases/WebKitGTK/webkit-2.12/Source/WebInspectorUI
Revision
197102
Author
carlo...@webkit.org
Date
2016-02-25 05:24:28 -0800 (Thu, 25 Feb 2016)

Log Message

Web Inspector: Timelines sidebar and overview attempt to access undefined properties when FPS instrument is absent
https://bugs.webkit.org/show_bug.cgi?id=154567
<rdar://problem/24781536>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/TimelineOverview.js:
(WebInspector.TimelineOverview):
The viewMode property should be in a valid state before attempting
to access the current view mode settings.

* UserInterface/Views/TimelineSidebarPanel.js:
(WebInspector.TimelineSidebarPanel.prototype.get minimumWidth):
(WebInspector.TimelineSidebarPanel.prototype._updateViewModeIfNeeded):
(WebInspector.TimelineSidebarPanel):
Added missing checks for FPSInstrument support.

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.12/Source/WebInspectorUI/ChangeLog (197101 => 197102)


--- releases/WebKitGTK/webkit-2.12/Source/WebInspectorUI/ChangeLog	2016-02-25 13:21:30 UTC (rev 197101)
+++ releases/WebKitGTK/webkit-2.12/Source/WebInspectorUI/ChangeLog	2016-02-25 13:24:28 UTC (rev 197102)
@@ -1,3 +1,22 @@
+2016-02-22  Matt Baker  <mattba...@apple.com>
+
+        Web Inspector: Timelines sidebar and overview attempt to access undefined properties when FPS instrument is absent
+        https://bugs.webkit.org/show_bug.cgi?id=154567
+        <rdar://problem/24781536>
+
+        Reviewed by Joseph Pecoraro.
+
+        * UserInterface/Views/TimelineOverview.js:
+        (WebInspector.TimelineOverview):
+        The viewMode property should be in a valid state before attempting
+        to access the current view mode settings.
+
+        * UserInterface/Views/TimelineSidebarPanel.js:
+        (WebInspector.TimelineSidebarPanel.prototype.get minimumWidth):
+        (WebInspector.TimelineSidebarPanel.prototype._updateViewModeIfNeeded):
+        (WebInspector.TimelineSidebarPanel):
+        Added missing checks for FPSInstrument support.
+
 2016-02-22  Nikita Vasilyev  <nvasil...@apple.com>
 
         REGRESSION (r196620): Web Inspector: Filter bar in the left sidebar is 1px shorter than the console prompt

Modified: releases/WebKitGTK/webkit-2.12/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js (197101 => 197102)


--- releases/WebKitGTK/webkit-2.12/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js	2016-02-25 13:21:30 UTC (rev 197101)
+++ releases/WebKitGTK/webkit-2.12/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js	2016-02-25 13:24:28 UTC (rev 197102)
@@ -85,6 +85,7 @@
         this._mouseWheelDelta = 0;
         this._cachedScrollContainerWidth = NaN;
         this._timelineRulerSelectionChanged = false;
+        this._viewMode = WebInspector.TimelineOverview.ViewMode.Timelines;
 
         for (let instrument of this._recording.instruments)
             this._instrumentAdded(instrument);
@@ -92,7 +93,7 @@
         if (!WebInspector.timelineManager.isCapturingPageReload())
             this._resetSelection();
 
-        this.viewMode = WebInspector.TimelineOverview.ViewMode.Timelines;
+        this._viewModeDidChange();
     }
 
     // Public

Modified: releases/WebKitGTK/webkit-2.12/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.js (197101 => 197102)


--- releases/WebKitGTK/webkit-2.12/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.js	2016-02-25 13:21:30 UTC (rev 197101)
+++ releases/WebKitGTK/webkit-2.12/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.js	2016-02-25 13:24:28 UTC (rev 197102)
@@ -186,7 +186,7 @@
 
     get minimumWidth()
     {
-        if (this._viewModeNavigationBar)
+        if (WebInspector.FPSInstrument.supported())
             return Math.max(this._replayNavigationBar.minimumWidth, this._viewModeNavigationBar.minimumWidth);
         return this._replayNavigationBar.minimumWidth;
     }
@@ -899,6 +899,10 @@
 
     _refreshFrameSelectionChart()
     {
+        console.assert(WebInspector.FPSInstrument.supported());
+        if (!WebInspector.FPSInstrument.supported())
+            return;
+
         if (!this.visible)
             return;
 
@@ -1034,15 +1038,13 @@
 
         this._viewMode = newViewMode;
 
-        if (this._viewMode === WebInspector.TimelineOverview.ViewMode.Timelines) {
-            this._timelinesTreeOutline.hidden = false;
-            this._frameSelectionChartSection.collapsed = true;
-        } else {
-            this._timelinesTreeOutline.hidden = true;
-            this._frameSelectionChartSection.collapsed = false;
+        let isShowingTimelines = this._viewMode === WebInspector.TimelineOverview.ViewMode.Timelines;
+        this._timelinesTreeOutline.hidden = !isShowingTimelines;
+
+        if (WebInspector.FPSInstrument.supported()) {
+            this._frameSelectionChartSection.collapsed = isShowingTimelines;
+            this._viewModeNavigationBar.selectedNavigationItem = this._viewMode;
         }
-
-        this._viewModeNavigationBar.selectedNavigationItem = this._viewMode;
     }
 };
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to