[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

pfeldman at chromium.org pfeldman at chromium.org
Thu Oct 29 20:51:09 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit b0cbbe98aa4996e1fa71d593e0fca23d77a5d2c4
Author: pfeldman at chromium.org <pfeldman at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Oct 24 00:40:14 2009 +0000

    2009-10-23  Pavel Feldman  <pfeldman at chromium.org>
    
            Reviewed by Timothy Hatcher.
    
            Web Inspector: Implement a Timeline panel.
    
            https://bugs.webkit.org/show_bug.cgi?id=30725
    
            * WebCore.gypi:
            * WebCore.vcproj/WebCore.vcproj:
            * inspector/front-end/Images/timelineIcon.png: Added.
            * inspector/front-end/TimelineAgent.js:
            (WebInspector.addItemToTimeline):
            (WebInspector.timelineProfilerWasStarted):
            (WebInspector.timelineProfilerWasStopped):
            * inspector/front-end/TimelinePanel.js: Added.
            (WebInspector.TimelinePanel):
            (WebInspector.TimelinePanel.prototype.toolbarItemClass.get toolbarItemLabel):
            (WebInspector.TimelinePanel.prototype.get statusBarItems):
            (WebInspector.TimelinePanel.prototype.handleKeyEvent):
            (WebInspector.TimelinePanel.prototype.timelineWasStarted):
            (WebInspector.TimelinePanel.prototype.timelineWasStopped):
            (WebInspector.TimelinePanel.prototype.addItemToTimeline):
            (WebInspector.TimelinePanel.prototype._innerAddItemToTimeline):
            (WebInspector.TimelinePanel.prototype._toggleTimelineButton):
            (WebInspector.TimelinePanel.prototype.setMainViewWidth):
            (WebInspector.TimelinePanel.prototype.getItemTypeName):
            (WebInspector.TimelineRecordTreeElement):
            (WebInspector.TimelineRecordTreeElement.prototype.onattach):
            * inspector/front-end/WebKit.qrc:
            * inspector/front-end/inspector.css:
            * inspector/front-end/inspector.html:
            * inspector/front-end/inspector.js:
            (WebInspector._createPanels):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50015 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 761bed8..c1ae142 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,38 @@
+2009-10-23  Pavel Feldman  <pfeldman at chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: Implement a Timeline panel.
+
+        https://bugs.webkit.org/show_bug.cgi?id=30725
+
+        * WebCore.gypi:
+        * WebCore.vcproj/WebCore.vcproj:
+        * inspector/front-end/Images/timelineIcon.png: Added.
+        * inspector/front-end/TimelineAgent.js:
+        (WebInspector.addItemToTimeline):
+        (WebInspector.timelineProfilerWasStarted):
+        (WebInspector.timelineProfilerWasStopped):
+        * inspector/front-end/TimelinePanel.js: Added.
+        (WebInspector.TimelinePanel):
+        (WebInspector.TimelinePanel.prototype.toolbarItemClass.get toolbarItemLabel):
+        (WebInspector.TimelinePanel.prototype.get statusBarItems):
+        (WebInspector.TimelinePanel.prototype.handleKeyEvent):
+        (WebInspector.TimelinePanel.prototype.timelineWasStarted):
+        (WebInspector.TimelinePanel.prototype.timelineWasStopped):
+        (WebInspector.TimelinePanel.prototype.addItemToTimeline):
+        (WebInspector.TimelinePanel.prototype._innerAddItemToTimeline):
+        (WebInspector.TimelinePanel.prototype._toggleTimelineButton):
+        (WebInspector.TimelinePanel.prototype.setMainViewWidth):
+        (WebInspector.TimelinePanel.prototype.getItemTypeName):
+        (WebInspector.TimelineRecordTreeElement):
+        (WebInspector.TimelineRecordTreeElement.prototype.onattach):
+        * inspector/front-end/WebKit.qrc:
+        * inspector/front-end/inspector.css:
+        * inspector/front-end/inspector.html:
+        * inspector/front-end/inspector.js:
+        (WebInspector._createPanels):
+
 2009-10-23  Joseph Pecoraro  <joepeck at webkit.org>
 
         Reviewed by Timothy Hatcher.
diff --git a/WebCore/English.lproj/localizedStrings.js b/WebCore/English.lproj/localizedStrings.js
index b024652..634f25d 100644
Binary files a/WebCore/English.lproj/localizedStrings.js and b/WebCore/English.lproj/localizedStrings.js differ
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index 44f56c5..b8b706c 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -3642,6 +3642,7 @@
             'inspector/front-end/TestController.js',
             'inspector/front-end/TextPrompt.js',
             'inspector/front-end/TimelineAgent.js',
+            'inspector/front-end/TimelinePanel.js',
             'inspector/front-end/TopDownProfileDataGridTree.js',
             'inspector/front-end/treeoutline.js',
             'inspector/front-end/utilities.js',
@@ -3749,6 +3750,7 @@
             'inspector/front-end/Images/timelineHollowPillPurple.png',
             'inspector/front-end/Images/timelineHollowPillRed.png',
             'inspector/front-end/Images/timelineHollowPillYellow.png',
+            'inspector/front-end/Images/timelineIcon.png',
             'inspector/front-end/Images/timelinePillBlue.png',
             'inspector/front-end/Images/timelinePillGray.png',
             'inspector/front-end/Images/timelinePillGreen.png',
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index 999148c..3ecf7d9 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -36458,6 +36458,10 @@
 					>
 				</File>
 				<File
+					RelativePath="..\inspector\front-end\TimelinePanel.js"
+					>
+				</File>
+				<File
 					RelativePath="..\inspector\front-end\TopDownProfileDataGridTree.js"
 					>
 				</File>
diff --git a/WebCore/inspector/front-end/Images/timelineIcon.png b/WebCore/inspector/front-end/Images/timelineIcon.png
new file mode 100644
index 0000000..09bcf30
Binary files /dev/null and b/WebCore/inspector/front-end/Images/timelineIcon.png differ
diff --git a/WebCore/inspector/front-end/TimelineAgent.js b/WebCore/inspector/front-end/TimelineAgent.js
index 4363da8..a310c38 100644
--- a/WebCore/inspector/front-end/TimelineAgent.js
+++ b/WebCore/inspector/front-end/TimelineAgent.js
@@ -42,13 +42,16 @@ WebInspector.TimelineAgent.ItemType = {
 };
 
 WebInspector.addItemToTimeline = function(record) {
-    // Not implemented.
+    if (WebInspector.panels.timeline)
+        WebInspector.panels.timeline.addItemToTimeline(record);
 }
 
 WebInspector.timelineProfilerWasStarted = function() {
-    // Not implemented.
+    if (WebInspector.panels.timeline)
+        WebInspector.panels.timeline.timelineWasStarted();
 }
 
 WebInspector.timelineProfilerWasStopped = function() {
-    // Not implemented.
+    if (WebInspector.panels.timeline)
+        WebInspector.panels.timeline.timelineWasStopped();
 }
diff --git a/WebCore/inspector/front-end/TimelinePanel.js b/WebCore/inspector/front-end/TimelinePanel.js
new file mode 100644
index 0000000..86034d3
--- /dev/null
+++ b/WebCore/inspector/front-end/TimelinePanel.js
@@ -0,0 +1,159 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+WebInspector.TimelinePanel = function()
+{
+    WebInspector.Panel.call(this, true);
+
+    this.element.addStyleClass("timeline");
+
+    this.timelineView = document.createElement("div");
+    this.timelineView.id = "timeline-view";
+    this.element.appendChild(this.timelineView);
+
+    this.recordsTreeElement = new WebInspector.SidebarSectionTreeElement(WebInspector.UIString("RECORDS"), {}, true);
+    this.recordsTreeElement.expanded = true;
+    this.sidebarTree.appendChild(this.recordsTreeElement);
+
+    this.toggleTimelineButton = new WebInspector.StatusBarButton("", "record-profile-status-bar-item");
+    this.toggleTimelineButton.addEventListener("click", this._toggleTimelineButton.bind(this), false);
+}
+
+WebInspector.TimelinePanel.prototype = {
+    toolbarItemClass: "timeline",
+
+    get toolbarItemLabel()
+    {
+        return WebInspector.UIString("Timeline");
+    },
+
+    get statusBarItems()
+    {
+        return [this.toggleTimelineButton.element];
+    },
+
+    handleKeyEvent: function(event)
+    {
+        this.sidebarTree.handleKeyEvent(event);
+    },
+
+    timelineWasStarted: function()
+    {
+        this.toggleTimelineButton.toggled = true;
+    },
+
+    timelineWasStopped: function()
+    {
+        this.toggleTimelineButton.toggled = false;
+    },
+
+    addItemToTimeline: function(record)
+    {
+        this._innerAddItemToTimeline(this.recordsTreeElement, record);
+    },
+
+    _innerAddItemToTimeline: function(parentElement, record)
+    {
+        var treeItem = new WebInspector.TimelineRecordTreeElement(this, record);
+        parentElement.appendChild(treeItem);
+        if (record.children)
+            parentElement.expanded = true;
+        for (var i = 0; i < record.children.length; ++i)
+            this._innerAddItemToTimeline(treeItem, record.children[i]);
+    },
+
+    _toggleTimelineButton: function()
+    {
+        if (InspectorController.timelineProfilerEnabled())
+            InspectorController.stopTimelineProfiler();
+        else
+            InspectorController.startTimelineProfiler();
+    },
+
+    setMainViewWidth: function(width)
+    {
+        this.timelineView.style.left = width + "px";
+    },
+
+    getItemTypeName: function(record)
+    {
+        if (!this._itemTypeNames) {
+            this._itemTypeNames = {};
+            var itemTypes = WebInspector.TimelineAgent.ItemType;
+            this._itemTypeNames[itemTypes.DOMDispatch] = WebInspector.UIString("DOM Event");
+            this._itemTypeNames[itemTypes.Layout] = WebInspector.UIString("Layout");
+            this._itemTypeNames[itemTypes.RecalculateStyles] = WebInspector.UIString("Recalculate Style");
+            this._itemTypeNames[itemTypes.Paint] = WebInspector.UIString("Paint");
+            this._itemTypeNames[itemTypes.Layout] = WebInspector.UIString("Layout");
+            this._itemTypeNames[itemTypes.ParseHTML] = WebInspector.UIString("Parse");
+        }
+        return this._itemTypeNames[record.type];
+    }
+}
+
+WebInspector.TimelinePanel.prototype.__proto__ = WebInspector.Panel.prototype;
+
+
+WebInspector.TimelineRecordTreeElement = function(panel, record)
+{
+    this._panel = panel;
+    this._record = record;
+
+    // Pass an empty title, the title gets made later in onattach.
+    TreeElement.call(this, "", null, false);
+}
+
+WebInspector.TimelineRecordTreeElement.prototype = {
+    onattach: function()
+    {
+        this.listItemElement.removeChildren();
+        this.listItemElement.addStyleClass("timeline-tree-item");
+
+        var typeElement = document.createElement("span");
+        typeElement.className = "type";
+        typeElement.textContent = this._panel.getItemTypeName(this._record);
+        this.listItemElement.appendChild(typeElement);
+
+        if (this._record.data) {
+            var separatorElement = document.createElement("span");
+            separatorElement.className = "separator";
+            separatorElement.textContent = " ";
+
+            var dataElement = document.createElement("span");
+            dataElement.className = "data";
+            dataElement.textContent = "(" + this._record.data.type + ")";
+            dataElement.addStyleClass("dimmed");
+            this.listItemElement.appendChild(separatorElement);
+            this.listItemElement.appendChild(dataElement);
+        }
+    }
+}
+
+WebInspector.TimelineRecordTreeElement.prototype.__proto__ = TreeElement.prototype;
diff --git a/WebCore/inspector/front-end/WebKit.qrc b/WebCore/inspector/front-end/WebKit.qrc
index 32f15ce..898bd4c 100644
--- a/WebCore/inspector/front-end/WebKit.qrc
+++ b/WebCore/inspector/front-end/WebKit.qrc
@@ -60,6 +60,7 @@
     <file>TestController.js</file>
     <file>TextPrompt.js</file>
     <file>TimelineAgent.js</file>
+    <file>TimelinePanel.js</file>
     <file>TopDownProfileDataGridTree.js</file>
     <file>treeoutline.js</file>
     <file>utilities.js</file>
diff --git a/WebCore/inspector/front-end/inspector.css b/WebCore/inspector/front-end/inspector.css
index 7f002e6..a34f807 100644
--- a/WebCore/inspector/front-end/inspector.css
+++ b/WebCore/inspector/front-end/inspector.css
@@ -203,6 +203,10 @@ body.attached #search-results-matches {
     background-image: url(Images/scriptsIcon.png);
 }
 
