Changeset 223991 in webkit


Ignore:
Timestamp:
Oct 25, 2017 4:13:19 PM (6 years ago)
Author:
webkit@devinrousso.com
Message:

Web Inspector: Canvas Tab: clicking on a canvas card causes details sidebar to show and mess up card arrangement
https://bugs.webkit.org/show_bug.cgi?id=178803
<rdar://problem/35176082>

Reviewed by Brian Burg.

  • Localizations/en.lproj/localizedStrings.js:
  • UserInterface/Views/CanvasDetailsSidebarPanel.css:

(.sidebar > .panel.details.canvas > .content > .empty-content-placeholder):
(.sidebar > .panel.details.canvas > .content > .empty-content-placeholder > .message):

  • UserInterface/Views/CanvasDetailsSidebarPanel.js:

(WI.CanvasDetailsSidebarPanel):
(WI.CanvasDetailsSidebarPanel.prototype.inspect):
(WI.CanvasDetailsSidebarPanel.prototype.initialLayout):
(WI.CanvasDetailsSidebarPanel.prototype.layout):

  • UserInterface/Views/RecordingNavigationSidebarPanel.js:

(WI.RecordingNavigationSidebarPanel.disallowInstanceForClass): Deleted.

  • UserInterface/Views/RecordingStateDetailsSidebarPanel.js:

(WI.RecordingStateDetailsSidebarPanel.disallowInstanceForClass): Deleted.

  • UserInterface/Views/RecordingTraceDetailsSidebarPanel.js:

(WI.RecordingTraceDetailsSidebarPanel.disallowInstanceForClass): Deleted.
Drive-by: these sidebar panels are now only used by the Canvas tab, so we no longer need to
provide support for multiple instances of them.

