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

bweinstein at apple.com bweinstein at apple.com
Thu Apr 8 00:54:53 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit df0aaa598ff91e1ad0d8aae84905ffa3127c417d
Author: bweinstein at apple.com <bweinstein at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jan 5 20:37:39 2010 +0000

    Part of <https://bugs.webkit.org/show_bug.cgi?id=32568>.
    Web Inspector: Context Menus should be used in more places.
    
    Reviewed by Tim Hatcher.
    
    Add context menus to handle the interaction with breakpoints in the Source Frame. Currently
    we use left click to add/disable/remove breakpoints, and left click to edit (for conditional
    breakpoints), but this is hard to discover and behaves differently than Xcode.
    
    Change the behavior to be more like Xcode, left click adds a breakpoint if there isn't one, and
    removes it if there is one.
    
    On the context menu, if there is no breakpoint there, we have Add Breakpoint, and Add Conditional
    Breakpoint. If there is a breakpoint there, we add entries for Edit Breakpoint (edit
    the condition), Remove Breakpoint, and Enable/Disable Breakpoint (based on the current state).
    
    * English.lproj/localizedStrings.js: Added localized context menu entries.
    * inspector/front-end/SourceFrame.js:
    (WebInspector.SourceFrame.prototype._documentContextMenu.addAndEditBreakpoint):
    (WebInspector.SourceFrame.prototype._documentContextMenu): Added context menu entries and handlers.
    (WebInspector.SourceFrame.prototype._documentMouseDown): Changed left click behavior (Add -> Remove).
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52820 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 8aa6b3a..936abd9 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,27 @@
+2010-01-04  Brian Weinstein  <bweinstein at apple.com>
+
+        Reviewed by Tim Hatcher.
+
+        Part of <https://bugs.webkit.org/show_bug.cgi?id=32568>.
+        Web Inspector: Context Menus should be used in more places.
+        
+        Add context menus to handle the interaction with breakpoints in the Source Frame. Currently
+        we use left click to add/disable/remove breakpoints, and left click to edit (for conditional
+        breakpoints), but this is hard to discover and behaves differently than Xcode.
+        
+        Change the behavior to be more like Xcode, left click adds a breakpoint if there isn't one, and
+        removes it if there is one.
+        
+        On the context menu, if there is no breakpoint there, we have Add Breakpoint, and Add Conditional
+        Breakpoint. If there is a breakpoint there, we add entries for Edit Breakpoint (edit
+        the condition), Remove Breakpoint, and Enable/Disable Breakpoint (based on the current state).
+
+        * English.lproj/localizedStrings.js: Added localized context menu entries.
+        * inspector/front-end/SourceFrame.js:
+        (WebInspector.SourceFrame.prototype._documentContextMenu.addAndEditBreakpoint):
+        (WebInspector.SourceFrame.prototype._documentContextMenu): Added context menu entries and handlers.
+        (WebInspector.SourceFrame.prototype._documentMouseDown): Changed left click behavior (Add -> Remove).
+
 2010-01-05  Chris Fleizach  <cfleizach at apple.com>
 
         Reviewed by Eric Seidel.
diff --git a/WebCore/English.lproj/localizedStrings.js b/WebCore/English.lproj/localizedStrings.js
index e75eb66..6df6c84 100644
Binary files a/WebCore/English.lproj/localizedStrings.js and b/WebCore/English.lproj/localizedStrings.js differ
diff --git a/WebCore/inspector/front-end/SourceFrame.js b/WebCore/inspector/front-end/SourceFrame.js
index fdcc7e8..77b25c4 100644
--- a/WebCore/inspector/front-end/SourceFrame.js
+++ b/WebCore/inspector/front-end/SourceFrame.js
@@ -310,16 +310,37 @@ WebInspector.SourceFrame.prototype = {
     {
         if (!event.target.hasStyleClass("webkit-line-number"))
             return;
-        var sourceRow = event.target.enclosingNodeOrSelfWithNodeName("tr");
-        if (!sourceRow._breakpointObject && this.addBreakpointDelegate)
-            this.addBreakpointDelegate(this.lineNumberForSourceRow(sourceRow));
-
-        var breakpoint = sourceRow._breakpointObject;
-        if (!breakpoint)
+        if (!this.addBreakpointDelegate)
             return;
 
-        this._editBreakpointCondition(event.target, sourceRow, breakpoint);
-        event.preventDefault();
+        var sourceRow = event.target.enclosingNodeOrSelfWithNodeName("tr");
+        var contextMenu = new WebInspector.ContextMenu();
+        
+        if (!sourceRow._breakpointObject && this.addBreakpointDelegate) {
+            var lineNumber = this.lineNumberForSourceRow(sourceRow);
+            // This row doesn't have a breakpoint: We want to show Add Breakpoint and Add and Edit Breakpoint.
+            contextMenu.appendItem(WebInspector.UIString("Add Breakpoint"), this.addBreakpointDelegate.bind(this, lineNumber));
+
+            function addConditionalBreakpoint() 
+            {
+                this.addBreakpointDelegate(lineNumber);
+                var breakpoint = sourceRow._breakpointObject;
+                if (breakpoint)
+                    this._editBreakpointCondition(event.target, sourceRow, breakpoint);
+            }
+
+            contextMenu.appendItem(WebInspector.UIString("Add Conditional Breakpoint..."), addConditionalBreakpoint.bind(this));
+        } else if (sourceRow._breakpointObject) {
+            // This row has a breakpoint, we want to show edit and remove breakpoint, and either disable or enable.
+            contextMenu.appendItem(WebInspector.UIString("Remove Breakpoint"), WebInspector.panels.scripts.removeBreakpoint.bind(WebInspector.panels.scripts, sourceRow._breakpointObject));
+            contextMenu.appendItem(WebInspector.UIString("Edit Breakpoint..."), this._editBreakpointCondition.bind(this, event.target, sourceRow, sourceRow._breakpointObject));
+            if (sourceRow._breakpointObject.enabled)
+                contextMenu.appendItem(WebInspector.UIString("Disable Breakpoint"), function() { sourceRow._breakpointObject.enabled = false; });
+            else
+                contextMenu.appendItem(WebInspector.UIString("Enable Breakpoint"), function() { sourceRow._breakpointObject.enabled = true; });
+        }
+        
+        contextMenu.show(event);
     },
 
     _documentMouseDown: function(event)
@@ -329,9 +350,7 @@ WebInspector.SourceFrame.prototype = {
         if (event.button != 0 || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey)
             return;
         var sourceRow = event.target.enclosingNodeOrSelfWithNodeName("tr");
-        if (sourceRow._breakpointObject && sourceRow._breakpointObject.enabled)
-            sourceRow._breakpointObject.enabled = false;
-        else if (sourceRow._breakpointObject)
+        if (sourceRow._breakpointObject)
             WebInspector.panels.scripts.removeBreakpoint(sourceRow._breakpointObject);
         else if (this.addBreakpointDelegate)
             this.addBreakpointDelegate(this.lineNumberForSourceRow(sourceRow));

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list