+.toolbar-item.timeline .toolbar-icon {
+    background-image: url(Images/timelineIcon.png);
+}
+
 .toolbar-item.storage .toolbar-icon {
     background-image: url(Images/storageIcon.png);
 }
@@ -3261,6 +3265,26 @@ body.inactive .sidebar-tree-item.selected .bubble.search-matches {
     background-image: url(Images/searchSmallGray.png);
 }
 
+/* Timeline Style */
+
+#timeline-views {
+    position: absolute;
+    top: 0;
+    right: 0;
+    left: 200px;
+    bottom: 0;
+}
+
+.timeline-tree-item {
+    height: 18px;
+    padding-left: 24px;
+    white-space: nowrap;
+}
+
+.timeline-tree-item .data.dimmed {
+    color: rgba(0, 0, 0, 0.7);
+}
+
 /* Profiler Style */
 
 #profile-views {
diff --git a/WebCore/inspector/front-end/inspector.html b/WebCore/inspector/front-end/inspector.html
index 4fa69e0..d3bc645 100644
--- a/WebCore/inspector/front-end/inspector.html
+++ b/WebCore/inspector/front-end/inspector.html
@@ -94,6 +94,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     <script type="text/javascript" src="InjectedScript.js"></script>
     <script type="text/javascript" src="InjectedScriptAccess.js"></script>
     <script type="text/javascript" src="TimelineAgent.js"></script>
+    <script type="text/javascript" src="TimelinePanel.js"></script>
     <script type="text/javascript" src="TestController.js"></script>
 </head>
 <body class="detached">
diff --git a/WebCore/inspector/front-end/inspector.js b/WebCore/inspector/front-end/inspector.js
index d81ade6..ab33a0b 100644
--- a/WebCore/inspector/front-end/inspector.js
+++ b/WebCore/inspector/front-end/inspector.js
@@ -143,8 +143,13 @@ var WebInspector = {
             this.panels.profiles = new WebInspector.ProfilesPanel();
             this.panels.profiles.registerProfileType(new WebInspector.CPUProfileType());
         }
+
+        // Uncomment this when timeline is ready.
+        // if (hiddenPanels.indexOf("timeline") === -1 && hiddenPanels.indexOf("timeline") === -1)
+        //     this.panels.timeline = new WebInspector.TimelinePanel();
+
         if (hiddenPanels.indexOf("storage") === -1 && hiddenPanels.indexOf("databases") === -1)
-            this.panels.storage = new WebInspector.StoragePanel();      
+            this.panels.storage = new WebInspector.StoragePanel();
     },
 
     _loadPreferences: function()

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list