Location:
trunk/Source/WebInspectorUI
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r223983 r223991  
     12017-10-25  Devin Rousso  <webkit@devinrousso.com>
     2
     3        Web Inspector: Canvas Tab: clicking on a canvas card causes details sidebar to show and mess up card arrangement
     4        https://bugs.webkit.org/show_bug.cgi?id=178803
     5        <rdar://problem/35176082>
     6
     7        Reviewed by Brian Burg.
     8
     9        * Localizations/en.lproj/localizedStrings.js:
     10        * UserInterface/Views/CanvasDetailsSidebarPanel.css:
     11        (.sidebar > .panel.details.canvas > .content > .empty-content-placeholder):
     12        (.sidebar > .panel.details.canvas > .content > .empty-content-placeholder > .message):
     13        * UserInterface/Views/CanvasDetailsSidebarPanel.js:
     14        (WI.CanvasDetailsSidebarPanel):
     15        (WI.CanvasDetailsSidebarPanel.prototype.inspect):
     16        (WI.CanvasDetailsSidebarPanel.prototype.initialLayout):
     17        (WI.CanvasDetailsSidebarPanel.prototype.layout):
     18
     19        * UserInterface/Views/RecordingNavigationSidebarPanel.js:
     20        (WI.RecordingNavigationSidebarPanel.disallowInstanceForClass): Deleted.
     21        * UserInterface/Views/RecordingStateDetailsSidebarPanel.js:
     22        (WI.RecordingStateDetailsSidebarPanel.disallowInstanceForClass): Deleted.
     23        * UserInterface/Views/RecordingTraceDetailsSidebarPanel.js:
     24        (WI.RecordingTraceDetailsSidebarPanel.disallowInstanceForClass): Deleted.
     25        Drive-by: these sidebar panels are now only used by the Canvas tab, so we no longer need to
     26        provide support for multiple instances of them.
     27
    1282017-10-25  Joseph Pecoraro  <pecoraro@apple.com>
    229
  • trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js

    r223929 r223991  
    166166localizedStrings["Canvas %s"] = "Canvas %s";
    167167localizedStrings["Canvas Overview"] = "Canvas Overview";
    168 localizedStrings["Canvas:"] = "Canvas:";
    169168localizedStrings["Canvases"] = "Canvases";
    170169localizedStrings["Cap"] = "Cap";
     
    364363localizedStrings["Enable Breakpoint"] = "Enable Breakpoint";
    365364localizedStrings["Enable Breakpoints"] = "Enable Breakpoints";
    366 localizedStrings["Enable Canvas Tab"] = "Enable Canvas Tab";
    367365localizedStrings["Enable Layers Tab"] = "Enable Layers Tab";
    368366localizedStrings["Enable Program"] = "Enable Program";
     
    607605localizedStrings["No Box Model Information"] = "No Box Model Information";
    608606localizedStrings["No Breakpoints"] = "No Breakpoints";
     607localizedStrings["No Canvas Selected"] = "No Canvas Selected";
    609608localizedStrings["No Chart Available"] = "No Chart Available";
    610609localizedStrings["No Child Layers"] = "No Child Layers";
     
    835834localizedStrings["Show Console"] = "Show Console";
    836835localizedStrings["Show Console tab"] = "Show Console tab";
    837 localizedStrings["Show Contexts in Resources Tab"] = "Show Contexts in Resources Tab";
    838836localizedStrings["Show Grid"] = "Show Grid";
    839837localizedStrings["Show Path"] = "Show Path";
  • trunk/Source/WebInspectorUI/UserInterface/Views/CanvasDetailsSidebarPanel.css

    r219268 r223991  
    2727    display: block;
    2828}
     29
     30.sidebar > .panel.details.canvas > .content > .empty-content-placeholder {
     31    position: absolute;
     32    top: 0;
     33    right: 0;
     34    bottom: 0;
     35    left: 0;
     36    padding: 15px 0;
     37    display: flex;
     38    justify-content: center;
     39    align-items: center;
     40    overflow: hidden;
     41}
     42
     43.sidebar > .panel.details.canvas > .content > .empty-content-placeholder > .message {
     44    display: inline-block;
     45    padding: 5px 15px 6px;
     46    font-size: var(--sidebar-no-results-message-font-size);
     47    white-space: nowrap;
     48    color: var(--text-color-gray-medium);
     49}
  • trunk/Source/WebInspectorUI/UserInterface/Views/CanvasDetailsSidebarPanel.js

    r223921 r223991  
    3434        this._canvas = null;
    3535        this._node = null;
     36
     37        this._sections = [];
     38        this._emptyContentPlaceholder = null;
    3639    }
    3740
     
    5356        this.canvas = objects.find((object) => object instanceof WI.Canvas);
    5457
    55         return !!this._canvas;
     58        return true;
    5659    }
    5760
     
    101104        let identitySection = new WI.DetailsSection("canvas-details", WI.UIString("Identity"));
    102105        identitySection.groups = [new WI.DetailsSectionGroup([this._nameRow, this._typeRow, this._memoryRow])];
    103         this.contentView.element.appendChild(identitySection.element);
     106        this._sections.push(identitySection);
    104107
    105108        this._nodeRow = new WI.DetailsSectionSimpleRow(WI.UIString("Node"));
     
    111114        let sourceSection = new WI.DetailsSection("canvas-source", WI.UIString("Source"));
    112115        sourceSection.groups = [new WI.DetailsSectionGroup([this._nodeRow, this._cssCanvasRow, this._widthRow, this._heightRow, this._datachedRow])];
    113         this.contentView.element.appendChild(sourceSection.element);
     116        this._sections.push(sourceSection);
    114117
    115118        this._attributesDataGridRow = new WI.DetailsSectionDataGridRow(null, WI.UIString("No Attributes"));
     
    117120        let attributesSection = new WI.DetailsSection("canvas-attributes", WI.UIString("Attributes"));
    118121        attributesSection.groups = [new WI.DetailsSectionGroup([this._attributesDataGridRow])];
    119         this.contentView.element.appendChild(attributesSection.element);
     122        this._sections.push(attributesSection);
    120123
    121124        this._cssCanvasClientsRow = new WI.DetailsSectionSimpleRow(WI.UIString("Nodes"));
     
    124127        this._cssCanvasSection.groups = [new WI.DetailsSectionGroup([this._cssCanvasClientsRow])];
    125128        this._cssCanvasSection.element.hidden = true;
    126         this.contentView.element.appendChild(this._cssCanvasSection.element);
     129        this._sections.push(this._cssCanvasSection);
     130
     131        this._emptyContentPlaceholder = document.createElement("div");
     132        this._emptyContentPlaceholder.className = "empty-content-placeholder";
     133
     134        let emptyContentPlaceholderMessage = this._emptyContentPlaceholder.appendChild(document.createElement("div"));
     135        emptyContentPlaceholderMessage.className = "message";
     136        emptyContentPlaceholderMessage.textContent = WI.UIString("No Canvas Selected");
    127137    }
    128138
     
    131141        super.layout();
    132142
    133         if (!this._canvas)
    134             return;
     143        this.contentView.element.removeChildren();
     144
     145        if (!this._canvas) {
     146            this.contentView.element.appendChild(this._emptyContentPlaceholder);
     147            return;
     148        }
     149
     150        this.contentView.element.append(...this._sections.map(section => section.element));
    135151
    136152        this._refreshIdentitySection();
  • trunk/Source/WebInspectorUI/UserInterface/Views/RecordingNavigationSidebarPanel.js

    r223918 r223991  
    3737        this._importButton = null;
    3838        this._exportButton = null;
    39     }
    40 
    41     // Static
    42 
    43     static disallowInstanceForClass()
    44     {
    45         return true;
    4639    }
    4740
  • trunk/Source/WebInspectorUI/UserInterface/Views/RecordingStateDetailsSidebarPanel.js

    r222124 r223991  
    3434
    3535        this._dataGrid = null;
    36     }
    37 
    38     // Static
    39 
    40     static disallowInstanceForClass()
    41     {
    42         return true;
    4336    }
    4437
  • trunk/Source/WebInspectorUI/UserInterface/Views/RecordingTraceDetailsSidebarPanel.js

    r222124 r223991  
    3232        this._recording = null;
    3333        this._action = null;
    34     }
    35 
    36     // Static
    37 
    38     static disallowInstanceForClass()
    39     {
    40         return true;
    4134    }
    4235
Note: See TracChangeset for help on using the changeset viewer.