Changeset 245833 in webkit


Ignore:
Timestamp:
May 28, 2019 5:14:35 PM (5 years ago)
Author:
Devin Rousso
Message:

Web Inspector: Timelines: spacing around pie chart is different between CPU and Memory
https://bugs.webkit.org/show_bug.cgi?id=198299

Reviewed by Matt Baker.

"Style Resolution" is a much longer string than any of the legend strings in the Memory
timeline, and causes the CPU timeline legend to shift as a result.

Rename "Script" to "JavaScript" and "Style Resolution" to "Styles" so that the strings are
roughly the same length between the CPU and Memory timelines, meaning that they will appear
in the same spot with similar sizing.

  • UserInterface/Views/CPUTimelineView.js:

(WI.CPUTimelineView.displayNameForSampleType):
(WI.CPUTimelineView.prototype.initialLayout):
(WI.CPUTimelineView.prototype._computeStatisticsData):
Drive-by: remove the WI prefix from all CPUTimelineView.SampleType since it's within the
same class.

  • UserInterface/Views/CPUTimelineView.css:

(.timeline-view.cpu > .content > .overview .legend > .row > .swatch.sample-type-javascript): Added.
(.timeline-view.cpu > .content > .overview .legend > .row > .swatch.sample-type-script): Deleted.
Drive-by: move the .overview rules lower to be in the same area as the .overview * rules.

  • UserInterface/Views/MemoryTimelineView.css:

(.timeline-view.memory > .content > .overview):
Drive-by: remove duplicate CSS rule.

  • Localizations/en.lproj/localizedStrings.js:
Location:
trunk/Source/WebInspectorUI
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r245827 r245833  
     12019-05-28  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Timelines: spacing around pie chart is different between CPU and Memory
     4        https://bugs.webkit.org/show_bug.cgi?id=198299
     5
     6        Reviewed by Matt Baker.
     7
     8        "Style Resolution" is a much longer string than any of the legend strings in the Memory
     9        timeline, and causes the CPU timeline legend to shift as a result.
     10
     11        Rename "Script" to "JavaScript" and "Style Resolution" to "Styles" so that the strings are
     12        roughly the same length between the CPU and Memory timelines, meaning that they will appear
     13        in the same spot with similar sizing.
     14
     15        * UserInterface/Views/CPUTimelineView.js:
     16        (WI.CPUTimelineView.displayNameForSampleType):
     17        (WI.CPUTimelineView.prototype.initialLayout):
     18        (WI.CPUTimelineView.prototype._computeStatisticsData):
     19        Drive-by: remove the `WI` prefix from all `CPUTimelineView.SampleType` since it's within the
     20        same class.
     21
     22        * UserInterface/Views/CPUTimelineView.css:
     23        (.timeline-view.cpu > .content > .overview .legend > .row > .swatch.sample-type-javascript): Added.
     24        (.timeline-view.cpu > .content > .overview .legend > .row > .swatch.sample-type-script): Deleted.
     25        Drive-by: move the `.overview` rules lower to be in the same area as the `.overview *` rules.
     26
     27        * UserInterface/Views/MemoryTimelineView.css:
     28        (.timeline-view.memory > .content > .overview):
     29        Drive-by: remove duplicate CSS rule.
     30
     31        * Localizations/en.lproj/localizedStrings.js:
     32
    1332019-05-28  Nikita Vasilyev  <nvasilyev@apple.com>
    234
  • trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js

    r245827 r245833  
    10421042/* CSS properties defined via HTML style attribute */
    10431043localizedStrings["Style Attribute"] = "Style Attribute";
    1044 localizedStrings["Style Resolution"] = "Style Resolution";
    10451044localizedStrings["Style rule"] = "Style rule";
    10461045localizedStrings["Styles"] = "Styles";
  • trunk/Source/WebInspectorUI/UserInterface/Views/CPUTimelineView.css

    r244479 r245833  
    2828}
    2929
    30 .timeline-view.cpu > .content > .overview {
    31     display: flex;
    32     justify-content: center;
    33     padding: 10px;
    34 }
    35 
    36 .timeline-view.cpu > .content > .overview:not(:last-child) {
    37     margin-bottom: 10px;
    38     border-bottom: 1px solid var(--border-color);
    39 }
    40 
    4130.timeline-view.cpu > .content .subtitle {
    4231    font-family: -webkit-system-font, sans-serif;
     
    9685}
    9786
     87.timeline-view.cpu > .content > .overview {
     88    display: flex;
     89    justify-content: center;
     90    padding: 10px;
     91}
     92
     93.timeline-view.cpu > .content > .overview:not(:last-child) {
     94    margin-bottom: 10px;
     95    border-bottom: 1px solid var(--border-color);
     96}
     97
    9898.timeline-view.cpu > .content > .overview > .chart {
    9999    width: 420px;
     
    150150}
    151151
    152 .timeline-view.cpu > .content > .overview .legend > .row > .swatch.sample-type-script {
     152.timeline-view.cpu > .content > .overview .legend > .row > .swatch.sample-type-javascript {
    153153    border: 1px solid var(--cpu-script-stroke-color);
    154154    background-color: var(--cpu-script-fill-color);
  • trunk/Source/WebInspectorUI/UserInterface/Views/CPUTimelineView.js

    r245827 r245833  
    5555    {
    5656        switch (type) {
    57         case WI.CPUTimelineView.SampleType.Script:
    58             return WI.UIString("Script");
    59         case WI.CPUTimelineView.SampleType.Layout:
     57        case CPUTimelineView.SampleType.Script:
     58            return WI.UIString("JavaScript");
     59        case CPUTimelineView.SampleType.Layout:
    6060            return WI.repeatedUIString.timelineRecordLayout();
    61         case WI.CPUTimelineView.SampleType.Paint:
     61        case CPUTimelineView.SampleType.Paint:
    6262            return WI.repeatedUIString.timelineRecordPaint();
    63         case WI.CPUTimelineView.SampleType.Style:
    64             return WI.UIString("Style Resolution");
     63        case CPUTimelineView.SampleType.Style:
     64            return WI.UIString("Styles");
    6565        }
    6666        console.error("Unknown sample type", type);
     
    212212        this._breakdownLegendElement.classList.add("legend");
    213213
    214         this._breakdownLegendScriptElement = appendLegendRow(this._breakdownLegendElement, WI.CPUTimelineView.SampleType.Script);
    215         this._breakdownLegendLayoutElement = appendLegendRow(this._breakdownLegendElement, WI.CPUTimelineView.SampleType.Layout);
    216         this._breakdownLegendPaintElement = appendLegendRow(this._breakdownLegendElement, WI.CPUTimelineView.SampleType.Paint);
    217         this._breakdownLegendStyleElement = appendLegendRow(this._breakdownLegendElement, WI.CPUTimelineView.SampleType.Style);
     214        this._breakdownLegendScriptElement = appendLegendRow(this._breakdownLegendElement, CPUTimelineView.SampleType.JavaScript);
     215        this._breakdownLegendLayoutElement = appendLegendRow(this._breakdownLegendElement, CPUTimelineView.SampleType.Layout);
     216        this._breakdownLegendPaintElement = appendLegendRow(this._breakdownLegendElement, CPUTimelineView.SampleType.Paint);
     217        this._breakdownLegendStyleElement = appendLegendRow(this._breakdownLegendElement, CPUTimelineView.SampleType.Style);
    218218
    219219        let dividerElement = overviewElement.appendChild(document.createElement("div"));
     
    13011301
    13021302        markRecordEntries(scriptRecords, (record) => {
    1303             return WI.CPUTimelineView.SampleType.Script;
     1303            return CPUTimelineView.SampleType.JavaScript;
    13041304        });
    13051305
     
    13071307            switch (record.eventType) {
    13081308            case WI.LayoutTimelineRecord.EventType.RecalculateStyles:
    1309                 return WI.CPUTimelineView.SampleType.Style;
     1309                return CPUTimelineView.SampleType.Style;
    13101310            case WI.LayoutTimelineRecord.EventType.ForcedLayout:
    13111311            case WI.LayoutTimelineRecord.EventType.Layout:
    1312                 return WI.CPUTimelineView.SampleType.Layout;
     1312                return CPUTimelineView.SampleType.Layout;
    13131313            case WI.LayoutTimelineRecord.EventType.Paint:
    13141314            case WI.LayoutTimelineRecord.EventType.Composite:
    1315                 return WI.CPUTimelineView.SampleType.Paint;
     1315                return CPUTimelineView.SampleType.Paint;
    13161316            }
    13171317        });
     
    13271327                samplesIdle++;
    13281328                break;
    1329             case WI.CPUTimelineView.SampleType.Script:
     1329            case CPUTimelineView.SampleType.JavaScript:
    13301330                samplesScript++;
    13311331                break;
    1332             case WI.CPUTimelineView.SampleType.Layout:
     1332            case CPUTimelineView.SampleType.Layout:
    13331333                samplesLayout++;
    13341334                break;
    1335             case WI.CPUTimelineView.SampleType.Paint:
     1335            case CPUTimelineView.SampleType.Paint:
    13361336                samplesPaint++;
    13371337                break;
    1338             case WI.CPUTimelineView.SampleType.Style:
     1338            case CPUTimelineView.SampleType.Style:
    13391339                samplesStyle++;
    13401340                break;
     
    18231823// NOTE: UI follows this order.
    18241824WI.CPUTimelineView.SampleType = {
    1825     Script: "sample-type-script",
     1825    JavaScript: "sample-type-javascript",
    18261826    Layout: "sample-type-layout",
    18271827    Paint: "sample-type-paint",
  • trunk/Source/WebInspectorUI/UserInterface/Views/MemoryTimelineView.css

    r242077 r245833  
    2626body .timeline-view.memory {
    2727    overflow: scroll;
    28 }
    29 
    30 .timeline-view.memory > .content > .overview {
    31     padding: 10px;
    32     margin-bottom: 10px;
    33     border-bottom: 1px solid var(--border-color);
    3428}
    3529
     
    6963    display: flex;
    7064    justify-content: center;
     65    margin-bottom: 10px;
     66    padding: 10px;
     67    border-bottom: 1px solid var(--border-color);
    7168}
    7269
Note: See TracChangeset for help on using the changeset viewer.