⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 181452 in webkit


Ignore:
Timestamp:
Mar 12, 2015, 1:32:29 PM (11 years ago)
Author:
jonowells@apple.com
Message:

Web Inspector: Debugger sidebar should group global breakpoints together
https://bugs.webkit.org/show_bug.cgi?id=142607

Reviewed by Timothy Hatcher.

Update the DebuggerSidebarPanel class to hold global breakpoints such as "All Exceptions" in one container. This
will be the place future such breakpoints are added.

  • Localizations/en.lproj/localizedStrings.js: Added string.
  • UserInterface/Main.html: Small rearrangement.
  • UserInterface/Views/DebuggerSidebarPanel.js: Change how exception breaking options are displayed.

(WebInspector.DebuggerSidebarPanel):
(WebInspector.DebuggerSidebarPanel.prototype._treeElementSelected):
(WebInspector.DebuggerSidebarPanel.prototype._compareTopLevelTreeElements):

  • UserInterface/Views/FolderTreeElement.js: Support additional classes for icons.
  • UserInterface/Views/ResourceSidebarPanel.js: Change call to FolderTreeElement constructor.
Location:
trunk/Source/WebInspectorUI
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r181437 r181452  
     12015-03-12  Jono Wells  <jonowells@apple.com>
     2
     3        Web Inspector: Debugger sidebar should group global breakpoints together
     4        https://bugs.webkit.org/show_bug.cgi?id=142607
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        Update the DebuggerSidebarPanel class to hold global breakpoints such as "All Exceptions" in one container. This
     9        will be the place future such breakpoints are added.
     10
     11        * Localizations/en.lproj/localizedStrings.js: Added string.
     12        * UserInterface/Main.html: Small rearrangement.
     13
     14        * UserInterface/Views/DebuggerSidebarPanel.js: Change how exception breaking options are displayed.
     15        (WebInspector.DebuggerSidebarPanel):
     16        (WebInspector.DebuggerSidebarPanel.prototype._treeElementSelected):
     17        (WebInspector.DebuggerSidebarPanel.prototype._compareTopLevelTreeElements):
     18
     19        * UserInterface/Views/FolderTreeElement.js: Support additional classes for icons.
     20        * UserInterface/Views/ResourceSidebarPanel.js: Change call to FolderTreeElement constructor.
     21
    1222015-03-12  Joseph Pecoraro  <pecoraro@apple.com>
    223
  • trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js

    r181306 r181452  
    234234localizedStrings["Function"] = "Function";
    235235localizedStrings["Function Name Variable"] = "Function Name Variable";
     236localizedStrings["Global Breakpoints"] = "Global Breakpoints";
    236237localizedStrings["Global Variables"] = "Global Variables";
    237238localizedStrings["Grammar"] = "Grammar";
  • trunk/Source/WebInspectorUI/UserInterface/Main.html

    r181306 r181452  
    319319    <script src="Views/DOMDetailsSidebarPanel.js"></script>
    320320    <script src="Views/ObjectTreeBaseTreeElement.js"></script>
     321    <script src="Views/FolderTreeElement.js"></script>
    321322    <script src="Views/FolderizedTreeElement.js"></script>
    322323    <script src="Views/SourceCodeTreeElement.js"></script>
     
    392393    <script src="Views/FindBanner.js"></script>
    393394    <script src="Views/FlexibleSpaceNavigationItem.js"></script>
    394     <script src="Views/FolderTreeElement.js"></script>
    395395    <script src="Views/FontResourceContentView.js"></script>
    396396    <script src="Views/FormattedValue.js"></script>
  • trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js

    r181184 r181452  
    105105    this.element.classList.add(WebInspector.DebuggerSidebarPanel.OffsetSectionsStyleClassName);
    106106
     107    this._globalBreakpointsFolderTreeElement = new WebInspector.FolderTreeElement(WebInspector.UIString("Global Breakpoints"), null, WebInspector.DebuggerSidebarPanel.GlobalIconStyleClassName);
    107108    this._allExceptionsBreakpointTreeElement = new WebInspector.BreakpointTreeElement(WebInspector.debuggerManager.allExceptionsBreakpoint, WebInspector.DebuggerSidebarPanel.ExceptionIconStyleClassName, WebInspector.UIString("All Exceptions"));
    108109    this._allUncaughtExceptionsBreakpointTreeElement = new WebInspector.BreakpointTreeElement(WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint, WebInspector.DebuggerSidebarPanel.ExceptionIconStyleClassName, WebInspector.UIString("All Uncaught Exceptions"));
     
    115116    this._breakpointsContentTreeOutline.oncontextmenu = this._breakpointTreeOutlineContextMenuTreeElement.bind(this);
    116117
    117     this._breakpointsContentTreeOutline.appendChild(this._allExceptionsBreakpointTreeElement);
    118     this._breakpointsContentTreeOutline.appendChild(this._allUncaughtExceptionsBreakpointTreeElement);
     118    this._breakpointsContentTreeOutline.appendChild(this._globalBreakpointsFolderTreeElement);
     119    this._globalBreakpointsFolderTreeElement.appendChild(this._allExceptionsBreakpointTreeElement);
     120    this._globalBreakpointsFolderTreeElement.appendChild(this._allUncaughtExceptionsBreakpointTreeElement);
     121    this._globalBreakpointsFolderTreeElement.expand();
    119122
    120123    var breakpointsRow = new WebInspector.DetailsSectionRow;
     
    148151WebInspector.DebuggerSidebarPanel.ExceptionIconStyleClassName = "breakpoint-exception-icon";
    149152WebInspector.DebuggerSidebarPanel.PausedBreakpointIconStyleClassName = "breakpoint-paused-icon";
     153WebInspector.DebuggerSidebarPanel.GlobalIconStyleClassName = "global-breakpoints-icon";
    150154
    151155WebInspector.DebuggerSidebarPanel.SelectedAllExceptionsCookieKey = "debugger-sidebar-panel-all-exceptions-breakpoint";
     
    525529    _breakpointTreeOutlineContextMenuTreeElement: function(event, treeElement)
    526530    {
    527         console.assert(treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement);
     531        console.assert(treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement || treeElement.constructor === WebInspector.FolderTreeElement);
    528532        if (!(treeElement instanceof WebInspector.ResourceTreeElement) && !(treeElement instanceof WebInspector.ScriptTreeElement))
    529533            return;
     
    601605        }
    602606
    603         if (!(treeElement instanceof WebInspector.BreakpointTreeElement))
     607        if (!(treeElement instanceof WebInspector.BreakpointTreeElement) || treeElement.parent.constructor === WebInspector.FolderTreeElement)
    604608            return;
    605609
     
    630634    _compareTopLevelTreeElements: function(a, b)
    631635    {
    632         if (a === this._allExceptionsBreakpointTreeElement)
     636        if (a === this._globalBreakpointsFolderTreeElement)
    633637            return -1;
    634         if (b === this._allExceptionsBreakpointTreeElement)
    635             return 1;
    636 
    637         if (a === this._allUncaughtExceptionsBreakpointTreeElement)
    638             return -1;
    639         if (b === this._allUncaughtExceptionsBreakpointTreeElement)
     638        if (b === this._globalBreakpointsFolderTreeElement)
    640639            return 1;
    641640
  • trunk/Source/WebInspectorUI/UserInterface/Views/FolderTreeElement.js

    r164543 r181452  
    2424 */
    2525
    26 WebInspector.FolderTreeElement = function(title, subtitle, representedObject)
     26WebInspector.FolderTreeElement = function(title, subtitle, additionalClassNames, representedObject)
    2727{
    28     WebInspector.GeneralTreeElement.call(this, WebInspector.FolderTreeElement.FolderIconStyleClassName, title, subtitle, representedObject, true);
     28    var classNames;
     29    if (!additionalClassNames)
     30        classNames = [];
     31    else if (additionalClassNames.constructor === Array)
     32        classNames = additionalClassNames;
     33    else if (typeof additionalClassNames === "string")
     34        classNames = [additionalClassNames];
     35
     36    classNames.unshift(WebInspector.FolderTreeElement.FolderIconStyleClassName);
     37
     38    WebInspector.GeneralTreeElement.call(this, classNames, title, subtitle, representedObject, true);
    2939
    3040    this.small = true;
     
    3444
    3545WebInspector.FolderTreeElement.prototype = {
    36     constructor: WebInspector.FolderTreeElement,
     46    constructor: WebInspector.FolderTreeElement
    3747
    3848    // No Methods or Properties
  • trunk/Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js

    r181388 r181452  
    911911            this._resourcesContentTreeOutline.removeChild(previousOnlyChild);
    912912
    913             var folderElement = new WebInspector.FolderTreeElement(folderName, null, null);
     913            var folderElement = new WebInspector.FolderTreeElement(folderName);
    914914            this._resourcesContentTreeOutline.insertChild(folderElement, insertionIndexForObjectInListSortedByFunction(folderElement, this._resourcesContentTreeOutline.children, this._compareTreeElements));
    915915
Note: See TracChangeset for help on using the changeset viewer.