Changeset 83864 in webkit


Ignore:
Timestamp:
Apr 14, 2011 9:18:48 AM (13 years ago)
Author:
podivilov@chromium.org
Message:

2011-04-14 Pavel Podivilov <podivilov@chromium.org>

Reviewed by Pavel Feldman.

Web Inspector: re-implement dom breakpoints.
https://bugs.webkit.org/show_bug.cgi?id=57038

  • inspector/debugger/dom-breakpoints.html:

2011-04-14 Pavel Podivilov <podivilov@chromium.org>

Reviewed by Pavel Feldman.

Web Inspector: re-implement dom breakpoints.
https://bugs.webkit.org/show_bug.cgi?id=57038

  • WebCore.gypi:
  • WebCore.vcproj/WebCore.vcproj:
  • inspector/front-end/BreakpointManager.js: Removed.
  • inspector/front-end/BreakpointsSidebarPane.js: (WebInspector.NativeBreakpointsSidebarPane): (WebInspector.NativeBreakpointsSidebarPane.prototype._reset): (WebInspector.XHRBreakpointsSidebarPane.prototype._restoreBreakpoints):
  • inspector/front-end/CallStackSidebarPane.js: (WebInspector.CallStackSidebarPane.prototype.update): (WebInspector.CallStackSidebarPane.prototype.setStatus):
  • inspector/front-end/DOMAgent.js: (WebInspector.DOMNode): (WebInspector.DOMAgent.prototype._childNodeRemoved):
  • inspector/front-end/DOMBreakpointsSidebarPane.js: Added. (WebInspector.DOMBreakpointsSidebarPane): (WebInspector.DOMBreakpointsSidebarPane.prototype.setInspectedURL): (WebInspector.DOMBreakpointsSidebarPane.prototype.populateNodeContextMenu.toggleBreakpoint): (WebInspector.DOMBreakpointsSidebarPane.prototype.populateNodeContextMenu): (WebInspector.DOMBreakpointsSidebarPane.prototype.createBreakpointHitStatusMessage.didPushNodeToFrontend): (WebInspector.DOMBreakpointsSidebarPane.prototype.createBreakpointHitStatusMessage): (WebInspector.DOMBreakpointsSidebarPane.prototype._doCreateBreakpointHitStatusMessage.formatters.s): (WebInspector.DOMBreakpointsSidebarPane.prototype._doCreateBreakpointHitStatusMessage.append): (WebInspector.DOMBreakpointsSidebarPane.prototype._doCreateBreakpointHitStatusMessage): (WebInspector.DOMBreakpointsSidebarPane.prototype.nodeRemoved): (WebInspector.DOMBreakpointsSidebarPane.prototype._removeBreakpointsForNode): (WebInspector.DOMBreakpointsSidebarPane.prototype._setBreakpoint): (WebInspector.DOMBreakpointsSidebarPane.prototype._removeBreakpoint): (WebInspector.DOMBreakpointsSidebarPane.prototype._contextMenu.removeBreakpoint): (WebInspector.DOMBreakpointsSidebarPane.prototype._contextMenu): (WebInspector.DOMBreakpointsSidebarPane.prototype._checkboxClicked): (WebInspector.DOMBreakpointsSidebarPane.prototype.highlightBreakpoint): (WebInspector.DOMBreakpointsSidebarPane.prototype.clearBreakpointHighlight): (WebInspector.DOMBreakpointsSidebarPane.prototype._createBreakpointId): (WebInspector.DOMBreakpointsSidebarPane.prototype._saveBreakpoints): (WebInspector.DOMBreakpointsSidebarPane.prototype.restoreBreakpoints):
  • inspector/front-end/ElementsPanel.js: (WebInspector.ElementsPanel): (WebInspector.ElementsPanel.prototype.show): (WebInspector.ElementsPanel.prototype.updateModifiedNodes): (WebInspector.ElementsPanel.prototype.updateBreadcrumbSizes.coalesceCollapsedCrumbs):
  • inspector/front-end/ElementsTreeOutline.js: (WebInspector.ElementsTreeElement.prototype._populateTagContextMenu):
  • inspector/front-end/ScriptsPanel.js: (WebInspector.ScriptsPanel): (WebInspector.ScriptsPanel.prototype.show): (WebInspector.ScriptsPanel.prototype._debuggerPaused.didCreateBreakpointHitStatusMessage): (WebInspector.ScriptsPanel.prototype._debuggerPaused.else.didGetSourceLocation): (WebInspector.ScriptsPanel.prototype._debuggerPaused): (WebInspector.ScriptsPanel.prototype._clearInterface):
  • inspector/front-end/Settings.js: (WebInspector.Settings): (WebInspector.Settings.prototype._set):
  • inspector/front-end/WebKit.qrc:
  • inspector/front-end/inspector.html:
  • inspector/front-end/inspector.js: (WebInspector.inspectedURLChanged):
  • inspector/front-end/utilities.js: ():
