Title: [193791] trunk/Source/WebInspectorUI
- Revision
- 193791
- Author
- [email protected]
- Date
- 2015-12-08 16:04:46 -0800 (Tue, 08 Dec 2015)
Log Message
Web Inspector: Add a hidden property to TreeOutline
https://bugs.webkit.org/show_bug.cgi?id=152014
Reviewed by Timothy Hatcher.
* UserInterface/Views/NavigationSidebarPanel.js:
Removed static property for "hidden" CSS class. No longer used.
(WebInspector.NavigationSidebarPanel.prototype.set contentTreeOutline):
Fixed bug in order of visibleTreeOutlines add/remove.
(WebInspector.NavigationSidebarPanel.prototype.createContentTreeOutline):
* UserInterface/Views/TimelineSidebarPanel.js:
(WebInspector.TimelineSidebarPanel):
(WebInspector.TimelineSidebarPanel.prototype._changeViewMode):
* UserInterface/Views/TreeOutline.js:
(WebInspector.TreeOutline):
(WebInspector.TreeOutline.prototype.get hidden):
(WebInspector.TreeOutline.prototype.set hidden):
Added hidden property, set DOM element hidden attribute.
(WebInspector.TreeElement.prototype.set hidden):
Remove CSS class, set DOM element hidden attribute.
(WebInspector.TreeElement.prototype._attach):
(WebInspector.TreeElement.prototype.expand):
Modified Paths
Diff
Modified: trunk/Source/WebInspectorUI/ChangeLog (193790 => 193791)
--- trunk/Source/WebInspectorUI/ChangeLog 2015-12-08 23:57:13 UTC (rev 193790)
+++ trunk/Source/WebInspectorUI/ChangeLog 2015-12-09 00:04:46 UTC (rev 193791)
@@ -1,5 +1,32 @@
2015-12-08 Matt Baker <[email protected]>
+ Web Inspector: Add a hidden property to TreeOutline
+ https://bugs.webkit.org/show_bug.cgi?id=152014
+
+ Reviewed by Timothy Hatcher.
+
+ * UserInterface/Views/NavigationSidebarPanel.js:
+ Removed static property for "hidden" CSS class. No longer used.
+ (WebInspector.NavigationSidebarPanel.prototype.set contentTreeOutline):
+ Fixed bug in order of visibleTreeOutlines add/remove.
+ (WebInspector.NavigationSidebarPanel.prototype.createContentTreeOutline):
+
+ * UserInterface/Views/TimelineSidebarPanel.js:
+ (WebInspector.TimelineSidebarPanel):
+ (WebInspector.TimelineSidebarPanel.prototype._changeViewMode):
+
+ * UserInterface/Views/TreeOutline.js:
+ (WebInspector.TreeOutline):
+ (WebInspector.TreeOutline.prototype.get hidden):
+ (WebInspector.TreeOutline.prototype.set hidden):
+ Added hidden property, set DOM element hidden attribute.
+ (WebInspector.TreeElement.prototype.set hidden):
+ Remove CSS class, set DOM element hidden attribute.
+ (WebInspector.TreeElement.prototype._attach):
+ (WebInspector.TreeElement.prototype.expand):
+
+2015-12-08 Matt Baker <[email protected]>
+
Web Inspector: Global Breakpoints should always be visible
https://bugs.webkit.org/show_bug.cgi?id=151066
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js (193790 => 193791)
--- trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js 2015-12-08 23:57:13 UTC (rev 193790)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js 2015-12-09 00:04:46 UTC (rev 193791)
@@ -113,13 +113,14 @@
if (!newTreeOutline)
return;
- if (this._contentTreeOutline)
- this._contentTreeOutline.element.classList.add(WebInspector.NavigationSidebarPanel.ContentTreeOutlineElementHiddenStyleClassName);
+ if (this._contentTreeOutline) {
+ this._contentTreeOutline.hidden = true;
+ this._visibleContentTreeOutlines.delete(this._contentTreeOutline);
+ }
this._contentTreeOutline = newTreeOutline;
- this._contentTreeOutline.element.classList.remove(WebInspector.NavigationSidebarPanel.ContentTreeOutlineElementHiddenStyleClassName);
+ this._contentTreeOutline.hidden = false;
- this._visibleContentTreeOutlines.delete(this._contentTreeOutline);
this._visibleContentTreeOutlines.add(newTreeOutline);
this._updateFilter();
@@ -156,15 +157,13 @@
createContentTreeOutline(dontHideByDefault, suppressFiltering)
{
- var contentTreeOutlineElement = document.createElement("ol");
- contentTreeOutlineElement.className = WebInspector.NavigationSidebarPanel.ContentTreeOutlineElementStyleClassName;
- if (!dontHideByDefault)
- contentTreeOutlineElement.classList.add(WebInspector.NavigationSidebarPanel.ContentTreeOutlineElementHiddenStyleClassName);
- this.contentElement.appendChild(contentTreeOutlineElement);
-
- var contentTreeOutline = new WebInspector.TreeOutline(contentTreeOutlineElement);
+ let contentTreeOutline = new WebInspector.TreeOutline(document.createElement("ol"));
contentTreeOutline.allowsRepeatSelection = true;
+ contentTreeOutline.hidden = !dontHideByDefault;
+ contentTreeOutline.element.classList.add(WebInspector.NavigationSidebarPanel.ContentTreeOutlineElementStyleClassName);
+ this.contentElement.appendChild(contentTreeOutline.element);
+
if (!suppressFiltering) {
contentTreeOutline.addEventListener(WebInspector.TreeOutline.Event.ElementAdded, this._treeElementAddedOrChanged, this);
contentTreeOutline.addEventListener(WebInspector.TreeOutline.Event.ElementDidChange, this._treeElementAddedOrChanged, this);
@@ -734,7 +733,6 @@
WebInspector.NavigationSidebarPanel.OverflowShadowElementStyleClassName = "overflow-shadow";
WebInspector.NavigationSidebarPanel.TopOverflowShadowElementStyleClassName = "top";
-WebInspector.NavigationSidebarPanel.ContentTreeOutlineElementHiddenStyleClassName = "hidden";
WebInspector.NavigationSidebarPanel.ContentTreeOutlineElementStyleClassName = "navigation-sidebar-panel-content-tree-outline";
WebInspector.NavigationSidebarPanel.HideDisclosureButtonsStyleClassName = "hide-disclosure-buttons";
WebInspector.NavigationSidebarPanel.EmptyContentPlaceholderElementStyleClassName = "empty-content-placeholder";
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.js (193790 => 193791)
--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.js 2015-12-08 23:57:13 UTC (rev 193790)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.js 2015-12-09 00:04:46 UTC (rev 193791)
@@ -61,7 +61,7 @@
this._recordingTreeElementMap = new Map;
this._recordingsTreeOutline = this.createContentTreeOutline(true, true);
this._recordingsTreeOutline.element.classList.add(WebInspector.NavigationSidebarPanel.HideDisclosureButtonsStyleClassName);
- this._recordingsTreeOutline.element.classList.add(WebInspector.NavigationSidebarPanel.ContentTreeOutlineElementHiddenStyleClassName);
+ this._recordingsTreeOutline.hidden = true;
this._recordingsTreeOutline.addEventListener(WebInspector.TreeOutline.Event.SelectionDidChange, this._recordingsTreeSelectionDidChange, this);
this._timelinesContentContainerElement.appendChild(this._recordingsTreeOutline.element);
@@ -930,10 +930,10 @@
this._viewModeNavigationBar.selectedNavigationItem = this._viewMode;
if (this._viewMode === WebInspector.TimelineSidebarPanel.ViewMode.Timelines) {
- this._timelinesTreeOutline.element.classList.remove(WebInspector.NavigationSidebarPanel.ContentTreeOutlineElementHiddenStyleClassName);
+ this._timelinesTreeOutline.hidden = false;
this._frameSelectionChartSection.collapsed = true;
} else {
- this._timelinesTreeOutline.element.classList.add(WebInspector.NavigationSidebarPanel.ContentTreeOutlineElementHiddenStyleClassName);
+ this._timelinesTreeOutline.hidden = true;
this._frameSelectionChartSection.collapsed = false;
}
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js (193790 => 193791)
--- trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js 2015-12-08 23:57:13 UTC (rev 193790)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js 2015-12-09 00:04:46 UTC (rev 193791)
@@ -46,13 +46,28 @@
this.expanded = true;
this.selected = false;
this.treeOutline = this;
+ this._hidden = false;
this._childrenListNode.tabIndex = 0;
this._childrenListNode.addEventListener("keydown", this._treeKeyDown.bind(this), true);
}
- // Methods
+ // Public
+ get hidden()
+ {
+ return this._hidden;
+ }
+
+ set hidden(x)
+ {
+ if (this._hidden === x)
+ return;
+
+ this._hidden = x;
+ this.element.hidden = this._hidden;
+ }
+
appendChild(child)
{
console.assert(child);
@@ -659,17 +674,10 @@
this._hidden = x;
- if (x) {
- if (this._listItemNode)
- this._listItemNode.classList.add("hidden");
- if (this._childrenListNode)
- this._childrenListNode.classList.add("hidden");
- } else {
- if (this._listItemNode)
- this._listItemNode.classList.remove("hidden");
- if (this._childrenListNode)
- this._childrenListNode.classList.remove("hidden");
- }
+ if (this._listItemNode)
+ this._listItemNode.hidden = this._hidden;
+ if (this._childrenListNode)
+ this._childrenListNode.hidden = this._hidden;
if (this.treeOutline)
this.treeOutline.dispatchEventToListeners(WebInspector.TreeOutline.Event.ElementVisibilityDidChange, {element: this});
@@ -734,9 +742,8 @@
this._listItemNode.treeElement = this;
this._setListItemNodeContent();
this._listItemNode.title = this._tooltip ? this._tooltip : "";
+ this._listItemNode.hidden = this.hidden;
- if (this.hidden)
- this._listItemNode.classList.add("hidden");
if (this.hasChildren)
this._listItemNode.classList.add("parent");
if (this.expanded)
@@ -880,10 +887,8 @@
this._childrenListNode = this.treeOutline._childrenListNode.ownerDocument.createElement("ol");
this._childrenListNode.parentTreeElement = this;
this._childrenListNode.classList.add("children");
+ this._childrenListNode.hidden = this.hidden;
- if (this.hidden)
- this._childrenListNode.classList.add("hidden");
-
this.onpopulate();
for (var i = 0; i < this.children.length; ++i)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes