[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

pfeldman at chromium.org pfeldman at chromium.org
Wed Dec 22 12:42:13 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 23894eb269a3b38233c634104502b5214d175aab
Author: pfeldman at chromium.org <pfeldman at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Aug 27 13:06:50 2010 +0000

    2010-08-26  Pavel Podivilov  <podivilov at chromium.org>
    
            Reviewed by Pavel Feldman.
    
            Web Inspector: use context menu items with checkbox for setting and removing DOM breakpoints
            https://bugs.webkit.org/show_bug.cgi?id=44687
    
            * English.lproj/localizedStrings.js:
            * inspector/front-end/BreakpointsSidebarPane.js:
            (WebInspector.DOMBreakpointItem):
            * inspector/front-end/DOMAgent.js:
            (WebInspector.DOMBreakpointManager.prototype.findBreakpoint):
            (WebInspector.DOMBreakpoint.labelForType):
            (WebInspector.DOMBreakpoint.contextMenuLabelForType):
            * inspector/front-end/ElementsTreeOutline.js:
            (WebInspector.ElementsTreeElement.prototype._populateTagContextMenu):
            * inspector/front-end/inspector.js:
            (WebInspector.pausedScript):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66213 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 947af7f..cb17cf4 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,22 @@
+2010-08-26  Pavel Podivilov  <podivilov at chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: use context menu items with checkbox for setting and removing DOM breakpoints
+        https://bugs.webkit.org/show_bug.cgi?id=44687
+
+        * English.lproj/localizedStrings.js:
+        * inspector/front-end/BreakpointsSidebarPane.js:
+        (WebInspector.DOMBreakpointItem):
+        * inspector/front-end/DOMAgent.js:
+        (WebInspector.DOMBreakpointManager.prototype.findBreakpoint):
+        (WebInspector.DOMBreakpoint.labelForType):
+        (WebInspector.DOMBreakpoint.contextMenuLabelForType):
+        * inspector/front-end/ElementsTreeOutline.js:
+        (WebInspector.ElementsTreeElement.prototype._populateTagContextMenu):
+        * inspector/front-end/inspector.js:
+        (WebInspector.pausedScript):
+
 2010-08-27  Steve Block  <steveblock at google.com>
 
         Reviewed by Jeremy Orlow.
diff --git a/WebCore/English.lproj/localizedStrings.js b/WebCore/English.lproj/localizedStrings.js
index 80d2425..c26c15f 100644
Binary files a/WebCore/English.lproj/localizedStrings.js and b/WebCore/English.lproj/localizedStrings.js differ
diff --git a/WebCore/inspector/front-end/BreakpointsSidebarPane.js b/WebCore/inspector/front-end/BreakpointsSidebarPane.js
index ccf45b6..3a0860f 100644
--- a/WebCore/inspector/front-end/BreakpointsSidebarPane.js
+++ b/WebCore/inspector/front-end/BreakpointsSidebarPane.js
@@ -191,7 +191,7 @@ WebInspector.DOMBreakpointItem = function(breakpoint)
     var link = WebInspector.panels.elements.linkifyNodeReference(this._breakpoint.node);
     this._element.appendChild(link);
 
-    var type = WebInspector.DOMBreakpoint.Labels[this._breakpoint.type];
+    var type = WebInspector.DOMBreakpoint.labelForType(this._breakpoint.type);
     var typeElement = document.createTextNode(" - " + type);
     this._element.appendChild(typeElement);
 }
diff --git a/WebCore/inspector/front-end/DOMAgent.js b/WebCore/inspector/front-end/DOMAgent.js
index bd52235..83dc892 100644
--- a/WebCore/inspector/front-end/DOMAgent.js
+++ b/WebCore/inspector/front-end/DOMAgent.js
@@ -692,6 +692,13 @@ WebInspector.DOMBreakpointManager.prototype = {
         this.dispatchEventToListeners("dom-breakpoint-added", breakpoint);
     },
 
