Diff
Modified: trunk/Source/WebInspectorUI/ChangeLog (181451 => 181452)
--- trunk/Source/WebInspectorUI/ChangeLog 2015-03-12 20:24:16 UTC (rev 181451)
+++ trunk/Source/WebInspectorUI/ChangeLog 2015-03-12 20:32:29 UTC (rev 181452)
@@ -1,3 +1,24 @@
+2015-03-12 Jono Wells <jonowe...@apple.com>
+
+ 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.
+
2015-03-12 Joseph Pecoraro <pecor...@apple.com>
Web Inspector: Console Errors during provisional document loads get lost with "Clear Log on Reload"
Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (181451 => 181452)
--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js 2015-03-12 20:24:16 UTC (rev 181451)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js 2015-03-12 20:32:29 UTC (rev 181452)
@@ -233,6 +233,7 @@
localizedStrings["Full URL"] = "Full URL";
localizedStrings["Function"] = "Function";
localizedStrings["Function Name Variable"] = "Function Name Variable";
+localizedStrings["Global Breakpoints"] = "Global Breakpoints";
localizedStrings["Global Variables"] = "Global Variables";
localizedStrings["Grammar"] = "Grammar";
localizedStrings["HTML Attributes"] = "HTML Attributes";
Modified: trunk/Source/WebInspectorUI/UserInterface/Main.html (181451 => 181452)
--- trunk/Source/WebInspectorUI/UserInterface/Main.html 2015-03-12 20:24:16 UTC (rev 181451)
+++ trunk/Source/WebInspectorUI/UserInterface/Main.html 2015-03-12 20:32:29 UTC (rev 181452)
@@ -318,6 +318,7 @@
<script src=""
<script src=""
+ <script src=""
<script src=""
<script src=""
<script src=""
@@ -391,7 +392,6 @@
<script src=""
<script src=""
<script src=""
- <script src=""
<script src=""
<script src=""
<script src=""
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js (181451 => 181452)
--- trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js 2015-03-12 20:24:16 UTC (rev 181451)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js 2015-03-12 20:32:29 UTC (rev 181452)
@@ -104,6 +104,7 @@
// Add this offset-sections class name so the sticky headers don't overlap the navigation bar.
this.element.classList.add(WebInspector.DebuggerSidebarPanel.OffsetSectionsStyleClassName);
+ this._globalBreakpointsFolderTreeElement = new WebInspector.FolderTreeElement(WebInspector.UIString("Global Breakpoints"), null, WebInspector.DebuggerSidebarPanel.GlobalIconStyleClassName);
this._allExceptionsBreakpointTreeElement = new WebInspector.BreakpointTreeElement(WebInspector.debuggerManager.allExceptionsBreakpoint, WebInspector.DebuggerSidebarPanel.ExceptionIconStyleClassName, WebInspector.UIString("All Exceptions"));
this._allUncaughtExceptionsBreakpointTreeElement = new WebInspector.BreakpointTreeElement(WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint, WebInspector.DebuggerSidebarPanel.ExceptionIconStyleClassName, WebInspector.UIString("All Uncaught Exceptions"));
@@ -114,8 +115,10 @@
this._breakpointsContentTreeOutline._ondelete_ = this._breakpointTreeOutlineDeleteTreeElement.bind(this);
this._breakpointsContentTreeOutline._oncontextmenu_ = this._breakpointTreeOutlineContextMenuTreeElement.bind(this);
- this._breakpointsContentTreeOutline.appendChild(this._allExceptionsBreakpointTreeElement);
- this._breakpointsContentTreeOutline.appendChild(this._allUncaughtExceptionsBreakpointTreeElement);
+ this._breakpointsContentTreeOutline.appendChild(this._globalBreakpointsFolderTreeElement);
+ this._globalBreakpointsFolderTreeElement.appendChild(this._allExceptionsBreakpointTreeElement);
+ this._globalBreakpointsFolderTreeElement.appendChild(this._allUncaughtExceptionsBreakpointTreeElement);
+ this._globalBreakpointsFolderTreeElement.expand();
var breakpointsRow = new WebInspector.DetailsSectionRow;
breakpointsRow.element.appendChild(this._breakpointsContentTreeOutline.element);
@@ -147,6 +150,7 @@
WebInspector.DebuggerSidebarPanel.OffsetSectionsStyleClassName = "offset-sections";
WebInspector.DebuggerSidebarPanel.ExceptionIconStyleClassName = "breakpoint-exception-icon";
WebInspector.DebuggerSidebarPanel.PausedBreakpointIconStyleClassName = "breakpoint-paused-icon";
+WebInspector.DebuggerSidebarPanel.GlobalIconStyleClassName = "global-breakpoints-icon";
WebInspector.DebuggerSidebarPanel.SelectedAllExceptionsCookieKey = "debugger-sidebar-panel-all-exceptions-breakpoint";
WebInspector.DebuggerSidebarPanel.SelectedAllUncaughtExceptionsCookieKey = "debugger-sidebar-panel-all-uncaught-exceptions-breakpoint";
@@ -524,7 +528,7 @@
_breakpointTreeOutlineContextMenuTreeElement: function(event, treeElement)
{
- console.assert(treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement);
+ console.assert(treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement || treeElement.constructor === WebInspector.FolderTreeElement);
if (!(treeElement instanceof WebInspector.ResourceTreeElement) && !(treeElement instanceof WebInspector.ScriptTreeElement))
return;
@@ -600,7 +604,7 @@
return;
}
- if (!(treeElement instanceof WebInspector.BreakpointTreeElement))
+ if (!(treeElement instanceof WebInspector.BreakpointTreeElement) || treeElement.parent.constructor === WebInspector.FolderTreeElement)
return;
// Deselect any other tree elements to prevent two selections in the sidebar.
@@ -629,16 +633,11 @@
_compareTopLevelTreeElements: function(a, b)
{
- if (a === this._allExceptionsBreakpointTreeElement)
+ if (a === this._globalBreakpointsFolderTreeElement)
return -1;
- if (b === this._allExceptionsBreakpointTreeElement)
+ if (b === this._globalBreakpointsFolderTreeElement)
return 1;
- if (a === this._allUncaughtExceptionsBreakpointTreeElement)
- return -1;
- if (b === this._allUncaughtExceptionsBreakpointTreeElement)
- return 1;
-
return a.mainTitle.localeCompare(b.mainTitle);
},
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/FolderTreeElement.js (181451 => 181452)
--- trunk/Source/WebInspectorUI/UserInterface/Views/FolderTreeElement.js 2015-03-12 20:24:16 UTC (rev 181451)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/FolderTreeElement.js 2015-03-12 20:32:29 UTC (rev 181452)
@@ -23,17 +23,27 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-WebInspector.FolderTreeElement = function(title, subtitle, representedObject)
+WebInspector.FolderTreeElement = function(title, subtitle, additionalClassNames, representedObject)
{
- WebInspector.GeneralTreeElement.call(this, WebInspector.FolderTreeElement.FolderIconStyleClassName, title, subtitle, representedObject, true);
+ var classNames;
+ if (!additionalClassNames)
+ classNames = [];
+ else if (additionalClassNames.constructor === Array)
+ classNames = additionalClassNames;
+ else if (typeof additionalClassNames === "string")
+ classNames = [additionalClassNames];
+ classNames.unshift(WebInspector.FolderTreeElement.FolderIconStyleClassName);
+
+ WebInspector.GeneralTreeElement.call(this, classNames, title, subtitle, representedObject, true);
+
this.small = true;
};
WebInspector.FolderTreeElement.FolderIconStyleClassName = "folder-icon";
WebInspector.FolderTreeElement.prototype = {
- constructor: WebInspector.FolderTreeElement,
+ constructor: WebInspector.FolderTreeElement
// No Methods or Properties
};
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js (181451 => 181452)
--- trunk/Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js 2015-03-12 20:24:16 UTC (rev 181451)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js 2015-03-12 20:32:29 UTC (rev 181452)
@@ -910,7 +910,7 @@
previousOnlyChild.flattened = false;
this._resourcesContentTreeOutline.removeChild(previousOnlyChild);
- var folderElement = new WebInspector.FolderTreeElement(folderName, null, null);
+ var folderElement = new WebInspector.FolderTreeElement(folderName);
this._resourcesContentTreeOutline.insertChild(folderElement, insertionIndexForObjectInListSortedByFunction(folderElement, this._resourcesContentTreeOutline.children, this._compareTreeElements));
folderElement.appendChild(previousOnlyChild);