Commit 8dbc7b8e authored by joepeck@webkit.org's avatar joepeck@webkit.org

Web Inspector: Breakpoint Actions

https://bugs.webkit.org/show_bug.cgi?id=120576

Reviewed by Timothy Hatcher.

* UserInterface/Breakpoint.js:
(WebInspector.Breakpoint):
(WebInspector.Breakpoint.prototype.get actions):
(WebInspector.Breakpoint.prototype.get options):
(WebInspector.Breakpoint.prototype.get info):
(WebInspector.Breakpoint.prototype._serializableActions):
Saving, restoring, and serialization.

(WebInspector.Breakpoint.prototype.createAction):
(WebInspector.Breakpoint.prototype.recreateAction):
(WebInspector.Breakpoint.prototype.removeAction):
(WebInspector.Breakpoint.prototype.breakpointActionDidChange):
Modifying _actions ivar.

(WebInspector.Breakpoint.prototype._editBreakpointPopoverContentElement):
(WebInspector.Breakpoint.prototype._popoverActionsCreateAddActionButton):
(WebInspector.Breakpoint.prototype._popoverActionsAddActionButtonClicked):
(WebInspector.Breakpoint.prototype._popoverActionsInsertBreakpointActionView):
(WebInspector.Breakpoint.prototype.breakpointActionViewAppendActionView):
(WebInspector.Breakpoint.prototype.breakpointActionViewRemoveActionView):
(WebInspector.Breakpoint.prototype.breakpointActionViewResized):
Popover UI containing breakpoint action views and converting to and from
having no actions.

(WebInspector.Breakpoint.prototype.willDismissPopover):
Cleanup some ivars when the popover dismisses.

* UserInterface/Breakpoint.css:
(.popover .edit-breakpoint-popover-content.wide):
Wider setting when there are actions in the popover.

(.popover .edit-breakpoint-popover-content > table > tr > th):
Keep the title labels at the top of their section.

* UserInterface/BreakpointAction.js:
(WebInspector.BreakpointAction):
(WebInspector.BreakpointAction.prototype.get breakpoint):
(WebInspector.BreakpointAction.prototype.get type):
(WebInspector.BreakpointAction.prototype.get data):
(WebInspector.BreakpointAction.prototype.set data):
(WebInspector.BreakpointAction.prototype.get info):
Very basic BreakpointAction class. Notifies Breakpoint on data changes.
Type changes are not allowed, instead just create a new BreakpointAction.

* UserInterface/BreakpointActionView.css: Added.
(.breakpoint-action-block-header):
(.breakpoint-action-remove-button):
(.breakpoint-action-remove-button:active):
(.breakpoint-action-append-button):
(.breakpoint-action-block-body):
(.breakpoint-action-block-body > input):
(.breakpoint-action-eval-editor):
(.breakpoint-action-eval-editor > .CodeMirror):
(.breakpoint-action-eval-editor > .CodeMirror-scroll):
* UserInterface/BreakpointActionView.js: Added.
(WebInspector.BreakpointActionView):
(WebInspector.BreakpointActionView.displayStringForType):
(WebInspector.BreakpointActionView.prototype.get action):
(WebInspector.BreakpointActionView.prototype.get element):
(WebInspector.BreakpointActionView.prototype._pickerChanged):
(WebInspector.BreakpointActionView.prototype._appendActionButtonClicked):
(WebInspector.BreakpointActionView.prototype._removeActionButtonClicked):
(WebInspector.BreakpointActionView.prototype._updateBody.switch.break):
(WebInspector.BreakpointActionView.prototype._logInputChanged):
(WebInspector.BreakpointActionView.prototype._codeMirrorBlurred):
(WebInspector.BreakpointActionView.prototype._codeMirrorViewportChanged):
UI and form controls for individual breakpoint actions. The view
wraps a single BreakpointAction, and for any actions that could affect
other views the delegate is notified.

