[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

bweinstein at apple.com bweinstein at apple.com
Thu Oct 29 20:51:35 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit 427af179b3cb8a10b967ad6b42589bc82ba9bace
Author: bweinstein at apple.com <bweinstein at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sun Oct 25 04:13:13 2009 +0000

    Fixes <https://bugs.webkit.org/show_bug.cgi?id=30752>.
    Web Inspector: Multiple Selection on Scope Bars by default Conflicts with other behavior on OSX.
    
    Reviewed by Timothy Hatcher.
    
    Have the scope bars select one scope by default, but if the multiple selection key
    is pressed, allow for multiple selection.
    
    * inspector/front-end/ConsoleView.js:
    (WebInspector.ConsoleView):
    (WebInspector.ConsoleView.prototype._updateFilter):
    (WebInspector.ConsoleView.prototype.filter):
    * inspector/front-end/ResourcesPanel.js:
    (WebInspector.ResourcesPanel):
    (WebInspector.ResourcesPanel.prototype.filter):
    (WebInspector.ResourcesPanel.prototype._updateFilter):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50038 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 40b32e1..1cbf1b6 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,22 @@
+2009-10-24  Brian Weinstein  <bweinstein at apple.com>
+
+        Reviewed by Timothy Hatcher.
+
+        Fixes <https://bugs.webkit.org/show_bug.cgi?id=30752>.
+        Web Inspector: Multiple Selection on Scope Bars by default Conflicts with other behavior on OSX.
+        
+        Have the scope bars select one scope by default, but if the multiple selection key
+        is pressed, allow for multiple selection.
+
+        * inspector/front-end/ConsoleView.js:
+        (WebInspector.ConsoleView):
+        (WebInspector.ConsoleView.prototype._updateFilter):
+        (WebInspector.ConsoleView.prototype.filter):
+        * inspector/front-end/ResourcesPanel.js:
+        (WebInspector.ResourcesPanel):
+        (WebInspector.ResourcesPanel.prototype.filter):
+        (WebInspector.ResourcesPanel.prototype._updateFilter):
+
 2009-10-24  Sam Weinig  <sam at webkit.org>
 
         Reviewed by Dan Bernstein.
diff --git a/WebCore/inspector/front-end/ConsoleView.js b/WebCore/inspector/front-end/ConsoleView.js
index 6cbd48a..1da2fc6 100644
--- a/WebCore/inspector/front-end/ConsoleView.js
+++ b/WebCore/inspector/front-end/ConsoleView.js
@@ -94,49 +94,76 @@ WebInspector.ConsoleView = function(drawer)
     this.warningElement = createFilterElement.call(this, "Warnings");
     this.logElement = createFilterElement.call(this, "Logs");
 
-    this.filter(this.allElement);
+    this.filter(this.allElement, false);
 }
 
 WebInspector.ConsoleView.prototype = {
     
     _updateFilter: function(e)
     {
-        this.filter(e.target);
+        var isMac = InspectorController.platform().indexOf("mac-") === 0;
+        var selectMultiple = false;
+        if (isMac && e.metaKey && !e.ctrlKey && !e.altKey && !e.shiftKey)
+            selectMultiple = true;
+        if (!isMac && e.ctrlKey && !e.metaKey && !e.altKey && !e.shiftKey)
+            selectMultiple = true;
+
+        this.filter(e.target, selectMultiple);
     },
     
-    filter: function(target)
+    filter: function(target, selectMultiple)
     {
+        function unselectAll()
+        {
+            this.allElement.removeStyleClass("selected");
+            this.errorElement.removeStyleClass("selected");
+            this.warningElement.removeStyleClass("selected");
+            this.logElement.removeStyleClass("selected");
+            
+            this.messagesElement.removeStyleClass("filter-all");
+            this.messagesElement.removeStyleClass("filter-errors");
+            this.messagesElement.removeStyleClass("filter-warnings");
+            this.messagesElement.removeStyleClass("filter-logs");
+        }
+        
+        var targetFilterClass = "filter-" + target.category.toLowerCase();
+
         if (target.category == "All") {
             if (target.hasStyleClass("selected")) {
                 // We can't unselect all, so we break early here
                 return;
             }
-            
-            this.errorElement.removeStyleClass("selected");
-            this.warningElement.removeStyleClass("selected");
-            this.logElement.removeStyleClass("selected");
-            
-            document.getElementById("console-messages").removeStyleClass("filter-errors");
-            document.getElementById("console-messages").removeStyleClass("filter-warnings");
-            document.getElementById("console-messages").removeStyleClass("filter-logs");
+
+            unselectAll.call(this);
         } else {
             // Something other than all is being selected, so we want to unselect all
             if (this.allElement.hasStyleClass("selected")) {
                 this.allElement.removeStyleClass("selected");
-                document.getElementById("console-messages").removeStyleClass("filter-all");
+                this.messagesElement.removeStyleClass("filter-all");
             }
         }
         
+        if (!selectMultiple) {
+            // If multiple selection is off, we want to unselect everything else
+            // and just select ourselves.
+            unselectAll.call(this);
+            
+            target.addStyleClass("selected");
+            this.messagesElement.addStyleClass(targetFilterClass);
+            
+            return;
+        }
+        
         if (target.hasStyleClass("selected")) {
+            // If selectMultiple is turned on, and we were selected, we just
+            // want to unselect ourselves.
             target.removeStyleClass("selected");
-            var newClass = "filter-" + target.category.toLowerCase();
-            var filterElement = document.getElementById("console-messages");
-            filterElement.removeStyleClass(newClass);
+            this.messagesElement.removeStyleClass(targetFilterClass);
         } else {
+            // If selectMultiple is turned on, and we weren't selected, we just
+            // want to select ourselves.
             target.addStyleClass("selected");
-            var newClass = "filter-" + target.category.toLowerCase();
-            var filterElement = document.getElementById("console-messages");
-            filterElement.addStyleClass(newClass);
+            this.messagesElement.addStyleClass(targetFilterClass);
         }
     },
     
diff --git a/WebCore/inspector/front-end/ResourcesPanel.js b/WebCore/inspector/front-end/ResourcesPanel.js
index fc8753f..ffbed87 100644
--- a/WebCore/inspector/front-end/ResourcesPanel.js
+++ b/WebCore/inspector/front-end/ResourcesPanel.js
@@ -164,7 +164,7 @@ WebInspector.ResourcesPanel = function()
     for (var category in this.categories)
         createFilterElement.call(this, category);
 
-    this.filter(this.allElement);
+    this.filter(this.allElement, false);
 
     this.reset();
 
@@ -185,27 +185,33 @@ WebInspector.ResourcesPanel.prototype = {
         return this._categories; 
     },
 
-    filter: function(target)
+    filter: function(target, selectMultiple)
     {
-        if (target === this.allElement) {
-            if (target.hasStyleClass("selected")) {
-                // We can't unselect All, so we break early here
-                return;
-            }
-
-            // If All wasn't selected, and now is, unselect everything else.
+        function unselectAll()
+        {
             for (var i = 0; i < this.filterBarElement.childNodes.length; ++i) {
                 var child = this.filterBarElement.childNodes[i];
                 if (!child.category)
                     continue;
-
-                if (child !== this.allElement)
-                    child.removeStyleClass("selected");
-
+                
+                child.removeStyleClass("selected");
+                
                 var filterClass = "filter-" + child.category.toLowerCase();
                 this.resourcesGraphsElement.removeStyleClass(filterClass);
                 this.resourcesTreeElement.childrenListElement.removeStyleClass(filterClass);
             }
+        }
+        
+        var targetFilterClass = "filter-" + target.category.toLowerCase();
+
+        if (target === this.allElement) {
+            if (target.hasStyleClass("selected")) {
+                // We can't unselect All, so we break early here
+                return;
+            }
+
+            // If All wasn't selected, and now is, unselect everything else.
+            unselectAll.call(this);
         } else {
             // Something other than All is being selected, so we want to unselect All.
             if (this.allElement.hasStyleClass("selected")) {
@@ -214,19 +220,33 @@ WebInspector.ResourcesPanel.prototype = {
                 this.resourcesTreeElement.childrenListElement.removeStyleClass("filter-all");
             }
         }
+        
+        if (!selectMultiple) {
+            // If multiple selection is off, we want to unselect everything else
+            // and just select ourselves.
+            unselectAll.call(this);
+            
+            target.addStyleClass("selected");
+            this.resourcesGraphsElement.addStyleClass(targetFilterClass);
+            this.resourcesTreeElement.childrenListElement.addStyleClass(targetFilterClass);
+            
+            return;
+        }
 
         if (target.hasStyleClass("selected")) {
+            // If selectMultiple is turned on, and we were selected, we just
+            // want to unselect ourselves.
             target.removeStyleClass("selected");
 
-            var filterClass = "filter-" + target.category.toLowerCase();
-            this.resourcesGraphsElement.removeStyleClass(filterClass);
-            this.resourcesTreeElement.childrenListElement.removeStyleClass(filterClass);
+            this.resourcesGraphsElement.removeStyleClass(targetFilterClass);
+            this.resourcesTreeElement.childrenListElement.removeStyleClass(targetFilterClass);
         } else {
+            // If selectMultiple is turned on, and we weren't selected, we just
+            // want to select ourselves.
             target.addStyleClass("selected");
 
-            var filterClass = "filter-" + target.category.toLowerCase();
-            this.resourcesGraphsElement.addStyleClass(filterClass);
-            this.resourcesTreeElement.childrenListElement.addStyleClass(filterClass);
+            this.resourcesGraphsElement.addStyleClass(targetFilterClass);
+            this.resourcesTreeElement.childrenListElement.addStyleClass(targetFilterClass);
         }
     },
 
@@ -237,7 +257,14 @@ WebInspector.ResourcesPanel.prototype = {
 
     _updateFilter: function(e)
     {
-        this.filter(e.target);
+        var isMac = InspectorController.platform().indexOf("mac-") === 0;
+        var selectMultiple = false;
+        if (isMac && e.metaKey && !e.ctrlKey && !e.altKey && !e.shiftKey)
+            selectMultiple = true;
+        if (!isMac && e.ctrlKey && !e.metaKey && !e.altKey && !e.shiftKey)
+            selectMultiple = true;
+        
+        this.filter(e.target, selectMultiple);
     },
 
     get toolbarItemLabel()

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list