Changeset 244264 in webkit


Ignore:
Timestamp:
Apr 15, 2019 10:22:11 AM (5 years ago)
Author:
Devin Rousso
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.

Location:
trunk/Source/WebInspectorUI
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r244199 r244264  
     12019-04-15  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: REGRESSION (r244157): Timelines: ruler size appears wrong on first layout
     4        https://bugs.webkit.org/show_bug.cgi?id=196901
     5        <rdar://problem/49880539>
     6
     7        Reviewed by Timothy Hatcher.
     8
     9        * UserInterface/Views/View.js:
     10        (WI.View.prototype._layoutSubtree):
     11        Ensure that the forced override of the layout reason during the initial layout doesn't
     12        affect subviews.
     13
     14        * UserInterface/Views/ConsoleDrawer.js:
     15        (WI.ConsoleDrawer.prototype.sizeDidChange): Added.
     16        (WI.ConsoleDrawer.prototype.layout): Deleted.
     17        * UserInterface/Views/ConsolePrompt.js:
     18        (WI.ConsolePrompt.prototype.sizeDidChange): Added.
     19        (WI.ConsolePrompt.prototype.layout): Deleted.
     20        * UserInterface/Views/DOMTreeContentView.js:
     21        (WI.DOMTreeContentView.prototype.sizeDidChange): Added.
     22        (WI.DOMTreeContentView.prototype.layout):
     23        * UserInterface/Views/NavigationBar.js:
     24        (WI.NavigationBar.prototype.sizeDidChange): Added.
     25        (WI.NavigationBar.prototype.layout):
     26        (WI.NavigationBar.prototype._updateContent): Added.
     27        (WI.NavigationBar.prototype._updateContent.forceItemHidden): Added.
     28        (WI.NavigationBar.prototype._updateContent.isDivider): Added.
     29        (WI.NavigationBar.prototype._updateContent.calculateVisibleItemWidth): Added.
     30        (WI.NavigationBar.prototype.layout.forceItemHidden): Deleted.
     31        (WI.NavigationBar.prototype.layout.isDivider): Deleted.
     32        (WI.NavigationBar.prototype.layout.calculateVisibleItemWidth): Deleted.
     33        * UserInterface/Views/TabBrowser.js:
     34        (WI.TabBrowser.prototype.sizeDidChange): Added.
     35        (WI.TabBrowser.prototype.layout): Deleted.
     36        Move logic in `layout` to `sizeDidChange` where applicable.
     37
    1382019-04-11  Devin Rousso  <drousso@apple.com>
    239
  • trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleDrawer.js

    r231527 r244264  
    9494    // Protected
    9595
    96     layout()
     96    sizeDidChange()
    9797    {
     98        super.sizeDidChange();
     99
    98100        if (this._collapsed)
    99101            return;
    100 
    101         if (this.layoutReason !== WI.View.LayoutReason.Resize)
    102             return;
    103 
    104         super.layout();
    105102
    106103        let height = this.height;
  • trunk/Source/WebInspectorUI/UserInterface/Views/ConsolePrompt.js

    r242118 r244264  
    145145    }
    146146
    147     layout()
    148     {
    149         if (this.layoutReason === WI.View.LayoutReason.Resize && this.text)
     147    sizeDidChange()
     148    {
     149        super.sizeDidChange();
     150
     151        if (this.text)
    150152            this._codeMirror.refresh();
    151153    }
  • trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js

    r243207 r244264  
    365365    // Protected
    366366
     367    sizeDidChange()
     368    {
     369        super.sizeDidChange();
     370
     371        this._domTreeOutline.selectDOMNode(this._domTreeOutline.selectedDOMNode());
     372    }
     373
    367374    layout()
    368375    {
     376        super.layout();
     377
    369378        this._domTreeOutline.updateSelectionArea();
    370 
    371         if (this.layoutReason === WI.View.LayoutReason.Resize)
    372             this._domTreeOutline.selectDOMNode(this._domTreeOutline.selectedDOMNode());
    373379    }
    374380
  • trunk/Source/WebInspectorUI/UserInterface/Views/NavigationBar.js

    r243214 r244264  
    209209    }
    210210
     211    sizeDidChange()
     212    {
     213        super.sizeDidChange();
     214
     215        this._updateContent();
     216    }
     217
    211218    layout()
    212219    {
    213         if (this.layoutReason !== WI.View.LayoutReason.Resize && !this._forceLayout)
    214             return;
    215 
     220        super.layout();
     221
     222        if (!this._forceLayout)
     223            return;
     224
     225        this._updateContent();
     226    }
     227
     228    // Private
     229
     230    _updateContent()
     231    {
    216232        this._forceLayout = false;
    217233
     
    286302    }
    287303
    288     // Private
    289 
    290304    _mouseDown(event)
    291305    {
  • trunk/Source/WebInspectorUI/UserInterface/Views/TabBrowser.js

    r242049 r244264  
    215215    // Protected
    216216
    217     layout()
    218     {
    219         if (this.layoutReason !== WI.View.LayoutReason.Resize)
    220             return;
     217    sizeDidChange()
     218    {
     219        super.sizeDidChange();
    221220
    222221        for (let tabContentView of this._recentTabContentViews)
  • trunk/Source/WebInspectorUI/UserInterface/Views/View.js

    r244157 r244264  
    278278
    279279        if (isInitialLayout) {
     280            this.initialLayout();
     281            this._didInitialLayout = true;
     282        }
     283
     284        if (this._layoutReason === WI.View.LayoutReason.Resize || isInitialLayout)
     285            this.sizeDidChange();
     286
     287        let savedLayoutReason = this._layoutReason;
     288        if (isInitialLayout) {
    280289            // The initial layout should always be treated as dirty.
    281290            this._setLayoutReason();
    282 
    283             this.initialLayout();
    284             this._didInitialLayout = true;
    285         }
    286 
    287         if (this._layoutReason === WI.View.LayoutReason.Resize)
    288             this.sizeDidChange();
     291        }
    289292
    290293        this.layout();
     294
     295        // Ensure that the initial layout override doesn't affects to subviews.
     296        this._layoutReason = savedLayoutReason;
    291297
    292298        if (WI.settings.enableLayoutFlashing.value)
Note: See TracChangeset for help on using the changeset viewer.