Title: [193507] trunk/Source/WebInspectorUI
Revision
193507
Author
commit-qu...@webkit.org
Date
2015-12-04 19:20:38 -0800 (Fri, 04 Dec 2015)

Log Message

Web Inspector: Uncaught Exception with Reload shortcut in JSContext Inspector
https://bugs.webkit.org/show_bug.cgi?id=151896

Patch by Joseph Pecoraro <pecor...@apple.com> on 2015-12-04
Reviewed by Timothy Hatcher.

* UserInterface/Base/Main.js:
(WebInspector.contentLoaded):
Do not implicitly prevent default on these keyboard shortcuts
so we can system beep if we do not do anything.

(WebInspector._reloadPage):
(WebInspector._reloadPageIgnoringCache):
Bail if there is no PageAgent without preventing default for
a beep system beep. Prevent default if we did something.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (193506 => 193507)


--- trunk/Source/WebInspectorUI/ChangeLog	2015-12-05 02:57:03 UTC (rev 193506)
+++ trunk/Source/WebInspectorUI/ChangeLog	2015-12-05 03:20:38 UTC (rev 193507)
@@ -1,3 +1,20 @@
+2015-12-04  Joseph Pecoraro  <pecor...@apple.com>
+
+        Web Inspector: Uncaught Exception with Reload shortcut in JSContext Inspector
+        https://bugs.webkit.org/show_bug.cgi?id=151896
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Base/Main.js:
+        (WebInspector.contentLoaded):
+        Do not implicitly prevent default on these keyboard shortcuts
+        so we can system beep if we do not do anything.
+
+        (WebInspector._reloadPage):
+        (WebInspector._reloadPageIgnoringCache):
+        Bail if there is no PageAgent without preventing default for
+        a beep system beep. Prevent default if we did something.
+
 2015-12-04  Matt Baker  <mattba...@apple.com>
 
         Web Inspector: when a marked-dirty subview is attached to a parent View, dirtyDescendantsCount gets out of sync

Modified: trunk/Source/WebInspectorUI/UserInterface/Base/Main.js (193506 => 193507)


--- trunk/Source/WebInspectorUI/UserInterface/Base/Main.js	2015-12-05 02:57:03 UTC (rev 193506)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/Main.js	2015-12-05 03:20:38 UTC (rev 193507)
@@ -266,6 +266,7 @@
 
     this._reloadPageKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl, "R", this._reloadPage.bind(this));
     this._reloadPageIgnoringCacheKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl | WebInspector.KeyboardShortcut.Modifier.Shift, "R", this._reloadPageIgnoringCache.bind(this));
+    this._reloadPageKeyboardShortcut.implicitlyPreventsDefault = this._reloadPageIgnoringCacheKeyboardShortcut = false;
 
     this._consoleTabKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Option | WebInspector.KeyboardShortcut.Modifier.CommandOrControl, "C", this._showConsoleTab.bind(this));
     this._quickConsoleKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Control, WebInspector.KeyboardShortcut.Key.Apostrophe, this._focusConsolePrompt.bind(this));
@@ -1692,7 +1693,11 @@
 
 WebInspector._reloadPage = function(event)
 {
+    if (!window.PageAgent)
+        return;
+
     PageAgent.reload();
+    event.preventDefault();
 };
 
 WebInspector._reloadPageClicked = function(event)
@@ -1703,7 +1708,11 @@
 
 WebInspector._reloadPageIgnoringCache = function(event)
 {
+    if (!window.PageAgent)
+        return;
+
     PageAgent.reload(true);
+    event.preventDefault();
 };
 
 WebInspector._updateReloadToolbarButton = function()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to