Changeset 147097 in webkit


Ignore:
Timestamp:
Mar 28, 2013 5:16:03 AM (11 years ago)
Author:
caseq@chromium.org
Message:

Web Inspector: DOMContentLoaded event divider is not shown on Timeline's main view
https://bugs.webkit.org/show_bug.cgi?id=113196

Reviewed by Pavel Feldman.

Source/WebCore:

  • keep event divider records in TimelinePresentationModel, not in TimelinePanel;
  • process event divider records on every level, not just on top.
  • inspector/front-end/TimelinePanel.js:

(WebInspector.TimelinePanel.prototype._updateEventDividers):
(WebInspector.TimelinePanel.prototype._innerAddRecordToTimeline.checkVisible):
(WebInspector.TimelinePanel.prototype._resetPanel):

  • inspector/front-end/TimelinePresentationModel.js:

(WebInspector.TimelinePresentationModel.prototype.reset):
(WebInspector.TimelinePresentationModel.prototype._innerAddRecord):
(WebInspector.TimelinePresentationModel.prototype.eventDividerRecords):

LayoutTests:

  • use TimelinePresentationModel to fetch list of event divider records;
  • http/tests/inspector/timeline-test.js:

(initialize_Timeline.InspectorTest.printTimestampRecords):

  • inspector/timeline/timeline-load-event-expected.txt:
  • inspector/timeline/timeline-load-event.html:
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r147095 r147097  
     12013-03-25  Andrey Kosyakov  <caseq@chromium.org>
     2
     3        Web Inspector: DOMContentLoaded event divider is not shown on Timeline's main view
     4        https://bugs.webkit.org/show_bug.cgi?id=113196
     5
     6        Reviewed by Pavel Feldman.
     7
     8        - use TimelinePresentationModel to fetch list of event divider records;
     9
     10        * http/tests/inspector/timeline-test.js:
     11        (initialize_Timeline.InspectorTest.printTimestampRecords):
     12        * inspector/timeline/timeline-load-event-expected.txt:
     13        * inspector/timeline/timeline-load-event.html:
     14
    1152013-03-28  Andrey Lushnikov  <lushnikov@chromium.org>
    216
  • trunk/LayoutTests/http/tests/inspector/timeline-test.js

    r146476 r147097  
    113113InspectorTest.printTimestampRecords = function(typeName, formatter)
    114114{
    115     InspectorTest.innerPrintTimelineRecords(WebInspector.panels.timeline._timeStampRecords.select("_record"), typeName, formatter);
     115    InspectorTest.innerPrintTimelineRecords(WebInspector.panels.timeline._presentationModel.eventDividerRecords().select("_record"), typeName, formatter);
    116116};
    117117
  • trunk/LayoutTests/inspector/timeline/timeline-load-event-expected.txt

    r144439 r147097  
    22
    33Page reloaded.
     4Model records:
     5MarkDOMContent Properties:
     6{
     7    counters : <object>
     8    data : {
     9        isMainFrame : true
     10    }
     11    frameId : <string>
     12    startTime : <number>
     13    type : "MarkDOMContent"
     14    usedHeapSize : <number>
     15}
     16MarkLoad Properties:
     17{
     18    counters : <object>
     19    data : {
     20        isMainFrame : true
     21    }
     22    frameId : <string>
     23    startTime : <number>
     24    type : "MarkLoad"
     25    usedHeapSize : <number>
     26}
     27Timestamp records:
     28MarkDOMContent Properties:
     29{
     30    counters : <object>
     31    data : {
     32        isMainFrame : true
     33    }
     34    frameId : <string>
     35    startTime : <number>
     36    type : "MarkDOMContent"
     37    usedHeapSize : <number>
     38}
    439MarkLoad Properties:
    540{
  • trunk/LayoutTests/inspector/timeline/timeline-load-event.html

    r143573 r147097  
    2020    function finish()
    2121    {
    22         if (++finishCalled === 2) {
    23             InspectorTest.printTimelineRecords("MarkLoad");
    24             InspectorTest.completeTest();
    25         }
     22        if (++finishCalled !== 2)
     23            return;
     24
     25        InspectorTest.addResult("Model records:");
     26        InspectorTest.printTimelineRecords("MarkDOMContent");
     27        InspectorTest.printTimelineRecords("MarkLoad");
     28        InspectorTest.addResult("Timestamp records:");
     29        InspectorTest.printTimestampRecords("MarkDOMContent");
     30        InspectorTest.printTimestampRecords("MarkLoad");
     31        InspectorTest.completeTest();
    2632    }
    2733}
  • trunk/Source/WebCore/ChangeLog

    r147096 r147097  
     12013-03-25  Andrey Kosyakov  <caseq@chromium.org>
     2
     3        Web Inspector: DOMContentLoaded event divider is not shown on Timeline's main view
     4        https://bugs.webkit.org/show_bug.cgi?id=113196
     5
     6        Reviewed by Pavel Feldman.
     7
     8        - keep event divider records in TimelinePresentationModel, not in TimelinePanel;
     9        - process event divider records on every level, not just on top.
     10
     11        * inspector/front-end/TimelinePanel.js:
     12        (WebInspector.TimelinePanel.prototype._updateEventDividers):
     13        (WebInspector.TimelinePanel.prototype._innerAddRecordToTimeline.checkVisible):
     14        (WebInspector.TimelinePanel.prototype._resetPanel):
     15        * inspector/front-end/TimelinePresentationModel.js:
     16        (WebInspector.TimelinePresentationModel.prototype.reset):
     17        (WebInspector.TimelinePresentationModel.prototype._innerAddRecord):
     18        (WebInspector.TimelinePresentationModel.prototype.eventDividerRecords):
     19
    1202013-03-28  Vsevolod Vlasov  <vsevik@chromium.org>
    221
  • trunk/Source/WebCore/inspector/front-end/TimelinePanel.js

    r147076 r147097  
    135135    this._durationFilter = new WebInspector.TimelineIsLongFilter();
    136136
    137     this._timeStampRecords = [];
    138137    this._expandOffset = 15;
    139138
     
    472471        var clientWidth = this._graphRowsElementWidth;
    473472        var dividers = [];
    474 
    475         for (var i = 0; i < this._timeStampRecords.length; ++i) {
    476             var record = this._timeStampRecords[i];
     473        var eventDividerRecords = this._presentationModel.eventDividerRecords();
     474
     475        for (var i = 0; i < eventDividerRecords.length; ++i) {
     476            var record = eventDividerRecords[i];
    477477            var positions = this._calculator.computeBarGraphWindowPosition(record);
    478478            var dividerPosition = Math.round(positions.left);
     
    649649        var records = this._presentationModel.addRecord(record);
    650650        this._allRecordsCount += records.length;
    651         var timeStampRecords = this._timeStampRecords;
    652651        var hasVisibleRecords = false;
    653652        var presentationModel = this._presentationModel;
    654         function processRecord(record)
     653        function checkVisible(record)
    655654        {
    656             if (WebInspector.TimelinePresentationModel.isEventDivider(record))
    657                 timeStampRecords.push(record);
    658655            hasVisibleRecords |= presentationModel.isVisible(record);
    659656        }
    660         WebInspector.TimelinePresentationModel.forAllRecords(records, processRecord);
     657        WebInspector.TimelinePresentationModel.forAllRecords(records, checkVisible);
    661658
    662659        function isAdoptedRecord(record)
     
    712709    {
    713710        this._presentationModel.reset();
    714         this._timeStampRecords = [];
    715711        this._boundariesAreValid = false;
    716712        this._adjustScrollPosition(0);
     
    12111207    },
    12121208
    1213     _updateSearchResults: function() {
     1209    _updateSearchResults: function()
     1210    {
    12141211        var searchRegExp = this._searchRegExp;
    12151212        if (!searchRegExp)
  • trunk/Source/WebCore/inspector/front-end/TimelinePresentationModel.js

    r145727 r147097  
    266266        this._timerRecords = {};
    267267        this._requestAnimationFrameRecords = {};
     268        this._eventDividerRecords = [];
    268269        this._timeRecords = {};
    269270        this._timeRecordStack = [];
     
    346347        var formattedRecord = new WebInspector.TimelinePresentationModel.Record(this, record, parentRecord, origin, scriptDetails, isHiddenRecord);
    347348
     349        if (WebInspector.TimelinePresentationModel.isEventDivider(formattedRecord))
     350            this._eventDividerRecords.push(formattedRecord);
     351
    348352        if (isHiddenRecord)
    349353            return formattedRecord;
     
    537541            ++lastFrame;
    538542        return this._frames.slice(firstFrame, lastFrame);
     543    },
     544
     545    eventDividerRecords: function()
     546    {
     547        return this._eventDividerRecords;
    539548    },
    540549
Note: See TracChangeset for help on using the changeset viewer.