+    findBreakpoint: function(nodeId, type)
+    {
+        var nodeBreakpoints = this._breakpoints[nodeId];
+        if (nodeBreakpoints && type in nodeBreakpoints)
+            return nodeBreakpoints[type];
+    },
+
     removeBreakpointsForNode: function(node)
     {
         var nodeBreakpoints = this._breakpoints[node.id];
@@ -728,10 +735,27 @@ WebInspector.DOMBreakpoint.Types = {
     NodeRemoved: 2
 };
 
-WebInspector.DOMBreakpoint.Labels = {};
-WebInspector.DOMBreakpoint.Labels[WebInspector.DOMBreakpoint.Types.SubtreeModified] = WebInspector.UIString("Subtree Modified");
-WebInspector.DOMBreakpoint.Labels[WebInspector.DOMBreakpoint.Types.AttributeModified] = WebInspector.UIString("Attribute Modified");
-WebInspector.DOMBreakpoint.Labels[WebInspector.DOMBreakpoint.Types.NodeRemoved] = WebInspector.UIString("Node Removed");
+WebInspector.DOMBreakpoint.labelForType = function(type)
+{
+    if (!WebInspector.DOMBreakpoint._labels) {
+        WebInspector.DOMBreakpoint._labels = {};
+        WebInspector.DOMBreakpoint._labels[WebInspector.DOMBreakpoint.Types.SubtreeModified] = WebInspector.UIString("Subtree Modified");
+        WebInspector.DOMBreakpoint._labels[WebInspector.DOMBreakpoint.Types.AttributeModified] = WebInspector.UIString("Attribute Modified");
+        WebInspector.DOMBreakpoint._labels[WebInspector.DOMBreakpoint.Types.NodeRemoved] = WebInspector.UIString("Node Removed");
+    }
+    return WebInspector.DOMBreakpoint._labels[type];
+}
+
+WebInspector.DOMBreakpoint.contextMenuLabelForType = function(type)
+{
+    if (!WebInspector.DOMBreakpoint._contextMenuLabels) {
+        WebInspector.DOMBreakpoint._contextMenuLabels = {};
+        WebInspector.DOMBreakpoint._contextMenuLabels[WebInspector.DOMBreakpoint.Types.SubtreeModified] = WebInspector.UIString("Break on Subtree Modifications");
+        WebInspector.DOMBreakpoint._contextMenuLabels[WebInspector.DOMBreakpoint.Types.AttributeModified] = WebInspector.UIString("Break on Attributes Modifications");
+        WebInspector.DOMBreakpoint._contextMenuLabels[WebInspector.DOMBreakpoint.Types.NodeRemoved] = WebInspector.UIString("Break on Node Removal");
+    }
+    return WebInspector.DOMBreakpoint._contextMenuLabels[type];
+}
 
 WebInspector.DOMBreakpoint.prototype = {
     get enabled()
diff --git a/WebCore/inspector/front-end/ElementsTreeOutline.js b/WebCore/inspector/front-end/ElementsTreeOutline.js
index ae9e40a..69c1d28 100644
--- a/WebCore/inspector/front-end/ElementsTreeOutline.js
+++ b/WebCore/inspector/front-end/ElementsTreeOutline.js
@@ -765,16 +765,16 @@ WebInspector.ElementsTreeElement.prototype = {
         if (Preferences.domBreakpointsEnabled) {
             // Add debbuging-related actions
             contextMenu.appendSeparator();
-
-            contextMenu.appendItem(WebInspector.UIString("Stop on Subtree Modifications"),
-                WebInspector.domBreakpointManager.setBreakpoint.bind(WebInspector.domBreakpointManager, this.representedObject, WebInspector.DOMBreakpoint.Types.SubtreeModified));
-            contextMenu.appendItem(WebInspector.UIString("Stop on Attributes Modifications"),
-                WebInspector.domBreakpointManager.setBreakpoint.bind(WebInspector.domBreakpointManager, this.representedObject, WebInspector.DOMBreakpoint.Types.AttributeModified));
-            contextMenu.appendItem(WebInspector.UIString("Stop on Node Removal"),
-                WebInspector.domBreakpointManager.setBreakpoint.bind(WebInspector.domBreakpointManager, this.representedObject, WebInspector.DOMBreakpoint.Types.NodeRemoved));
-
-            contextMenu.appendItem(WebInspector.UIString("Remove Breakpoints"),
-                WebInspector.domBreakpointManager.removeBreakpointsForNode.bind(WebInspector.domBreakpointManager, this.representedObject));
+            for (var type in WebInspector.DOMBreakpoint.Types) {
+                var typeId = WebInspector.DOMBreakpoint.Types[type];
+                var label = WebInspector.DOMBreakpoint.contextMenuLabelForType(typeId);
+                var breakpoint = WebInspector.domBreakpointManager.findBreakpoint(this.representedObject.id, typeId);
+                if (!breakpoint)
+                    var handler = WebInspector.domBreakpointManager.setBreakpoint.bind(WebInspector.domBreakpointManager, this.representedObject, typeId);
+                else
+                    var handler = breakpoint.remove.bind(breakpoint);
+                contextMenu.appendCheckboxItem(label, handler, !!breakpoint);
+            }
         }
     },
 
diff --git a/WebCore/inspector/front-end/inspector.js b/WebCore/inspector/front-end/inspector.js
index 012e67c..26dfa09 100644
--- a/WebCore/inspector/front-end/inspector.js
+++ b/WebCore/inspector/front-end/inspector.js
@@ -1448,6 +1448,7 @@ WebInspector.failedToParseScriptSource = function(sourceURL, source, startingLin
 WebInspector.pausedScript = function(callFrames)
 {
     this.panels.scripts.debuggerPaused(callFrames);
+    InspectorFrontendHost.bringToFront();
 }
 
 WebInspector.resumedScript = function()

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list