diff options
Diffstat (limited to 'WebCore/inspector/front-end/CallStackSidebarPane.js')
-rw-r--r-- | WebCore/inspector/front-end/CallStackSidebarPane.js | 60 |
1 files changed, 35 insertions, 25 deletions
diff --git a/WebCore/inspector/front-end/CallStackSidebarPane.js b/WebCore/inspector/front-end/CallStackSidebarPane.js index 91f35a6..6212ea1 100644 --- a/WebCore/inspector/front-end/CallStackSidebarPane.js +++ b/WebCore/inspector/front-end/CallStackSidebarPane.js @@ -28,6 +28,11 @@ WebInspector.CallStackSidebarPane = function() WebInspector.SidebarPane.call(this, WebInspector.UIString("Call Stack")); } +WebInspector.CallStackSidebarPane.DebuggerEventType = { + DOMBreakpoint: 0, + NativeBreakpoint: 1 +}; + WebInspector.CallStackSidebarPane.prototype = { update: function(callFrames, sourceIDMap) { @@ -82,36 +87,41 @@ WebInspector.CallStackSidebarPane.prototype = { } }, - updateStatus: function(status) + updateStatus: function(eventType, eventData) { var statusElement = document.createElement("div"); - statusElement.className = "info"; - - var breakpointType = status.breakpoint.type; - var substitutions = [WebInspector.DOMBreakpoint.labelForType(breakpointType), WebInspector.panels.elements.linkifyNodeById(status.breakpoint.nodeId)]; - var formatters = { - s: function(substitution) + if (eventType === WebInspector.CallStackSidebarPane.DebuggerEventType.DOMBreakpoint) { + var breakpoint = eventData.breakpoint; + var substitutions = [WebInspector.DOMBreakpoint.labelForType(breakpoint.type), WebInspector.panels.elements.linkifyNodeById(breakpoint.nodeId)]; + var formatters = { + s: function(substitution) + { + return substitution; + } + }; + function append(a, b) { - return substitution; + if (typeof b === "string") + b = document.createTextNode(b); + statusElement.appendChild(b); } - }; - function append(a, b) - { - if (typeof b === "string") - b = document.createTextNode(b); - statusElement.appendChild(b); - } - if (breakpointType === WebInspector.DOMBreakpoint.Types.SubtreeModified) { - var targetNode = WebInspector.panels.elements.linkifyNodeById(status.targetNodeId); - if (status.insertion) { - if (status.targetNodeId !== status.breakpoint.nodeId) - WebInspector.formatLocalized("Paused on a \"%s\" breakpoint set on %s, because a new child was added to its descendant %s.", substitutions.concat(targetNode), formatters, "", append); - else - WebInspector.formatLocalized("Paused on a \"%s\" breakpoint set on %s, because a new child was added to that node.", substitutions, formatters, "", append); + if (breakpoint.type === WebInspector.DOMBreakpoint.Types.SubtreeModified) { + var targetNode = WebInspector.panels.elements.linkifyNodeById(eventData.targetNodeId); + if (eventData.insertion) { + if (eventData.targetNodeId !== breakpoint.nodeId) + WebInspector.formatLocalized("Paused on a \"%s\" breakpoint set on %s, because a new child was added to its descendant %s.", substitutions.concat(targetNode), formatters, "", append); + else + WebInspector.formatLocalized("Paused on a \"%s\" breakpoint set on %s, because a new child was added to that node.", substitutions, formatters, "", append); + } else + WebInspector.formatLocalized("Paused on a \"%s\" breakpoint set on %s, because its descendant %s was removed.", substitutions.concat(targetNode), formatters, "", append); } else - WebInspector.formatLocalized("Paused on a \"%s\" breakpoint set on %s, because its descendant %s was removed.", substitutions.concat(targetNode), formatters, "", append); - } else - WebInspector.formatLocalized("Paused on a \"%s\" breakpoint set on %s.", substitutions, formatters, "", append); + WebInspector.formatLocalized("Paused on a \"%s\" breakpoint set on %s.", substitutions, formatters, "", append); + } else if (eventType === WebInspector.CallStackSidebarPane.DebuggerEventType.NativeBreakpoint && eventData.type === "XHR") + statusElement.appendChild(document.createTextNode(WebInspector.UIString("Paused on XMLHttpRequest."))); + else + return; + + statusElement.className = "info"; this.bodyElement.appendChild(statusElement); }, |