Location:
trunk
Files:
1 added
1 deleted
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r83862 r83864  
     12011-04-14  Pavel Podivilov  <podivilov@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        Web Inspector: re-implement dom breakpoints.
     6        https://bugs.webkit.org/show_bug.cgi?id=57038
     7
     8        * inspector/debugger/dom-breakpoints.html:
     9
    1102011-04-14  Satish Sampath  <satish@chromium.org>
    211
  • trunk/LayoutTests/inspector/debugger/dom-breakpoints.html

    r80422 r83864  
    2727function test()
    2828{
     29    var pane = WebInspector.domBreakpointsSidebarPane;
    2930    var rootElement;
    3031    InspectorTest.runDebuggerTestSuite([
     
    3738            {
    3839                rootElement = node;
    39                 WebInspector.breakpointManager.createDOMBreakpoint(node.id, WebInspector.DOMBreakpointTypes.SubtreeModified);
     40                pane._setBreakpoint(node, pane._breakpointTypes.SubtreeModified, true);
    4041                InspectorTest.addResult("Set 'Subtree Modified' DOM breakpoint on rootElement.");
    4142                InspectorTest.evaluateInPageWithTimeout("appendElement('rootElement', 'childElement')");
     
    6263            function step2()
    6364            {
    64                 rootElement.breakpoints[WebInspector.DOMBreakpointTypes.SubtreeModified].remove();
     65                pane._removeBreakpoint(rootElement, pane._breakpointTypes.SubtreeModified);
    6566                next();
    6667            }
     
    7071        {
    7172            InspectorTest.addResult("Test that 'Attribute Modified' breakpoint is hit when modifying attribute.");
    72             WebInspector.breakpointManager.createDOMBreakpoint(rootElement.id, WebInspector.DOMBreakpointTypes.AttributeModified);
     73            pane._setBreakpoint(rootElement, pane._breakpointTypes.AttributeModified, true);
    7374            InspectorTest.addResult("Set 'Attribute Modified' DOM breakpoint on rootElement.");
    7475            InspectorTest.evaluateInPageWithTimeout("modifyAttribute('rootElement', 'className', 'foo')");
     
    7879            function step2(callFrames)
    7980            {
    80                 rootElement.breakpoints[WebInspector.DOMBreakpointTypes.AttributeModified].remove();
     81                pane._removeBreakpoint(rootElement, pane._breakpointTypes.AttributeModified);
    8182                next();
    8283            }
     
    9091            function step2(node)
    9192            {
    92                 WebInspector.breakpointManager.createDOMBreakpoint(node.id, WebInspector.DOMBreakpointTypes.NodeRemoved);
     93                pane._setBreakpoint(node, pane._breakpointTypes.NodeRemoved, true);
    9394                InspectorTest.addResult("Set 'Node Removed' DOM breakpoint on elementToRemove.");
    9495                InspectorTest.evaluateInPageWithTimeout("removeElement('elementToRemove')");
     
    105106            function step2(node)
    106107            {
    107                 WebInspector.breakpointManager.createDOMBreakpoint(node.id, WebInspector.DOMBreakpointTypes.SubtreeModified);
     108                pane._setBreakpoint(node, pane._breakpointTypes.SubtreeModified, true);
     109                pane._saveBreakpoints();
    108110                InspectorTest.addResult("Set 'Subtree Modified' DOM breakpoint on rootElement.");
    109111                InspectorTest.reloadPage(step3);
     
    122124    {
    123125        InspectorTest.waitUntilPaused(paused);
    124         InspectorTest.addSniffer(WebInspector.DOMBreakpointView.prototype, "_format", format);
    125 
     126        InspectorTest.addSniffer(WebInspector.CallStackSidebarPane.prototype, "setStatus", setStatus);
    126127
    127128        var caption;
    128129        var callFrames;
    129130
    130         function format(element)
     131        function setStatus(status)
    131132        {
    132             caption = element.textContent;
     133            if (typeof status === "string")
     134                caption = status;
     135            else
     136                caption = status.textContent;
    133137            if (callFrames)
    134138                step1();
  • trunk/Source/WebCore/ChangeLog

    r83862 r83864  
     12011-04-14  Pavel Podivilov  <podivilov@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        Web Inspector: re-implement dom breakpoints.
     6        https://bugs.webkit.org/show_bug.cgi?id=57038
     7
     8        * WebCore.gypi:
     9        * WebCore.vcproj/WebCore.vcproj:
     10        * inspector/front-end/BreakpointManager.js: Removed.
     11        * inspector/front-end/BreakpointsSidebarPane.js:
     12        (WebInspector.NativeBreakpointsSidebarPane):
     13        (WebInspector.NativeBreakpointsSidebarPane.prototype._reset):
     14        (WebInspector.XHRBreakpointsSidebarPane.prototype._restoreBreakpoints):
     15        * inspector/front-end/CallStackSidebarPane.js:
     16        (WebInspector.CallStackSidebarPane.prototype.update):
     17        (WebInspector.CallStackSidebarPane.prototype.setStatus):
     18        * inspector/front-end/DOMAgent.js:
     19        (WebInspector.DOMNode):
     20        (WebInspector.DOMAgent.prototype._childNodeRemoved):
     21        * inspector/front-end/DOMBreakpointsSidebarPane.js: Added.
     22        (WebInspector.DOMBreakpointsSidebarPane):
     23        (WebInspector.DOMBreakpointsSidebarPane.prototype.setInspectedURL):
     24        (WebInspector.DOMBreakpointsSidebarPane.prototype.populateNodeContextMenu.toggleBreakpoint):
     25        (WebInspector.DOMBreakpointsSidebarPane.prototype.populateNodeContextMenu):
     26        (WebInspector.DOMBreakpointsSidebarPane.prototype.createBreakpointHitStatusMessage.didPushNodeToFrontend):
     27        (WebInspector.DOMBreakpointsSidebarPane.prototype.createBreakpointHitStatusMessage):
     28        (WebInspector.DOMBreakpointsSidebarPane.prototype._doCreateBreakpointHitStatusMessage.formatters.s):
     29        (WebInspector.DOMBreakpointsSidebarPane.prototype._doCreateBreakpointHitStatusMessage.append):
     30        (WebInspector.DOMBreakpointsSidebarPane.prototype._doCreateBreakpointHitStatusMessage):
     31        (WebInspector.DOMBreakpointsSidebarPane.prototype.nodeRemoved):
     32        (WebInspector.DOMBreakpointsSidebarPane.prototype._removeBreakpointsForNode):
     33        (WebInspector.DOMBreakpointsSidebarPane.prototype._setBreakpoint):
     34        (WebInspector.DOMBreakpointsSidebarPane.prototype._removeBreakpoint):
     35        (WebInspector.DOMBreakpointsSidebarPane.prototype._contextMenu.removeBreakpoint):
     36        (WebInspector.DOMBreakpointsSidebarPane.prototype._contextMenu):
     37        (WebInspector.DOMBreakpointsSidebarPane.prototype._checkboxClicked):
     38        (WebInspector.DOMBreakpointsSidebarPane.prototype.highlightBreakpoint):
     39        (WebInspector.DOMBreakpointsSidebarPane.prototype.clearBreakpointHighlight):
     40        (WebInspector.DOMBreakpointsSidebarPane.prototype._createBreakpointId):
     41        (WebInspector.DOMBreakpointsSidebarPane.prototype._saveBreakpoints):
     42        (WebInspector.DOMBreakpointsSidebarPane.prototype.restoreBreakpoints):
     43        * inspector/front-end/ElementsPanel.js:
     44        (WebInspector.ElementsPanel):
     45        (WebInspector.ElementsPanel.prototype.show):
     46        (WebInspector.ElementsPanel.prototype.updateModifiedNodes):
     47        (WebInspector.ElementsPanel.prototype.updateBreadcrumbSizes.coalesceCollapsedCrumbs):
     48        * inspector/front-end/ElementsTreeOutline.js:
     49        (WebInspector.ElementsTreeElement.prototype._populateTagContextMenu):
     50        * inspector/front-end/ScriptsPanel.js:
     51        (WebInspector.ScriptsPanel):
     52        (WebInspector.ScriptsPanel.prototype.show):
     53        (WebInspector.ScriptsPanel.prototype._debuggerPaused.didCreateBreakpointHitStatusMessage):
     54        (WebInspector.ScriptsPanel.prototype._debuggerPaused.else.didGetSourceLocation):
     55        (WebInspector.ScriptsPanel.prototype._debuggerPaused):
     56        (WebInspector.ScriptsPanel.prototype._clearInterface):
     57        * inspector/front-end/Settings.js:
     58        (WebInspector.Settings):
     59        (WebInspector.Settings.prototype._set):
     60        * inspector/front-end/WebKit.qrc:
     61        * inspector/front-end/inspector.html:
     62        * inspector/front-end/inspector.js:
     63        (WebInspector.inspectedURLChanged):
     64        * inspector/front-end/utilities.js:
     65        ():
     66
    1672011-04-14  Satish Sampath  <satish@chromium.org>
    268
  • trunk/Source/WebCore/WebCore.gypi

    r83832 r83864  
    61536153            'inspector/front-end/AuditsPanel.js',
    61546154            'inspector/front-end/BottomUpProfileDataGridTree.js',
    6155             'inspector/front-end/BreakpointManager.js',
    61566155            'inspector/front-end/BreakpointsSidebarPane.js',
    61576156            'inspector/front-end/CallStackSidebarPane.js',
     
    61766175            'inspector/front-end/DetailedHeapshotView.js',
    61776176            'inspector/front-end/DOMAgent.js',
     6177            'inspector/front-end/DOMBreakpointsSidebarPane.js',
    61786178            'inspector/front-end/DOMStorage.js',
    61796179            'inspector/front-end/DOMStorageItemsView.js',
  • trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj

    r83832 r83864  
    6694666946                                </File>
    6694766947                                <File
    66948                                         RelativePath="..\inspector\front-end\BreakpointManager.js"
    66949                                         >
    66950                                 </File>
    66951                                 <File
    6695266948                                        RelativePath="..\inspector\front-end\BreakpointsSidebarPane.js"
    6695366949                                        >
     
    6703967035                                <File
    6704067036                                        RelativePath="..\inspector\front-end\DOMAgent.js"
     67037                                        >
     67038                                </File>
     67039                                <File
     67040                                        RelativePath="..\inspector\front-end\DOMBreakpointsSidebarPane.js"
    6704167041                                        >
    6704267042                                </File>
  • trunk/Source/WebCore/inspector/front-end/BreakpointsSidebarPane.js

    r82685 r83864  
    205205
    206206    this.bodyElement.appendChild(this.emptyElement);
    207 
    208     WebInspector.breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.ProjectChanged, this._projectChanged, this);
    209207}
    210208
    211209WebInspector.NativeBreakpointsSidebarPane.prototype = {
    212     addBreakpointItem: function(breakpointItem)
    213     {
    214         var element = breakpointItem.element;
    215         element._breakpointItem = breakpointItem;
    216 
    217         breakpointItem.addEventListener("breakpoint-hit", this.expand, this);
    218         breakpointItem.addEventListener("removed", this._removeListElement.bind(this, element), this);
    219 
    220         var currentElement = this.listElement.firstChild;
    221         while (currentElement) {
    222             if (currentElement._breakpointItem && currentElement._breakpointItem.compareTo(element._breakpointItem) > 0)
    223                 break;
    224             currentElement = currentElement.nextSibling;
    225         }
    226         this._addListElement(element, currentElement);
    227 
    228         if (breakpointItem.click) {
    229             element.addStyleClass("cursor-pointer");
    230             element.addEventListener("click", breakpointItem.click.bind(breakpointItem), false);
    231         }
    232         element.addEventListener("contextmenu", this._contextMenuEventFired.bind(this, breakpointItem), true);
    233     },
    234 
    235     _contextMenuEventFired: function(breakpointItem, event)
    236     {
    237         var contextMenu = new WebInspector.ContextMenu();
    238         contextMenu.appendItem(WebInspector.UIString("Remove Breakpoint"), breakpointItem.remove.bind(breakpointItem));
    239         contextMenu.show(event);
    240     },
    241 
    242210    _addListElement: function(element, beforeElement)
    243211    {
     
    262230    },
    263231
    264     _projectChanged: function()
     232    _reset: function()
    265233    {
    266234        this.listElement.removeChildren();
     
    445413                this._setBreakpoint(breakpoint.url, breakpoint.enabled);
    446414        }
    447     },
    448 
    449     _projectChanged: function()
    450     {
    451415    }
    452416}
    453417
    454418WebInspector.XHRBreakpointsSidebarPane.prototype.__proto__ = WebInspector.NativeBreakpointsSidebarPane.prototype;
    455 
    456 WebInspector.BreakpointItem = function(breakpoint)
    457 {
    458     this._breakpoint = breakpoint;
    459 
    460     this._element = document.createElement("li");
    461 
    462     var checkboxElement = document.createElement("input");
    463     checkboxElement.className = "checkbox-elem";
    464     checkboxElement.type = "checkbox";
    465     checkboxElement.checked = this._breakpoint.enabled;
    466     checkboxElement.addEventListener("click", this._checkboxClicked.bind(this), false);
    467     this._element.appendChild(checkboxElement);
    468 
    469     this._createLabelElement();
    470 
    471     this._breakpoint.addEventListener("enable-changed", this._enableChanged, this);
    472     this._breakpoint.addEventListener("hit-state-changed", this._hitStateChanged, this);
    473     this._breakpoint.addEventListener("label-changed", this._labelChanged, this);
    474     this._breakpoint.addEventListener("removed", this.dispatchEventToListeners.bind(this, "removed"));
    475     if (breakpoint.click)
    476         this.click = breakpoint.click.bind(breakpoint);
    477 }
    478 
    479 WebInspector.BreakpointItem.prototype = {
    480     get element()
    481     {
    482         return this._element;
    483     },
    484 
    485     compareTo: function(other)
    486     {
    487         return this._breakpoint.compareTo(other._breakpoint);
    488     },
    489 
    490     populateEditElement: function(element)
    491     {
    492         this._breakpoint.populateEditElement(element);
    493     },
    494 
    495     remove: function()
    496     {
    497         this._breakpoint.remove();
    498     },
    499 
    500     _checkboxClicked: function(event)
    501     {
    502         this._breakpoint.enabled = !this._breakpoint.enabled;
    503 
    504         // Breakpoint element may have it's own click handler.
    505         event.stopPropagation();
    506     },
    507 
    508     _enableChanged: function(event)
    509     {
    510         var checkbox = this._element.firstChild;
    511         checkbox.checked = this._breakpoint.enabled;
    512     },
    513 
    514     _hitStateChanged: function(event)
    515     {
    516         if (event.target.hit) {
    517             this._element.addStyleClass("breakpoint-hit");
    518             this.dispatchEventToListeners("breakpoint-hit");
    519         } else
    520             this._element.removeStyleClass("breakpoint-hit");
    521     },
    522 
    523     _labelChanged: function(event)
    524     {
    525         this._element.removeChild(this._labelElement);
    526         this._createLabelElement();
    527     },
    528 
    529     _createLabelElement: function()
    530     {
    531         this._labelElement = document.createElement("span");
    532         this._breakpoint.populateLabelElement(this._labelElement);
    533         this._element.appendChild(this._labelElement);
    534     }
    535 }
    536 
    537 WebInspector.BreakpointItem.prototype.__proto__ = WebInspector.Object.prototype;
    538419
    539420WebInspector.EventListenerBreakpointsSidebarPane = function()
  • trunk/Source/WebCore/inspector/front-end/CallStackSidebarPane.js

    r83290 r83864  
    7373            this.placards.push(placard);
    7474            this.bodyElement.appendChild(placard.element);
    75         }
    76 
    77         if (details.eventType === WebInspector.DebuggerEventTypes.NativeBreakpoint) {
    78             if (details.eventData.breakpointType === WebInspector.BreakpointManager.BreakpointTypes.DOM)
    79                 this._domBreakpointHit(details.eventData);
    8075        }
    8176    },
     
    177172        var statusMessageElement = document.createElement("div");
    178173        statusMessageElement.className = "info";
    179         statusMessageElement.textContent = status;
    180         this.bodyElement.appendChild(statusMessageElement);
    181     },
    182 
    183     _domBreakpointHit: function(eventData)
    184     {
    185         var breakpoint = WebInspector.breakpointManager.breakpointViewForEventData(eventData);
    186         if (!breakpoint)
    187             return;
    188 
    189         var statusMessageElement = document.createElement("div");
    190         statusMessageElement.className = "info";
    191         breakpoint.populateStatusMessageElement(statusMessageElement, eventData);
     174        if (typeof status === "string")
     175            statusMessageElement.textContent = status;
     176        else
     177            statusMessageElement.appendChild(status);
    192178        this.bodyElement.appendChild(statusMessageElement);
    193179    }
  • trunk/Source/WebCore/inspector/front-end/DOMAgent.js

    r83707 r83864  
    6060    this._matchedCSSRules = [];
    6161
    62     this.breakpoints = {};
    63 
    6462    if (this._nodeType === Node.ELEMENT_NODE) {
    6563        // HTML and BODY from internal iframes should not overwrite top-level ones.
     
    505503        this.dispatchEventToListeners(WebInspector.DOMAgent.Events.NodeRemoved, {node:node, parent:parent});
    506504        delete this._idToDOMNode[nodeId];
    507         this._removeBreakpoints(node);
    508     },
    509 
    510     _removeBreakpoints: function(node)
    511     {
    512         for (var type in node.breakpoints)
    513             node.breakpoints[type].remove();
    514         if (!node.children)
    515             return;
    516         for (var i = 0; i < node.children.length; ++i)
    517             this._removeBreakpoints(node.children[i]);
     505        WebInspector.panels.elements.sidebarPanes.domBreakpoints.nodeRemoved(node);
    518506    },
    519507
  • trunk/Source/WebCore/inspector/front-end/ElementsPanel.js

    r83848 r83864  
    8080    this.sidebarPanes.properties = new WebInspector.PropertiesSidebarPane();
    8181    if (Preferences.nativeInstrumentationEnabled)
    82         this.sidebarPanes.domBreakpoints = WebInspector.createDOMBreakpointsSidebarPane();
     82        this.sidebarPanes.domBreakpoints = WebInspector.domBreakpointsSidebarPane;
    8383    this.sidebarPanes.eventListeners = new WebInspector.EventListenersSidebarPane();
    8484
     
    154154            this.updateModifiedNodes();
    155155
     156        if (Preferences.nativeInstrumentationEnabled)
     157            this.sidebarElement.insertBefore(this.sidebarPanes.domBreakpoints.element, this.sidebarPanes.eventListeners.element);
     158
    156159        if (!this.rootDOMNode)
    157160            WebInspector.domAgent.requestDocument();
     
    200203            return;
    201204
    202         WebInspector.breakpointManager.restoreDOMBreakpoints();
    203 
     205        if (Preferences.nativeInstrumentationEnabled)
     206            this.sidebarPanes.domBreakpoints.restoreBreakpoints();
    204207
    205208        this.rootDOMNode = inspectedRootDocument;
     
    484487                continue;
    485488            }
    486            
     489
    487490            if (!parent)
    488491                continue;
     
    769772        var crumb = crumbs.firstChild;
    770773        while (crumb) {
    771             // Find the selected crumb and index. 
     774            // Find the selected crumb and index.
    772775            if (!selectedCrumb && crumb.hasStyleClass("selected")) {
    773776                selectedCrumb = crumb;
     
    775778            }
    776779
    777             // Find the focused crumb index. 
     780            // Find the focused crumb index.
    778781            if (crumb === focusedCrumb)
    779782                focusedIndex = i;
     
    884887                var hidden = crumb.hasStyleClass("hidden");
    885888                if (!hidden) {
    886                     var collapsed = crumb.hasStyleClass("collapsed"); 
     889                    var collapsed = crumb.hasStyleClass("collapsed");
    887890                    if (collapsedRun && collapsed) {
    888891                        crumb.addStyleClass("hidden");
  • trunk/Source/WebCore/inspector/front-end/ElementsTreeOutline.js

    r81663 r83864  
    792792            // Add debbuging-related actions
    793793            contextMenu.appendSeparator();
    794 
    795             function handlerFunction(nodeId, breakType)
    796             {
    797                 WebInspector.breakpointManager.createDOMBreakpoint(nodeId, breakType);
    798                 WebInspector.panels.elements.sidebarPanes.domBreakpoints.expand();
    799             }
    800             var node = this.representedObject;
    801             for (var key in WebInspector.DOMBreakpointTypes) {
    802                 var type = WebInspector.DOMBreakpointTypes[key];
    803                 var label = WebInspector.domBreakpointTypeContextMenuLabel(type);
    804                 var breakpoint = node.breakpoints[type];
    805                 if (!breakpoint)
    806                     var handler = handlerFunction.bind(this, node.id, type);
    807                 else
    808                     var handler = breakpoint.remove.bind(breakpoint);
    809                 contextMenu.appendCheckboxItem(label, handler, !!breakpoint);
    810             }
     794            var pane = WebInspector.panels.elements.sidebarPanes.domBreakpoints;
     795            pane.populateNodeContextMenu(this.representedObject, contextMenu);
    811796        }
    812797    },
  • trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js

    r83713 r83864  
    136136    this.sidebarPanes.jsBreakpoints = new WebInspector.JavaScriptBreakpointsSidebarPane(this._presentationModel, this._showSourceLine.bind(this));
    137137    if (Preferences.nativeInstrumentationEnabled) {
    138         this.sidebarPanes.domBreakpoints = WebInspector.createDOMBreakpointsSidebarPane();
     138        this.sidebarPanes.domBreakpoints = WebInspector.domBreakpointsSidebarPane;
    139139        this.sidebarPanes.xhrBreakpoints = new WebInspector.XHRBreakpointsSidebarPane();
    140140        this.sidebarPanes.eventListenerBreakpoints = new WebInspector.EventListenerBreakpointsSidebarPane();
     
    201201};
    202202
     203WebInspector.ScriptsPanel.BrowserBreakpointTypes = {
     204    DOM: "DOM",
     205    EventListener: "EventListener",
     206    XHR: "XHR"
     207}
     208
    203209WebInspector.ScriptsPanel.prototype = {
    204210    get toolbarItemLabel()
     
    226232        WebInspector.Panel.prototype.show.call(this);
    227233        this.sidebarResizeElement.style.right = (this.sidebarElement.offsetWidth - 3) + "px";
     234        if (Preferences.nativeInstrumentationEnabled)
     235            this.sidebarElement.insertBefore(this.sidebarPanes.domBreakpoints.element, this.sidebarPanes.xhrBreakpoints.element);
    228236
    229237        if (this.visibleView)
     
    367375        this.sidebarPanes.callstack.selectedCallFrame = this._presentationModel.selectedCallFrame;
    368376
    369         var status;
    370377        if (details.eventType === WebInspector.DebuggerEventTypes.NativeBreakpoint) {
    371             if (details.eventData.breakpointType === WebInspector.BreakpointManager.BreakpointTypes.EventListener) {
     378            if (details.eventData.breakpointType === WebInspector.ScriptsPanel.BrowserBreakpointTypes.DOM) {
     379                this.sidebarPanes.domBreakpoints.highlightBreakpoint(details.eventData);
     380                function didCreateBreakpointHitStatusMessage(element)
     381                {
     382                    this.sidebarPanes.callstack.setStatus(element);
     383                }
     384                this.sidebarPanes.domBreakpoints.createBreakpointHitStatusMessage(details.eventData, didCreateBreakpointHitStatusMessage.bind(this));
     385            } else if (details.eventData.breakpointType === WebInspector.ScriptsPanel.BrowserBreakpointTypes.EventListener) {
    372386                var eventName = details.eventData.eventName;
    373387                this.sidebarPanes.eventListenerBreakpoints.highlightBreakpoint(details.eventData.eventName);
    374388                var eventNameForUI = WebInspector.EventListenerBreakpointsSidebarPane.eventNameForUI(eventName);
    375                 status = WebInspector.UIString("Paused on a \"%s\" Event Listener.", eventNameForUI);
    376             } else if (details.eventData.breakpointType === WebInspector.BreakpointManager.BreakpointTypes.XHR) {
     389                this.sidebarPanes.callstack.setStatus(WebInspector.UIString("Paused on a \"%s\" Event Listener.", eventNameForUI));
     390            } else if (details.eventData.breakpointType === WebInspector.ScriptsPanel.BrowserBreakpointTypes.XHR) {
    377391                this.sidebarPanes.xhrBreakpoints.highlightBreakpoint(details.eventData.breakpointURL);
    378                 status = WebInspector.UIString("Paused on a XMLHttpRequest.");
     392                this.sidebarPanes.callstack.setStatus(WebInspector.UIString("Paused on a XMLHttpRequest."));
    379393            }
    380394        } else {
     
    384398                    return;
    385399                this.sidebarPanes.jsBreakpoints.highlightBreakpoint(sourceFileId, lineNumber);
    386                 status = WebInspector.UIString("Paused on a JavaScript breakpoint.");
     400                this.sidebarPanes.callstack.setStatus(WebInspector.UIString("Paused on a JavaScript breakpoint."));
    387401            }
    388402            callFrames[0].sourceLine(didGetSourceLocation.bind(this));
    389403        }
    390         if (status)
    391             this.sidebarPanes.callstack.setStatus(status);
    392404
    393405        window.focus();
     
    743755        this.sidebarPanes.jsBreakpoints.clearBreakpointHighlight();
    744756        if (Preferences.nativeInstrumentationEnabled) {
     757            this.sidebarPanes.domBreakpoints.clearBreakpointHighlight();
    745758            this.sidebarPanes.eventListenerBreakpoints.clearBreakpointHighlight();
    746759            this.sidebarPanes.xhrBreakpoints.clearBreakpointHighlight();
  • trunk/Source/WebCore/inspector/front-end/Settings.js

    r82191 r83864  
    7373    this.installApplicationSetting("breakpoints", []);
    7474    this.installApplicationSetting("eventListenerBreakpoints", []);
     75    this.installApplicationSetting("domBreakpoints", []);
    7576    this.installApplicationSetting("xhrBreakpoints", []);
    76 
    77     this.installProjectSetting("nativeBreakpoints", []);
    78 }
    79 
    80 WebInspector.Settings.Events = {
    81     ProjectChanged: "project-changed"
    8277}
    8378
     
    9085        this.__defineGetter__(key, this._get.bind(this, key, defaultValue));
    9186        this.__defineSetter__(key, this._set.bind(this, key));
    92     },
    93 
    94     installProjectSetting: function(key, defaultValue)
    95     {
    96         this.__defineGetter__(key, this._getProjectSetting.bind(this, key, defaultValue));
    97         this.__defineSetter__(key, this._setProjectSetting.bind(this, key));
    98     },
    99 
    100     inspectedURLChanged: function(url)
    101     {
    102         var fragmentIndex = url.indexOf("#");
    103         if (fragmentIndex !== -1)
    104             url = url.substring(0, fragmentIndex);
    105         this._projectId = url;
    106         this.dispatchEventToListeners(WebInspector.Settings.Events.ProjectChanged);
    107     },
    108 
    109     get projectId()
    110     {
    111         return this._projectId;
    112     },
    113 
    114     findSettingForAllProjects: function(key)
    115     {
    116         var result = {};
    117         if (window.localStorage == null)
    118             return result;
    119 
    120         var regexp = "^" + key + ":(.*)";
    121         for (var i = 0; i < window.localStorage.length; ++i) {
    122             var fullKey =  window.localStorage.key(i);
    123             var match = fullKey.match(regexp);
    124             if (!match)
    125                 continue;
    126             try {
    127                 result[match[1]] = JSON.parse(window.localStorage[fullKey]);
    128             } catch(e) {
    129                 window.localStorage.removeItem(fullKey);
    130             }
    131         }
    132         return result;
    13387    },
    13488
     
    149103        if (window.localStorage != null)
    150104            window.localStorage[key] = JSON.stringify(value);
    151     },
    152 
    153     _getProjectSetting: function(key, defaultValue)
    154     {
    155         return this._get(this._formatProjectKey(key), defaultValue);
    156     },
    157 
    158     _setProjectSetting: function(key, value)
    159     {
    160         return this._set(this._formatProjectKey(key), value);
    161     },
    162 
    163     _formatProjectKey: function(key)
    164     {
    165         return key + ":" + this._projectId;
    166105    }
    167106}
  • trunk/Source/WebCore/inspector/front-end/WebKit.qrc

    r83718 r83864  
    1010    <file>AuditsPanel.js</file>
    1111    <file>BottomUpProfileDataGridTree.js</file>
    12     <file>BreakpointManager.js</file>
    1312    <file>BreakpointsSidebarPane.js</file>
    1413    <file>CallStackSidebarPane.js</file>
     
    3433    <file>SourceFile.js</file>
    3534    <file>DOMAgent.js</file>
     35    <file>DOMBreakpointsSidebarPane.js</file>
    3636    <file>DOMStorage.js</file>
    3737    <file>DOMStorageItemsView.js</file>
  • trunk/Source/WebCore/inspector/front-end/inspector.html

    r83718 r83864  
    7474    <script type="text/javascript" src="ApplicationCacheItemsView.js"></script>
    7575    <script type="text/javascript" src="Script.js"></script>
    76     <script type="text/javascript" src="BreakpointManager.js"></script>
    7776    <script type="text/javascript" src="SidebarPane.js"></script>
    7877    <script type="text/javascript" src="ElementsTreeOutline.js"></script>
     
    8382    <script type="text/javascript" src="ObjectPropertiesSection.js"></script>
    8483    <script type="text/javascript" src="BreakpointsSidebarPane.js"></script>
     84    <script type="text/javascript" src="DOMBreakpointsSidebarPane.js"></script>
    8585    <script type="text/javascript" src="CallStackSidebarPane.js"></script>
    8686    <script type="text/javascript" src="ScopeChainSidebarPane.js"></script>
  • trunk/Source/WebCore/inspector/front-end/inspector.js

    r83861 r83864  
    172172    },
    173173
    174     createDOMBreakpointsSidebarPane: function()
    175     {
    176         var pane = new WebInspector.NativeBreakpointsSidebarPane(WebInspector.UIString("DOM Breakpoints"));
    177         function breakpointAdded(event)
    178         {
    179             pane.addBreakpointItem(new WebInspector.BreakpointItem(event.data));
    180         }
    181         WebInspector.breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.DOMBreakpointAdded, breakpointAdded);
    182         return pane;
    183     },
    184 
    185174    _createPanels: function()
    186175    {
     
    461450    this.debuggerModel = new WebInspector.DebuggerModel();
    462451
    463     this.breakpointManager = new WebInspector.BreakpointManager();
    464452    this.searchController = new WebInspector.SearchController();
     453    this.domBreakpointsSidebarPane = new WebInspector.DOMBreakpointsSidebarPane();
    465454
    466455    this.panels = {};
     
    10361025{
    10371026    InspectorFrontendHost.inspectedURLChanged(url);
    1038     this.settings.inspectedURLChanged(url);
     1027    this.domBreakpointsSidebarPane.setInspectedURL(url);
    10391028    this.extensionServer.notifyInspectedURLChanged(url);
    10401029}
  • trunk/Source/WebCore/inspector/front-end/utilities.js

    r82818 r83864  
    450450        result = result.replace(new RegExp("^" + baseURLDomain.escapeForRegExp(), "i"), "");
    451451    return result;
     452}
     453
     454String.prototype.removeURLFragment = function()
     455{
     456    var fragmentIndex = this.indexOf("#");
     457    if (fragmentIndex == -1)
     458        fragmentIndex = this.length;
     459    return this.substring(0, fragmentIndex);
    452460}
    453461
Note: See TracChangeset for help on using the changeset viewer.