summaryrefslogtreecommitdiffstats
path: root/WebCore/inspector/front-end/SourceFrame.js
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-08-27 11:02:25 +0100
committerSteve Block <steveblock@google.com>2010-09-02 17:17:20 +0100
commite8b154fd68f9b33be40a3590e58347f353835f5c (patch)
tree0733ce26384183245aaa5656af26c653636fe6c1 /WebCore/inspector/front-end/SourceFrame.js
parentda56157816334089526a7a115a85fd85a6e9a1dc (diff)
downloadexternal_webkit-e8b154fd68f9b33be40a3590e58347f353835f5c.zip
external_webkit-e8b154fd68f9b33be40a3590e58347f353835f5c.tar.gz
external_webkit-e8b154fd68f9b33be40a3590e58347f353835f5c.tar.bz2
Merge WebKit at r66079 : Initial merge by git
Change-Id: Ie2e1440fb9d487d24e52c247342c076fecaecac7
Diffstat (limited to 'WebCore/inspector/front-end/SourceFrame.js')
-rw-r--r--WebCore/inspector/front-end/SourceFrame.js28
1 files changed, 15 insertions, 13 deletions
diff --git a/WebCore/inspector/front-end/SourceFrame.js b/WebCore/inspector/front-end/SourceFrame.js
index 01a8ec2..16b8e8d 100644
--- a/WebCore/inspector/front-end/SourceFrame.js
+++ b/WebCore/inspector/front-end/SourceFrame.js
@@ -28,7 +28,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-WebInspector.SourceFrame = function(parentElement, addBreakpointDelegate, removeBreakpointDelegate, editDelegate, continueToHereDelegate)
+WebInspector.SourceFrame = function(parentElement, addBreakpointDelegate, editDelegate, continueToHereDelegate)
{
this._parentElement = parentElement;
@@ -44,7 +44,6 @@ WebInspector.SourceFrame = function(parentElement, addBreakpointDelegate, remove
this._continueToHereDelegate = continueToHereDelegate;
this._addBreakpointDelegate = addBreakpointDelegate;
- this._removeBreakpointDelegate = removeBreakpointDelegate;
this._editDelegate = editDelegate;
this._popoverObjectGroup = "popover";
}
@@ -55,7 +54,7 @@ WebInspector.SourceFrame.prototype = {
{
this._visible = visible;
this._createViewerIfNeeded();
-
+
if (visible) {
if (this._textViewer && this._scrollTop)
this._textViewer.element.scrollTop = this._scrollTop;
@@ -99,19 +98,16 @@ WebInspector.SourceFrame.prototype = {
addBreakpoint: function(breakpoint)
{
this.breakpoints.push(breakpoint);
- breakpoint.addEventListener("enabled", this._breakpointChanged, this);
- breakpoint.addEventListener("disabled", this._breakpointChanged, this);
- breakpoint.addEventListener("condition-changed", this._breakpointChanged, this);
+ breakpoint.addEventListener("removed", this._breakpointRemoved, this);
if (this._textViewer)
this._addBreakpointToSource(breakpoint);
},
- removeBreakpoint: function(breakpoint)
+ _breakpointRemoved: function(event)
{
+ var breakpoint = event.target;
+
this.breakpoints.remove(breakpoint);
- breakpoint.removeEventListener("enabled", null, this);
- breakpoint.removeEventListener("disabled", null, this);
- breakpoint.removeEventListener("condition-changed", null, this);
if (this._textViewer)
this._removeBreakpointFromSource(breakpoint);
},
@@ -384,6 +380,9 @@ WebInspector.SourceFrame.prototype = {
_addBreakpointToSource: function(breakpoint)
{
+ breakpoint.addEventListener("enable-changed", this._breakpointChanged, this);
+ breakpoint.addEventListener("condition-changed", this._breakpointChanged, this);
+
var lineNumber = breakpoint.line - 1;
if (lineNumber >= this._textModel.linesCount)
return;
@@ -402,6 +401,9 @@ WebInspector.SourceFrame.prototype = {
_removeBreakpointFromSource: function(breakpoint)
{
+ breakpoint.removeEventListener("enable-changed", null, this);
+ breakpoint.removeEventListener("condition-changed", null, this);
+
var lineNumber = breakpoint.line - 1;
this._textViewer.beginUpdates();
this._textModel.removeAttribute(lineNumber, "breakpoint");
@@ -431,7 +433,7 @@ WebInspector.SourceFrame.prototype = {
// 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 + 1));
- function addConditionalBreakpoint()
+ function addConditionalBreakpoint()
{
this._addBreakpointDelegate(lineNumber + 1);
var breakpoint = this._textModel.getAttribute(lineNumber, "breakpoint");
@@ -442,7 +444,7 @@ WebInspector.SourceFrame.prototype = {
contextMenu.appendItem(WebInspector.UIString("Add Conditional Breakpoint…"), addConditionalBreakpoint.bind(this));
} else {
// This row has a breakpoint, we want to show edit and remove breakpoint, and either disable or enable.
- contextMenu.appendItem(WebInspector.UIString("Remove Breakpoint"), this._removeBreakpointDelegate.bind(this, breakpoint));
+ contextMenu.appendItem(WebInspector.UIString("Remove Breakpoint"), breakpoint.remove.bind(breakpoint));
contextMenu.appendItem(WebInspector.UIString("Edit Breakpoint…"), this._editBreakpointCondition.bind(this, breakpoint));
if (breakpoint.enabled)
contextMenu.appendItem(WebInspector.UIString("Disable Breakpoint"), function() { breakpoint.enabled = false; });
@@ -475,7 +477,7 @@ WebInspector.SourceFrame.prototype = {
if (event.shiftKey)
breakpoint.enabled = !breakpoint.enabled;
else
- this._removeBreakpointDelegate(breakpoint);
+ breakpoint.remove();
} else
this._addBreakpointDelegate(lineNumber + 1);
event.preventDefault();