Title: [244264] trunk/Source/WebInspectorUI
- Revision
- 244264
- Author
- [email protected]
- Date
- 2019-04-15 10:22:11 -0700 (Mon, 15 Apr 2019)
Log Message
Web Inspector: REGRESSION (r244157): Timelines: ruler size appears wrong on first layout
https://bugs.webkit.org/show_bug.cgi?id=196901
<rdar://problem/49880539>
Reviewed by Timothy Hatcher.
* UserInterface/Views/View.js:
(WI.View.prototype._layoutSubtree):
Ensure that the forced override of the layout reason during the initial layout doesn't
affect subviews.
* UserInterface/Views/ConsoleDrawer.js:
(WI.ConsoleDrawer.prototype.sizeDidChange): Added.
(WI.ConsoleDrawer.prototype.layout): Deleted.
* UserInterface/Views/ConsolePrompt.js:
(WI.ConsolePrompt.prototype.sizeDidChange): Added.
(WI.ConsolePrompt.prototype.layout): Deleted.
* UserInterface/Views/DOMTreeContentView.js:
(WI.DOMTreeContentView.prototype.sizeDidChange): Added.
(WI.DOMTreeContentView.prototype.layout):
* UserInterface/Views/NavigationBar.js:
(WI.NavigationBar.prototype.sizeDidChange): Added.
(WI.NavigationBar.prototype.layout):
(WI.NavigationBar.prototype._updateContent): Added.
(WI.NavigationBar.prototype._updateContent.forceItemHidden): Added.
(WI.NavigationBar.prototype._updateContent.isDivider): Added.
(WI.NavigationBar.prototype._updateContent.calculateVisibleItemWidth): Added.
(WI.NavigationBar.prototype.layout.forceItemHidden): Deleted.
(WI.NavigationBar.prototype.layout.isDivider): Deleted.
(WI.NavigationBar.prototype.layout.calculateVisibleItemWidth): Deleted.
* UserInterface/Views/TabBrowser.js:
(WI.TabBrowser.prototype.sizeDidChange): Added.
(WI.TabBrowser.prototype.layout): Deleted.
Move logic in `layout` to `sizeDidChange` where applicable.
Modified Paths
Diff
Modified: trunk/Source/WebInspectorUI/ChangeLog (244263 => 244264)
--- trunk/Source/WebInspectorUI/ChangeLog 2019-04-15 17:12:28 UTC (rev 244263)
+++ trunk/Source/WebInspectorUI/ChangeLog 2019-04-15 17:22:11 UTC (rev 244264)
@@ -1,3 +1,40 @@
+2019-04-15 Devin Rousso <[email protected]>
+
+ Web Inspector: REGRESSION (r244157): Timelines: ruler size appears wrong on first layout
+ https://bugs.webkit.org/show_bug.cgi?id=196901
+ <rdar://problem/49880539>
+
+ Reviewed by Timothy Hatcher.
+
+ * UserInterface/Views/View.js:
+ (WI.View.prototype._layoutSubtree):
+ Ensure that the forced override of the layout reason during the initial layout doesn't
+ affect subviews.
+
+ * UserInterface/Views/ConsoleDrawer.js:
+ (WI.ConsoleDrawer.prototype.sizeDidChange): Added.
+ (WI.ConsoleDrawer.prototype.layout): Deleted.
+ * UserInterface/Views/ConsolePrompt.js:
+ (WI.ConsolePrompt.prototype.sizeDidChange): Added.
+ (WI.ConsolePrompt.prototype.layout): Deleted.
+ * UserInterface/Views/DOMTreeContentView.js:
+ (WI.DOMTreeContentView.prototype.sizeDidChange): Added.
+ (WI.DOMTreeContentView.prototype.layout):
+ * UserInterface/Views/NavigationBar.js:
+ (WI.NavigationBar.prototype.sizeDidChange): Added.
+ (WI.NavigationBar.prototype.layout):
+ (WI.NavigationBar.prototype._updateContent): Added.
+ (WI.NavigationBar.prototype._updateContent.forceItemHidden): Added.
+ (WI.NavigationBar.prototype._updateContent.isDivider): Added.
+ (WI.NavigationBar.prototype._updateContent.calculateVisibleItemWidth): Added.
+ (WI.NavigationBar.prototype.layout.forceItemHidden): Deleted.
+ (WI.NavigationBar.prototype.layout.isDivider): Deleted.
+ (WI.NavigationBar.prototype.layout.calculateVisibleItemWidth): Deleted.
+ * UserInterface/Views/TabBrowser.js:
+ (WI.TabBrowser.prototype.sizeDidChange): Added.
+ (WI.TabBrowser.prototype.layout): Deleted.
+ Move logic in `layout` to `sizeDidChange` where applicable.
+
2019-04-11 Devin Rousso <[email protected]>
Web Inspector: REGRESSION(r244195): Timelines: unable to take heap snapshot
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleDrawer.js (244263 => 244264)
--- trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleDrawer.js 2019-04-15 17:12:28 UTC (rev 244263)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleDrawer.js 2019-04-15 17:22:11 UTC (rev 244264)
@@ -93,16 +93,13 @@
// Protected
- layout()
+ sizeDidChange()
{
+ super.sizeDidChange();
+
if (this._collapsed)
return;
- if (this.layoutReason !== WI.View.LayoutReason.Resize)
- return;
-
- super.layout();
-
let height = this.height;
this._restoreDrawerHeight();
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ConsolePrompt.js (244263 => 244264)
--- trunk/Source/WebInspectorUI/UserInterface/Views/ConsolePrompt.js 2019-04-15 17:12:28 UTC (rev 244263)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ConsolePrompt.js 2019-04-15 17:22:11 UTC (rev 244264)
@@ -144,9 +144,11 @@
return !!this.text;
}
- layout()
+ sizeDidChange()
{
- if (this.layoutReason === WI.View.LayoutReason.Resize && this.text)
+ super.sizeDidChange();
+
+ if (this.text)
this._codeMirror.refresh();
}
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js (244263 => 244264)
--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js 2019-04-15 17:12:28 UTC (rev 244263)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js 2019-04-15 17:22:11 UTC (rev 244264)
@@ -364,12 +364,18 @@
// Protected
+ sizeDidChange()
+ {
+ super.sizeDidChange();
+
+ this._domTreeOutline.selectDOMNode(this._domTreeOutline.selectedDOMNode());
+ }
+
layout()
{
+ super.layout();
+
this._domTreeOutline.updateSelectionArea();
-
- if (this.layoutReason === WI.View.LayoutReason.Resize)
- this._domTreeOutline.selectDOMNode(this._domTreeOutline.selectedDOMNode());
}
// Private
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/NavigationBar.js (244263 => 244264)
--- trunk/Source/WebInspectorUI/UserInterface/Views/NavigationBar.js 2019-04-15 17:12:28 UTC (rev 244263)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/NavigationBar.js 2019-04-15 17:22:11 UTC (rev 244264)
@@ -208,11 +208,27 @@
super.needsLayout();
}
+ sizeDidChange()
+ {
+ super.sizeDidChange();
+
+ this._updateContent();
+ }
+
layout()
{
- if (this.layoutReason !== WI.View.LayoutReason.Resize && !this._forceLayout)
+ super.layout();
+
+ if (!this._forceLayout)
return;
+ this._updateContent();
+ }
+
+ // Private
+
+ _updateContent()
+ {
this._forceLayout = false;
// Remove the collapsed style class to test if the items can fit at full width.
@@ -285,8 +301,6 @@
forceItemHidden(previousItem);
}
- // Private
-
_mouseDown(event)
{
// Only handle left mouse clicks.
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TabBrowser.js (244263 => 244264)
--- trunk/Source/WebInspectorUI/UserInterface/Views/TabBrowser.js 2019-04-15 17:12:28 UTC (rev 244263)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TabBrowser.js 2019-04-15 17:22:11 UTC (rev 244264)
@@ -214,10 +214,9 @@
// Protected
- layout()
+ sizeDidChange()
{
- if (this.layoutReason !== WI.View.LayoutReason.Resize)
- return;
+ super.sizeDidChange();
for (let tabContentView of this._recentTabContentViews)
tabContentView[WI.TabBrowser.NeedsResizeLayoutSymbol] = tabContentView !== this.selectedTabContentView;
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/View.js (244263 => 244264)
--- trunk/Source/WebInspectorUI/UserInterface/Views/View.js 2019-04-15 17:12:28 UTC (rev 244263)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/View.js 2019-04-15 17:22:11 UTC (rev 244264)
@@ -277,18 +277,24 @@
let isInitialLayout = !this._didInitialLayout;
if (isInitialLayout) {
- // The initial layout should always be treated as dirty.
- this._setLayoutReason();
-
this.initialLayout();
this._didInitialLayout = true;
}
- if (this._layoutReason === WI.View.LayoutReason.Resize)
+ if (this._layoutReason === WI.View.LayoutReason.Resize || isInitialLayout)
this.sizeDidChange();
+ let savedLayoutReason = this._layoutReason;
+ if (isInitialLayout) {
+ // The initial layout should always be treated as dirty.
+ this._setLayoutReason();
+ }
+
this.layout();
+ // Ensure that the initial layout override doesn't affects to subviews.
+ this._layoutReason = savedLayoutReason;
+
if (WI.settings.enableLayoutFlashing.value)
this._drawLayoutFlashingOutline(isInitialLayout);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes