[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

bweinstein at apple.com bweinstein at apple.com
Wed Apr 7 23:52:27 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 7c58c50b4887be1b9bb698dc222743078baf90b9
Author: bweinstein at apple.com <bweinstein at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Nov 20 19:51:38 2009 +0000

    Fixes <http://webkit.org/b/31700>.
    Web Inspector: isMac should be in one central location + Cached.
    
    Reviewed by Tim Hatcher.
    
    We should cache the value of isMac, and make the indexOf call in one
    single location, because we are calling it from multiple places, and saving
    the result can save us time, and make the call sites simpler.
    
    * inspector/front-end/AbstractTimelinePanel.js:
    (WebInspector.AbstractTimelinePanel.prototype._updateFilter):
    * inspector/front-end/ConsoleView.js:
    (WebInspector.ConsoleView.prototype._updateFilter):
    * inspector/front-end/ElementsPanel.js:
    (WebInspector.ElementsPanel.prototype.handleKeyEvent):
    * inspector/front-end/ScriptsPanel.js:
    (WebInspector.ScriptsPanel):
    * inspector/front-end/SourceFrame.js:
    (WebInspector.SourceFrame.prototype._loaded):
    * inspector/front-end/inspector.js:
    (WebInspector.documentKeyDown):
    (WebInspector.isMac):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51250 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index d172af1..e053ea9 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,28 @@
+2009-11-20  Brian Weinstein  <bweinstein at apple.com>
+
+        Reviewed by Tim Hatcher.
+
+        Fixes <http://webkit.org/b/31700>.
+        Web Inspector: isMac should be in one central location + Cached.
+        
+        We should cache the value of isMac, and make the indexOf call in one
+        single location, because we are calling it from multiple places, and saving
+        the result can save us time, and make the call sites simpler.
+
+        * inspector/front-end/AbstractTimelinePanel.js:
+        (WebInspector.AbstractTimelinePanel.prototype._updateFilter):
+        * inspector/front-end/ConsoleView.js:
+        (WebInspector.ConsoleView.prototype._updateFilter):
+        * inspector/front-end/ElementsPanel.js:
+        (WebInspector.ElementsPanel.prototype.handleKeyEvent):
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel):
+        * inspector/front-end/SourceFrame.js:
+        (WebInspector.SourceFrame.prototype._loaded):
+        * inspector/front-end/inspector.js:
+        (WebInspector.documentKeyDown):
+        (WebInspector.isMac):
+
 2009-11-19  Joseph Pecoraro  <joepeck at webkit.org>
 
         Removed .DS_Store accidentally added in last (r51245).
diff --git a/WebCore/inspector/front-end/AbstractTimelinePanel.js b/WebCore/inspector/front-end/AbstractTimelinePanel.js
index e009bbb..3d6cd66 100644
--- a/WebCore/inspector/front-end/AbstractTimelinePanel.js
+++ b/WebCore/inspector/front-end/AbstractTimelinePanel.js
@@ -189,7 +189,7 @@ WebInspector.AbstractTimelinePanel.prototype = {
 
     _updateFilter: function(e)
     {
-        var isMac = WebInspector.platform.indexOf("mac-") === 0;
+        var isMac = WebInspector.isMac();
         var selectMultiple = false;
         if (isMac && e.metaKey && !e.ctrlKey && !e.altKey && !e.shiftKey)
             selectMultiple = true;
diff --git a/WebCore/inspector/front-end/ConsoleView.js b/WebCore/inspector/front-end/ConsoleView.js
index 1170b2b..764ea2d 100644
--- a/WebCore/inspector/front-end/ConsoleView.js
+++ b/WebCore/inspector/front-end/ConsoleView.js
@@ -98,7 +98,7 @@ WebInspector.ConsoleView.prototype = {
     
     _updateFilter: function(e)
     {
-        var isMac = WebInspector.platform.indexOf("mac-") === 0;
+        var isMac = WebInspector.isMac();
         var selectMultiple = false;
         if (isMac && e.metaKey && !e.ctrlKey && !e.altKey && !e.shiftKey)
             selectMultiple = true;
diff --git a/WebCore/inspector/front-end/ElementsPanel.js b/WebCore/inspector/front-end/ElementsPanel.js
index 164855b..74f5da6 100644
--- a/WebCore/inspector/front-end/ElementsPanel.js
+++ b/WebCore/inspector/front-end/ElementsPanel.js
@@ -1001,8 +1001,7 @@ WebInspector.ElementsPanel.prototype = {
         // Cmd/Control + Shift + C should be a shortcut to clicking the Node Search Button.
         // This shortcut matches Firebug.
         if (event.keyIdentifier === "U+0043") {     // C key
-            var isMac = WebInspector.platform.indexOf("mac-") === 0;
-            if (isMac)
+            if (WebInspector.isMac())
                 var isNodeSearchKey = event.metaKey && !event.ctrlKey && !event.altKey && event.shiftKey;
             else
                 var isNodeSearchKey = event.ctrlKey && !event.metaKey && !event.altKey && event.shiftKey;
diff --git a/WebCore/inspector/front-end/ScriptsPanel.js b/WebCore/inspector/front-end/ScriptsPanel.js
index ef3f9b8..bbbc793 100644
--- a/WebCore/inspector/front-end/ScriptsPanel.js
+++ b/WebCore/inspector/front-end/ScriptsPanel.js
@@ -162,8 +162,7 @@ WebInspector.ScriptsPanel = function()
 
     this._shortcuts = {};
 
-    var isMac = WebInspector.platform.indexOf("mac-") === 0;
-    var platformSpecificModifier = isMac ? WebInspector.KeyboardShortcut.Modifiers.Meta : WebInspector.KeyboardShortcut.Modifiers.Ctrl;
+    var platformSpecificModifier = WebInspector.isMac() ? WebInspector.KeyboardShortcut.Modifiers.Meta : WebInspector.KeyboardShortcut.Modifiers.Ctrl;
 
     // Continue.
     var handler = this.pauseButton.click.bind(this.pauseButton);
diff --git a/WebCore/inspector/front-end/SourceFrame.js b/WebCore/inspector/front-end/SourceFrame.js
index bcbcb8f..b5cf4c0 100644
--- a/WebCore/inspector/front-end/SourceFrame.js
+++ b/WebCore/inspector/front-end/SourceFrame.js
@@ -207,8 +207,7 @@ WebInspector.SourceFrame.prototype = {
         this.element.contentDocument.addEventListener("webkitAnimationEnd", this._highlightLineEnds.bind(this), false);
 
         // Register 'eval' shortcut.
-        var isMac = WebInspector.platform.indexOf("mac-") === 0;
-        var platformSpecificModifier = isMac ? WebInspector.KeyboardShortcut.Modifiers.Meta : WebInspector.KeyboardShortcut.Modifiers.Ctrl;
+        var platformSpecificModifier = WebInspector.isMac() ? WebInspector.KeyboardShortcut.Modifiers.Meta : WebInspector.KeyboardShortcut.Modifiers.Ctrl;
         var shortcut = WebInspector.KeyboardShortcut.makeKey(69 /* 'E' */, platformSpecificModifier | WebInspector.KeyboardShortcut.Modifiers.Shift);
         this._shortcuts[shortcut] = this._evalSelectionInCallFrame.bind(this);
 
diff --git a/WebCore/inspector/front-end/inspector.js b/WebCore/inspector/front-end/inspector.js
index e62d6c2..0f8ec12 100644
--- a/WebCore/inspector/front-end/inspector.js
+++ b/WebCore/inspector/front-end/inspector.js
@@ -639,7 +639,7 @@ WebInspector.documentKeyDown = function(event)
         WebInspector[this.currentFocusElement.id + "KeyDown"](event);
 
     if (!event.handled) {
-        var isMac = WebInspector.platform.indexOf("mac-") === 0;
+        var isMac = WebInspector.isMac();
 
         switch (event.keyIdentifier) {
             case "U+001B": // Escape key
@@ -1652,6 +1652,14 @@ WebInspector.UIString = function(string)
     return String.vsprintf(string, Array.prototype.slice.call(arguments, 1));
 }
 
+WebInspector.isMac = function()
+{
+    if (!("_isMac" in this))
+        this._isMac = WebInspector.platform.indexOf("mac-") === 0;
+
+    return this._isMac;
+}
+
 WebInspector.isBeingEdited = function(element)
 {
     return element.__editing;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list