* UserInterface/DebuggerManager.js:
(WebInspector.DebuggerManager):
(WebInspector.DebuggerManager.prototype._debuggerBreakpointActionType):
When sending to the backend, make sure to send protocol enums.

* UserInterface/Popover.js:
(WebInspector.Popover.prototype.update):
Update the popover when content changes.

* UserInterface/Images/BreakpointActionAdd.svg: Added.
* UserInterface/Images/BreakpointActionRemove.svg: Added.
* UserInterface/InspectorBackendCommands.js:
* UserInterface/Main.html:
* Localizations/en.lproj/localizedStrings.js:
Misc. New strings, images, includes.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155133 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 3178be9c
2013-09-05 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Breakpoint Actions
https://bugs.webkit.org/show_bug.cgi?id=120576
Reviewed by Timothy Hatcher.
* UserInterface/Breakpoint.js:
(WebInspector.Breakpoint):
(WebInspector.Breakpoint.prototype.get actions):
(WebInspector.Breakpoint.prototype.get options):
(WebInspector.Breakpoint.prototype.get info):
(WebInspector.Breakpoint.prototype._serializableActions):
Saving, restoring, and serialization.
(WebInspector.Breakpoint.prototype.createAction):
(WebInspector.Breakpoint.prototype.recreateAction):
(WebInspector.Breakpoint.prototype.removeAction):
(WebInspector.Breakpoint.prototype.breakpointActionDidChange):
Modifying _actions ivar.
(WebInspector.Breakpoint.prototype._editBreakpointPopoverContentElement):
(WebInspector.Breakpoint.prototype._popoverActionsCreateAddActionButton):
(WebInspector.Breakpoint.prototype._popoverActionsAddActionButtonClicked):
(WebInspector.Breakpoint.prototype._popoverActionsInsertBreakpointActionView):
(WebInspector.Breakpoint.prototype.breakpointActionViewAppendActionView):
(WebInspector.Breakpoint.prototype.breakpointActionViewRemoveActionView):
(WebInspector.Breakpoint.prototype.breakpointActionViewResized):
Popover UI containing breakpoint action views and converting to and from
having no actions.
(WebInspector.Breakpoint.prototype.willDismissPopover):
Cleanup some ivars when the popover dismisses.
* UserInterface/Breakpoint.css:
(.popover .edit-breakpoint-popover-content.wide):
Wider setting when there are actions in the popover.
(.popover .edit-breakpoint-popover-content > table > tr > th):
Keep the title labels at the top of their section.
* UserInterface/BreakpointAction.js:
(WebInspector.BreakpointAction):
(WebInspector.BreakpointAction.prototype.get breakpoint):
(WebInspector.BreakpointAction.prototype.get type):
(WebInspector.BreakpointAction.prototype.get data):
(WebInspector.BreakpointAction.prototype.set data):
(WebInspector.BreakpointAction.prototype.get info):
Very basic BreakpointAction class. Notifies Breakpoint on data changes.
Type changes are not allowed, instead just create a new BreakpointAction.
* UserInterface/BreakpointActionView.css: Added.
(.breakpoint-action-block-header):
(.breakpoint-action-remove-button):
(.breakpoint-action-remove-button:active):
(.breakpoint-action-append-button):
(.breakpoint-action-block-body):
(.breakpoint-action-block-body > input):
(.breakpoint-action-eval-editor):
(.breakpoint-action-eval-editor > .CodeMirror):
(.breakpoint-action-eval-editor > .CodeMirror-scroll):
* UserInterface/BreakpointActionView.js: Added.
(WebInspector.BreakpointActionView):
(WebInspector.BreakpointActionView.displayStringForType):
(WebInspector.BreakpointActionView.prototype.get action):
(WebInspector.BreakpointActionView.prototype.get element):
(WebInspector.BreakpointActionView.prototype._pickerChanged):
(WebInspector.BreakpointActionView.prototype._appendActionButtonClicked):
(WebInspector.BreakpointActionView.prototype._removeActionButtonClicked):
(WebInspector.BreakpointActionView.prototype._updateBody.switch.break):
(WebInspector.BreakpointActionView.prototype._logInputChanged):
(WebInspector.BreakpointActionView.prototype._codeMirrorBlurred):
(WebInspector.BreakpointActionView.prototype._codeMirrorViewportChanged):
UI and form controls for individual breakpoint actions. The view
wraps a single BreakpointAction, and for any actions that could affect
other views the delegate is notified.
* UserInterface/DebuggerManager.js:
(WebInspector.DebuggerManager):
(WebInspector.DebuggerManager.prototype._debuggerBreakpointActionType):
When sending to the backend, make sure to send protocol enums.
* UserInterface/Popover.js:
(WebInspector.Popover.prototype.update):
Update the popover when content changes.
* UserInterface/Images/BreakpointActionAdd.svg: Added.
* UserInterface/Images/BreakpointActionRemove.svg: Added.
* UserInterface/InspectorBackendCommands.js:
* UserInterface/Main.html:
* Localizations/en.lproj/localizedStrings.js:
Misc. New strings, images, includes.
2013-09-03 Antoine Quint <graouts@apple.com>
Web Inspector: exceptions triggered from console evaluation do not pause the debugger
......
......@@ -31,6 +31,10 @@
font-size: 11px;
}
.popover .edit-breakpoint-popover-content.wide {
width: 460px;
}
.popover .edit-breakpoint-popover-content > label.toggle {
color: black;
font-weight: bold;
......@@ -47,6 +51,8 @@
font-weight: bold;
text-align: right;
width: 1px; /* Shrink to fit. */
vertical-align: top;
line-height: 23px;
}
.popover .edit-breakpoint-popover-content > table > tr > td {
......
/*
* Copyright (C) 2013 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
WebInspector.BreakpointAction = function(breakpoint, typeOrInfo, data)
{
WebInspector.Object.call(this);
console.assert(breakpoint);
console.assert(typeOrInfo);
this._breakpoint = breakpoint;
if (typeof typeOrInfo === "string") {
this._type = typeOrInfo;
this._data = data || null;
} else if (typeof typeOrInfo === "object") {
this._type = typeOrInfo.type;
this._data = typeOrInfo.data || null;
} else
console.error("Unexpected type passed to WebInspector.BreakpointAction");
console.assert(typeof this._type === "string");
};
WebInspector.BreakpointAction.Type = {
Log: "log",
Evaluate: "evaluate",
Sound: "sound"
}
WebInspector.BreakpointAction.prototype = {
constructor: WebInspector.BreakpointAction,
// Public
get breakpoint()
{
return this._breakpoint;
},
get type()
{
return this._type;
},
get data()
{
return this._data;
},
set data(data)
{
if (this._data === data)
return;
this._data = data;
this._breakpoint.breakpointActionDidChange(this);
},
get info()
{
var obj = {type: this._type};
if (this._data)
obj.data = this._data;
return obj;
}
};
WebInspector.BreakpointAction.prototype.__proto__ = WebInspector.Object.prototype;
/*
* Copyright (C) 2013 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
.breakpoint-action-block-header {
margin-bottom: 3px;
}
.breakpoint-action-append-button,
.breakpoint-action-remove-button {
border: 1px solid rgb(170, 170, 170);
border-radius: 10px;
background-size: 16px 16px;
background-origin: border-box;
width: 16px;
height: 16px;
float: right;
margin-left: 2px;
margin-top: 2px;
}
.breakpoint-action-append-button:active,
.breakpoint-action-remove-button:active {
-webkit-filter: brightness(50%);
}
.breakpoint-action-append-button {
background-image: url(Images/BreakpointActionAdd.svg), -webkit-linear-gradient(top, rgb(250, 250, 250), rgb(200, 200, 200));
}
.breakpoint-action-remove-button {
background-image: url(Images/BreakpointActionRemove.svg), -webkit-linear-gradient(top, rgb(250, 250, 250), rgb(200, 200, 200));
}
.breakpoint-action-block-body {
margin: 1px 2px 6px 2px;
padding: 8px;
width: 100%;
border-radius: 4px;
border: 1px solid rgb(190, 190, 190);
background-color: rgba(222, 222, 222, 0.95);
-webkit-box-shadow: inset 0 0 2px rgb(200, 200, 200);
}
.breakpoint-action-block-body > input {
width: 100%;
}
.breakpoint-action-eval-editor {
padding: 4px 0 2px 0;
-webkit-appearance: textfield;
border: 1px solid rgb(200, 200, 200);
background: white;
}
.breakpoint-action-eval-editor > .CodeMirror {
width: 100%;
height: auto;
}
.breakpoint-action-eval-editor > .CodeMirror-scroll {
width: 100%;
overflow: hidden;
}
/*
* Copyright (C) 2013 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
WebInspector.BreakpointActionView = function(action, delegate, omitFocus)
{
WebInspector.Object.call(this);
console.assert(action);
console.assert(delegate);
console.assert(DebuggerAgent.BreakpointActionType);
this._action = action;
this._delegate = delegate;
this._element = document.createElement("div");
this._element.className = "breakpoint-action-block";
var header = this._element.appendChild(document.createElement("div"));
header.className = "breakpoint-action-block-header";
var picker = header.appendChild(document.createElement("select"));
picker.addEventListener("change", this._pickerChanged.bind(this));
for (var key in WebInspector.BreakpointAction.Type) {
var type = WebInspector.BreakpointAction.Type[key];
var option = document.createElement("option");
option.textContent = WebInspector.BreakpointActionView.displayStringForType(type);
option.selected = this._action.type === type;
option.value = type;
picker.add(option);
}
var appendActionButton = header.appendChild(document.createElement("button"));
appendActionButton.className = "breakpoint-action-append-button";
appendActionButton.addEventListener("click", this._appendActionButtonClicked.bind(this));
appendActionButton.title = WebInspector.UIString("Add new breakpoint action after this action");
var removeActionButton = header.appendChild(document.createElement("button"));
removeActionButton.className = "breakpoint-action-remove-button";
removeActionButton.addEventListener("click", this._removeActionButtonClicked.bind(this));
removeActionButton.title = WebInspector.UIString("Remove this breakpoint action");
this._bodyElement = this._element.appendChild(document.createElement("div"));
this._bodyElement.className = "breakpoint-action-block-body";
this._updateBody(omitFocus);
};
WebInspector.BreakpointActionView.displayStringForType = function(type)
{
switch (type) {
case WebInspector.BreakpointAction.Type.Log:
return WebInspector.UIString("Log Message");
case WebInspector.BreakpointAction.Type.Evaluate:
return WebInspector.UIString("Evaluate JavaScript");
case WebInspector.BreakpointAction.Type.Sound:
return WebInspector.UIString("Play Sound");
default:
console.assert(false);
return "";
}
}
WebInspector.BreakpointActionView.prototype = {
constructor: WebInspector.BreakpointActionView,
// Public
get action()
{
return this._action;
},
get element()
{
return this._element;
},
// Private
_pickerChanged: function(event)
{
var newType = event.target.value;
this._action = this._action.breakpoint.recreateAction(newType, this._action);
this._updateBody();
this._delegate.breakpointActionViewResized(this);
},
_appendActionButtonClicked: function(event)
{
var newAction = this._action.breakpoint.createAction(WebInspector.Breakpoint.DefaultBreakpointActionType, this._action);
this._delegate.breakpointActionViewAppendActionView(this, newAction);
},
_removeActionButtonClicked: function(event)
{
this._action.breakpoint.removeAction(this._action);
this._delegate.breakpointActionViewRemoveActionView(this);
},
_updateBody: function(omitFocus)
{
this._bodyElement.removeChildren();
switch (this._action.type) {
case WebInspector.BreakpointAction.Type.Log:
this._bodyElement.hidden = false;
var input = this._bodyElement.appendChild(document.createElement("input"));
input.placeholder = WebInspector.UIString("Message");
input.addEventListener("change", this._logInputChanged.bind(this));
input.value = this._action.data || "";
if (!omitFocus)
setTimeout(function() { input.focus(); }, 0);
break;
case WebInspector.BreakpointAction.Type.Evaluate:
this._bodyElement.hidden = false;
var editorElement = this._bodyElement.appendChild(document.createElement("div"));
editorElement.classList.add("breakpoint-action-eval-editor");
editorElement.classList.add(WebInspector.SyntaxHighlightedStyleClassName);
this._codeMirror = CodeMirror(editorElement, {
lineWrapping: true,
mode: "text/javascript",
indentWithTabs: true,
indentUnit: 4,
matchBrackets: true,
value: this._action.data || "",
});
this._codeMirror.on("viewportChange", this._codeMirrorViewportChanged.bind(this));
this._codeMirror.on("blur", this._codeMirrorBlurred.bind(this));
var completionController = new WebInspector.CodeMirrorCompletionController(this._codeMirror);
// CodeMirror needs a refresh after the popover displays, to layout, otherwise it doesn't appear.
setTimeout(function() {
this._codeMirror.refresh();
if (!omitFocus)
this._codeMirror.focus();
}.bind(this), 0);
break;
case WebInspector.BreakpointAction.Type.Sound:
this._bodyElement.hidden = true;
break;
default:
console.assert(false);
this._bodyElement.hidden = true;
break;
}
},
_logInputChanged: function(event)
{
this._action.data = event.target.value;
},
_codeMirrorBlurred: function(event)
{
this._action.data = this._codeMirror.getValue();
},
_codeMirrorViewportChanged: function(event)
{
this._delegate.breakpointActionViewResized(this);
}
};
WebInspector.BreakpointActionView.prototype.__proto__ = WebInspector.Object.prototype;
......@@ -33,6 +33,7 @@ WebInspector.DebuggerManager = function()
WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.DisabledStateDidChange, this._breakpointDisabledStateDidChange, this);
WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.ConditionDidChange, this._breakpointEditablePropertyDidChange, this);
WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.AutoContinueDidChange, this._breakpointEditablePropertyDidChange, this);
WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.ActionsDidChange, this._breakpointEditablePropertyDidChange, this);
window.addEventListener("pagehide", this._inspectorClosing.bind(this));
......@@ -470,6 +471,21 @@ WebInspector.DebuggerManager.prototype = {
return new WebInspector.ScopeChainNode(type, object);
},
_debuggerBreakpointActionType: function(type)
{
switch (type) {
case WebInspector.BreakpointAction.Type.Log:
return DebuggerAgent.BreakpointActionType.Log;
case WebInspector.BreakpointAction.Type.Evaluate:
return DebuggerAgent.BreakpointActionType.Evaluate;
case WebInspector.BreakpointAction.Type.Sound:
return DebuggerAgent.BreakpointActionType.Sound;
default:
console.assert(false);
return DebuggerAgent.BreakpointActionType.Log;
}
},
_setBreakpoint: function(breakpoint, callback)
{
console.assert(!breakpoint.id);
......@@ -496,6 +512,14 @@ WebInspector.DebuggerManager.prototype = {
// If something goes wrong it will stay unresolved and show up as such in the user interface.
breakpoint.resolved = false;
// Convert BreakpointAction types to DebuggerAgent protocol types.
// NOTE: Breakpoint.options returns new objects each time, so it is safe to modify.
var options = breakpoint.options;
if (options.actions.length) {
for (var i = 0; i < options.actions.length; ++i)
options.actions[i].type = this._debuggerBreakpointActionType(options.actions[i].type);
}
// COMPATIBILITY (iOS 7): iOS 7 and earlier, DebuggerAgent.setBreakpoint* took a "condition" string argument.
// This has been replaced with an "options" BreakpointOptions object.
if (breakpoint.url) {
......@@ -505,13 +529,13 @@ WebInspector.DebuggerManager.prototype = {
urlRegex: undefined,
columnNumber: breakpoint.sourceCodeLocation.columnNumber,
condition: breakpoint.condition,
options: breakpoint.options
options: options
}, didSetBreakpoint.bind(this));
} else if (breakpoint.scriptIdentifier) {
DebuggerAgent.setBreakpoint.invoke({
location: {scriptId: breakpoint.scriptIdentifier, lineNumber: breakpoint.sourceCodeLocation.lineNumber, columnNumber: breakpoint.sourceCodeLocation.columnNumber},
condition: breakpoint.condition,
options: breakpoint.options
options: options
}, didSetBreakpoint.bind(this));
}
},
......@@ -525,6 +549,9 @@ WebInspector.DebuggerManager.prototype = {
function didRemoveBreakpoint(error)
{
if (error)
console.log(error);
delete this._breakpointIdMap[breakpoint.id];
breakpoint.id = null;
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright © 2013 Apple Inc. All rights reserved. -->
<svg viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg">
<path stroke="rgb(241, 242, 243)" stroke-width="2" d="M 4 9 L 12 9 M 8 5 L 8 13"/>
<path stroke="rgb(129, 129, 129)" stroke-width="2" d="M 4 8 L 12 8 M 8 4 L 8 12"/>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright © 2013 Apple Inc. All rights reserved. -->
<svg viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg">
<path stroke="rgb(241, 242, 243)" stroke-width="2" d="M 12 9 L 4 9"/>
<path stroke="rgb(129, 129, 129)" stroke-width="2" d="M 12 8 L 4 8"/>
</svg>
......@@ -272,6 +272,7 @@ InspectorBackend.registerCommand("Timeline.canMonitorMainThread", [], ["result"]
// Debugger.
InspectorBackend.registerDebuggerDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "Debugger");
InspectorBackend.registerEnum("Debugger.BreakpointActionType", {Log: "log", Evaluate: "evaluate", Sound: "sound"});
InspectorBackend.registerEnum("Debugger.ScopeType", {Global: "global", Local: "local", With: "with", Closure: "closure", Catch: "catch"});
InspectorBackend.registerEvent("Debugger.globalObjectCleared", []);
InspectorBackend.registerEvent("Debugger.scriptParsed", ["scriptId", "url", "startLine", "startColumn", "endLine", "endColumn", "isContentScript", "sourceMapURL", "hasSourceURL"]);
......
......@@ -94,6 +94,7 @@
<link rel="stylesheet" href="LayerTreeSidebarPanel.css">
<link rel="stylesheet" href="EventListenerSectionGroup.css">
<link rel="stylesheet" href="Breakpoint.css">
<link rel="stylesheet" href="BreakpointActionView.css">
<link rel="stylesheet" href="BreakpointIcons.css">
<link rel="stylesheet" href="BreakpointTreeElement.css">
<link rel="stylesheet" href="QuickConsole.css">
......@@ -347,6 +348,8 @@
<script src="CanvasProfileObject.js"></script>
<script src="DebuggerSidebarPanel.js"></script>
<script src="BreakpointTreeElement.js"></script>
<script src="BreakpointAction.js"></script>
<script src="BreakpointActionView.js"></script>
<script src="Breakpoint.js"></script>
<script src="DebuggerManager.js"></script>
<script src="SourceMapManager.js"></script>
......
......@@ -99,6 +99,20 @@ WebInspector.Popover.prototype = {
this._update();
},
update: function()
{
if (!this.visible)
return;
var previouslyFocusedElement = document.activeElement;
this._contentNeedsUpdate = true;
this._update();
if (previouslyFocusedElement)
previouslyFocusedElement.focus();
},
/**
* @param {WebInspector.Rect} targetFrame
* @param {WebInspector.RectEdge}[] preferredEdges
......@@ -151,7 +165,7 @@ WebInspector.Popover.prototype = {
// Private
_update: function(replaceContent)
_update: function()
{
var targetFrame = this._targetFrame;
var preferredEdges = this._preferredEdges;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment