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

Changeset 244157 in webkit


Ignore:
Timestamp:
Apr 10, 2019, 3:47:26 PM (7 years ago)
Author:
Devin Rousso
Message:

Web Inspector: REGRESSION: Audit: result UI shown on first open if an audit was previously selected
https://bugs.webkit.org/show_bug.cgi?id=196723
<rdar://problem/49722252>

Reviewed by Timothy Hatcher.

When opening Web Inspector for the first time, we will trigger resize layouts on the main
content area as Web Inspector is resized to it's old window size.

Rather than treating this layout as a View.LayoutReason.Resize, we should treat the
first layout (e.g. initialLayout) as a View.LayoutReason.Dirty instead, as there was
previously no content.

  • UserInterface/Views/View.js:

(WI.View.prototype._layoutSubtree):
(WI.View.prototype._setLayoutReason):

  • UserInterface/Views/AuditTestContentView.js:

(WI.AuditTestContentView):
Drive-by: ensure that this class is not instantiated directly.

Location:
trunk/Source/WebInspectorUI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r244156 r244157  
     12019-04-10  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: REGRESSION: Audit: result UI shown on first open if an audit was previously selected
     4        https://bugs.webkit.org/show_bug.cgi?id=196723
     5        <rdar://problem/49722252>
     6
     7        Reviewed by Timothy Hatcher.
     8
     9        When opening Web Inspector for the first time, we will trigger resize `layout`s on the main
     10        content area as Web Inspector is resized to it's old window size.
     11
     12        Rather than treating this layout as a `View.LayoutReason.Resize`, we should treat the
     13        first `layout` (e.g. `initialLayout`) as a `View.LayoutReason.Dirty` instead, as there was
     14        previously no content.
     15
     16        * UserInterface/Views/View.js:
     17        (WI.View.prototype._layoutSubtree):
     18        (WI.View.prototype._setLayoutReason):
     19
     20        * UserInterface/Views/AuditTestContentView.js:
     21        (WI.AuditTestContentView):
     22        Drive-by: ensure that this class is not instantiated directly.
     23
    1242019-04-10  Devin Rousso  <drousso@apple.com>
    225
  • trunk/Source/WebInspectorUI/UserInterface/Views/AuditTestContentView.js

    r241227 r244157  
    3232        super(representedObject);
    3333
     34        // This class should not be instantiated directly. Create a concrete subclass instead.
     35        console.assert(this.constructor !== WI.AuditTestContentView && this instanceof WI.AuditTestContentView);
     36
    3437        this.element.classList.add("audit-test");
    3538
  • trunk/Source/WebInspectorUI/UserInterface/Views/View.js

    r242241 r244157  
    277277        let isInitialLayout = !this._didInitialLayout;
    278278
    279         if (!this._didInitialLayout) {
     279        if (isInitialLayout) {
     280            // The initial layout should always be treated as dirty.
     281            this._setLayoutReason();
     282
    280283            this.initialLayout();
    281284            this._didInitialLayout = true;
     
    302305    _setLayoutReason(layoutReason)
    303306    {
    304         if (this._layoutReason === WI.View.LayoutReason.Resize)
    305             return;
    306 
    307307        this._layoutReason = layoutReason || WI.View.LayoutReason.Dirty;
    308308    }
Note: See TracChangeset for help on using the changeset viewer.