Title: [241750] trunk/Source/WebInspectorUI
Revision
241750
Author
commit-qu...@webkit.org
Date
2019-02-18 16:52:40 -0800 (Mon, 18 Feb 2019)

Log Message

Web Inspector: Provide a way to avoid a recording auto-stop on reload
https://bugs.webkit.org/show_bug.cgi?id=194793

Patch by Joseph Pecoraro <pecor...@apple.com> on 2019-02-18
Reviewed by Matt Baker.

* Localizations/en.lproj/localizedStrings.js:
New tooltip.

* UserInterface/Controllers/TimelineManager.js:
(WI.TimelineManager.prototype.willAutoStop):
(WI.TimelineManager.prototype.relaxAutoStop):
Getter and relaxer for auto stop behavior.

* UserInterface/Views/AuditNavigationSidebarPanel.js:
(WI.AuditNavigationSidebarPanel.prototype.showDefaultContentView):
Drive-by fix some whitespace issues.

* UserInterface/Views/TimelineTabContentView.js:
(WI.TimelineTabContentView):
(WI.TimelineTabContentView.prototype._showRecordButton):
(WI.TimelineTabContentView.prototype._showContinueButton):
(WI.TimelineTabContentView.prototype._updateNavigationBarButtons):
(WI.TimelineTabContentView.prototype._capturingStartedOrStopped):
(WI.TimelineTabContentView.prototype._globalModifierKeysDidChange):
(WI.TimelineTabContentView.prototype._continueButtonClicked):
Show a "continue" like icon instead of the usual stop button when
a recording would auto-stop and the alt key is down. When pressed
this button will relax the auto-stop and continue the recording
until explicitly stopped by the user.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (241749 => 241750)


--- trunk/Source/WebInspectorUI/ChangeLog	2019-02-19 00:43:40 UTC (rev 241749)
+++ trunk/Source/WebInspectorUI/ChangeLog	2019-02-19 00:52:40 UTC (rev 241750)
@@ -1,5 +1,37 @@
 2019-02-18  Joseph Pecoraro  <pecor...@apple.com>
 
+        Web Inspector: Provide a way to avoid a recording auto-stop on reload
+        https://bugs.webkit.org/show_bug.cgi?id=194793
+
+        Reviewed by Matt Baker.
+
+        * Localizations/en.lproj/localizedStrings.js:
+        New tooltip.
+
+        * UserInterface/Controllers/TimelineManager.js:
+        (WI.TimelineManager.prototype.willAutoStop):
+        (WI.TimelineManager.prototype.relaxAutoStop):
+        Getter and relaxer for auto stop behavior.
+
+        * UserInterface/Views/AuditNavigationSidebarPanel.js:
+        (WI.AuditNavigationSidebarPanel.prototype.showDefaultContentView):
+        Drive-by fix some whitespace issues.
+
+        * UserInterface/Views/TimelineTabContentView.js:
+        (WI.TimelineTabContentView):
+        (WI.TimelineTabContentView.prototype._showRecordButton):
+        (WI.TimelineTabContentView.prototype._showContinueButton):
+        (WI.TimelineTabContentView.prototype._updateNavigationBarButtons):
+        (WI.TimelineTabContentView.prototype._capturingStartedOrStopped):
+        (WI.TimelineTabContentView.prototype._globalModifierKeysDidChange):
+        (WI.TimelineTabContentView.prototype._continueButtonClicked):
+        Show a "continue" like icon instead of the usual stop button when
+        a recording would auto-stop and the alt key is down. When pressed
+        this button will relax the auto-stop and continue the recording
+        until explicitly stopped by the user.
+
+2019-02-18  Joseph Pecoraro  <pecor...@apple.com>
+
         Web Inspector: Fix a typo causing assertions in ConsoleManager
         https://bugs.webkit.org/show_bug.cgi?id=194792
 

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


--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js	2019-02-19 00:43:40 UTC (rev 241749)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js	2019-02-19 00:52:40 UTC (rev 241750)
@@ -253,6 +253,7 @@
 localizedStrings["Continuation Frame"] = "Continuation Frame";
 localizedStrings["Continue script execution (%s or %s)"] = "Continue script execution (%s or %s)";
 localizedStrings["Continue to Here"] = "Continue to Here";
+localizedStrings["Continue without automatically stopping"] = "Continue without automatically stopping";
 localizedStrings["Controls"] = "Controls";
 localizedStrings["Cookies"] = "Cookies";
 localizedStrings["Copy"] = "Copy";

Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js (241749 => 241750)


--- trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js	2019-02-19 00:43:40 UTC (rev 241749)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js	2019-02-19 00:52:40 UTC (rev 241750)
@@ -201,6 +201,24 @@
         return this._isCapturingPageReload;
     }
 
+    willAutoStop()
+    {
+        return !!this._stopCapturingTimeout;
+    }
+
+    relaxAutoStop()
+    {
+        if (this._stopCapturingTimeout) {
+            clearTimeout(this._stopCapturingTimeout);
+            this._stopCapturingTimeout = undefined;
+        }
+
+        if (this._deadTimeTimeout) {
+            clearTimeout(this._deadTimeTimeout);
+            this._deadTimeTimeout = undefined;
+        }
+    }
+
     startCapturing(shouldCreateRecording)
     {
         console.assert(!this._isCapturing, "TimelineManager is already capturing.");

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/AuditNavigationSidebarPanel.js (241749 => 241750)


--- trunk/Source/WebInspectorUI/UserInterface/Views/AuditNavigationSidebarPanel.js	2019-02-19 00:43:40 UTC (rev 241749)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/AuditNavigationSidebarPanel.js	2019-02-19 00:52:40 UTC (rev 241750)
@@ -52,11 +52,11 @@
             let contentPlaceholder = WI.createMessageTextView(WI.UIString("No audit selected"));
             contentView.element.appendChild(contentPlaceholder);
 
-             let importNavigationItem = new WI.ButtonNavigationItem("import-audit", WI.UIString("Import"), "Images/Import.svg", 15, 15);
+            let importNavigationItem = new WI.ButtonNavigationItem("import-audit", WI.UIString("Import"), "Images/Import.svg", 15, 15);
             importNavigationItem.buttonStyle = WI.ButtonNavigationItem.Style.ImageAndText;
             importNavigationItem.addEventListener(WI.ButtonNavigationItem.Event.Clicked, this._handleImportButtonNavigationItemClicked, this);
 
-             let importHelpElement = WI.createNavigationItemHelp(WI.UIString("Press %s to import a test or result file"), importNavigationItem);
+            let importHelpElement = WI.createNavigationItemHelp(WI.UIString("Press %s to import a test or result file"), importNavigationItem);
             contentPlaceholder.appendChild(importHelpElement);
         }
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineTabContentView.css (241749 => 241750)


--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineTabContentView.css	2019-02-19 00:43:40 UTC (rev 241749)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineTabContentView.css	2019-02-19 00:52:40 UTC (rev 241750)
@@ -28,18 +28,22 @@
     filter: brightness(100%);
 }
 
-.timeline.tab.content-view .navigation-bar > .item.record-start-stop:hover {
+.timeline.tab.content-view .navigation-bar > .item:matches(.record-start-stop, .record-continue):hover {
     filter: brightness(95%);
 }
 
-.timeline.tab.content-view .navigation-bar > .item.record-start-stop:active {
+.timeline.tab.content-view .navigation-bar > .item:matches(.record-start-stop, .record-continue):active {
     filter: brightness(80%);
 }
 
-.timeline.tab.content-view .navigation-bar > .item.record-start-stop * {
+.timeline.tab.content-view .navigation-bar > .item:matches(.record-start-stop, .record-continue) * {
     pointer-events: none;
 }
 
+.timeline.tab.content-view .navigation-bar > .item.record-continue {
+    fill: var(--glyph-color);
+}
+
 .timeline.tab.content-view .navigation-bar > .item.radio {
     height: 17px;
 }

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineTabContentView.js (241749 => 241750)


--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineTabContentView.js	2019-02-19 00:43:40 UTC (rev 241749)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineTabContentView.js	2019-02-19 00:52:40 UTC (rev 241750)
@@ -52,7 +52,13 @@
         this._recordButton.visibilityPriority = WI.NavigationItem.VisibilityPriority.Low;
         this._recordButton.addEventListener(WI.ButtonNavigationItem.Event.Clicked, this._recordButtonClicked, this);
 
+        this._continueButton = new WI.ButtonNavigationItem("record-continue", WI.UIString("Continue without automatically stopping"), "Images/Resume.svg", 13, 13);
+        this._continueButton.visibilityPriority = WI.NavigationItem.VisibilityPriority.Low;
+        this._continueButton.addEventListener(WI.ButtonNavigationItem.Event.Clicked, this._continueButtonClicked, this);
+        this._continueButton.hidden = true;
+
         this.contentBrowser.navigationBar.insertNavigationItem(this._recordButton, 0);
+        this.contentBrowser.navigationBar.insertNavigationItem(this._continueButton, 1);
 
         if (WI.FPSInstrument.supported()) {
             let timelinesNavigationItem = new WI.RadioButtonNavigationItem(WI.TimelineOverview.ViewMode.Timelines, WI.UIString("Events"));
@@ -61,7 +67,7 @@
             let viewModeGroup = new WI.GroupNavigationItem([timelinesNavigationItem, renderingFramesNavigationItem]);
             viewModeGroup.visibilityPriority = WI.NavigationItem.VisibilityPriority.High;
 
-            this.contentBrowser.navigationBar.insertNavigationItem(viewModeGroup, 1);
+            this.contentBrowser.navigationBar.insertNavigationItem(viewModeGroup, 2);
             this.contentBrowser.navigationBar.addEventListener(WI.NavigationBar.Event.NavigationItemSelected, this._viewModeSelected, this);
         }
 
@@ -72,6 +78,7 @@
         WI.timelineManager.addEventListener(WI.TimelineManager.Event.CapturingStopped, this._capturingStartedOrStopped, this);
 
         WI.notifications.addEventListener(WI.Notification.VisibilityStateDidChange, this._inspectorVisibilityChanged, this);
+        WI.notifications.addEventListener(WI.Notification.GlobalModifierKeysDidChange, this._globalModifierKeysDidChange, this);
 
         this._displayedRecording = null;
         this._displayedContentView = null;
@@ -398,10 +405,32 @@
 
     // Private
 
+    _showRecordButton()
+    {
+        this._recordButton.hidden = false;
+        this._continueButton.hidden = true;
+    }
+
+    _showContinueButton()
+    {
+        this._recordButton.hidden = true;
+        this._continueButton.hidden = false;
+    }
+
+    _updateNavigationBarButtons()
+    {
+        if (!WI.modifierKeys.altKey || !WI.timelineManager.willAutoStop())
+            this._showRecordButton();
+        else
+            this._showContinueButton();
+    }
+
     _capturingStartedOrStopped(event)
     {
         let isCapturing = WI.timelineManager.isCapturing();
         this._recordButton.toggled = isCapturing;
+
+        this._updateNavigationBarButtons();
     }
 
     _inspectorVisibilityChanged(event)
@@ -409,6 +438,11 @@
         WI.timelineManager.autoCaptureOnPageLoad = !!this.visible && !!WI.visible;
     }
 
+    _globalModifierKeysDidChange(event)
+    {
+        this._updateNavigationBarButtons();
+    }
+
     _toggleRecordingOnSpacebar(event)
     {
         if (WI.isEventTargetAnEditableField(event))
@@ -450,6 +484,15 @@
         this._toggleRecording(shouldCreateNewRecording);
     }
 
+    _continueButtonClicked(event)
+    {
+        console.assert(WI.timelineManager.willAutoStop());
+
+        WI.timelineManager.relaxAutoStop();
+
+        this._updateNavigationBarButtons();
+    }
+
     _recordingsTreeSelectionDidChange(event)
     {
         let treeElement = this._recordingsTreeOutline.selectedTreeElement;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to