[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

pfeldman at chromium.org pfeldman at chromium.org
Thu Apr 8 00:49:07 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 2bdf3c5800f32d25fba0548aad10a05f0b052688
Author: pfeldman at chromium.org <pfeldman at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Dec 25 14:58:54 2009 +0000

    2009-12-25  Alexander Pavlov  <apavlov at chromium.org>
    
            Reviewed by Pavel Feldman.
    
            AuditsPanel for Web Inspector (hidden, no preset audits).
    
            https://bugs.webkit.org/show_bug.cgi?id=31665
    
            * English.lproj/localizedStrings.js:
            * WebCore.gypi:
            * WebCore.vcproj/WebCore.vcproj:
            * inspector/front-end/AuditLauncherView.js: Added.
            (WebInspector.AuditLauncherView.categorySortFunction):
            (WebInspector.AuditLauncherView):
            (WebInspector.AuditLauncherView.prototype.updateResourceTrackingState):
            (WebInspector.AuditLauncherView.prototype._setAuditRunning):
            (WebInspector.AuditLauncherView.prototype._launchButtonClicked.profilingFinishedCallback):
            (WebInspector.AuditLauncherView.prototype._launchButtonClicked):
            (WebInspector.AuditLauncherView.prototype._selectAllClicked):
            (WebInspector.AuditLauncherView.prototype._categoryClicked):
            (WebInspector.AuditLauncherView.prototype._createCategoryElement):
            (WebInspector.AuditLauncherView.prototype._createLauncherUI):
            (WebInspector.AuditLauncherView.prototype._updateButton):
            (WebInspector.AuditLauncherView.prototype.resize):
            * inspector/front-end/AuditResultView.js: Added.
            (WebInspector.AuditResultView.entrySortFunction):
            (WebInspector.AuditResultView):
            (WebInspector.AuditCategoryResultPane):
            (WebInspector.AuditRuleResultPane):
            (WebInspector.AuditRuleResultPane.prototype._decorateRuleResult):
            (WebInspector.AuditRuleResultChildSection):
            (WebInspector.AuditRuleResultChildSection.prototype.set title):
            (WebInspector.AuditRuleResultChildSection.prototype.expand):
            * inspector/front-end/AuditsPanel.js: Added.
            (WebInspector.AuditsPanel):
            (WebInspector.AuditsPanel.prototype.toolbarItemClass.get toolbarItemLabel):
            (WebInspector.AuditsPanel.prototype.get statusBarItems):
            (WebInspector.AuditsPanel.prototype.get mainResourceLoadTime):
            (WebInspector.AuditsPanel.prototype.set mainResourceLoadTime):
            (WebInspector.AuditsPanel.prototype.get mainResourceDOMContentTime):
            (WebInspector.AuditsPanel.prototype.set mainResourceDOMContentTime):
            (WebInspector.AuditsPanel.prototype.get categoriesById):
            (WebInspector.AuditsPanel.prototype.get visibleView):
            (WebInspector.AuditsPanel.prototype._constructCategories):
            (WebInspector.AuditsPanel.prototype._executeAudit.ruleResultReadyCallback):
            (WebInspector.AuditsPanel.prototype._executeAudit):
            (WebInspector.AuditsPanel.prototype._auditFinishedCallback):
            (WebInspector.AuditsPanel.prototype.initiateAudit.initiateAuditCallback):
            (WebInspector.AuditsPanel.prototype.initiateAudit):
            (WebInspector.AuditsPanel.prototype._reloadResources):
            (WebInspector.AuditsPanel.prototype._didMainResourceLoad):
            (WebInspector.AuditsPanel.prototype.showResults):
            (WebInspector.AuditsPanel.prototype.showLauncherView):
            (WebInspector.AuditsPanel.prototype.showView):
            (WebInspector.AuditsPanel.prototype.show):
            (WebInspector.AuditsPanel.prototype.attach):
            (WebInspector.AuditsPanel.prototype.resize):
            (WebInspector.AuditsPanel.prototype.updateMainViewWidth):
            (WebInspector.AuditsPanel.prototype._updateLauncherViewControls):
            (WebInspector.AuditsPanel.prototype._clearButtonClicked):
            (WebInspector.AuditsPanel.prototype._closeVisibleView):
            (WebInspector.AuditCategory):
            (WebInspector.AuditCategory.prototype.get id):
            (WebInspector.AuditCategory.prototype.get displayName):
            (WebInspector.AuditCategory.prototype.get ruleCount):
            (WebInspector.AuditCategory.prototype.addRule):
            (WebInspector.AuditCategory.prototype.runRules):
            (WebInspector.AuditRule):
            (WebInspector.AuditRule.prototype.get id):
            (WebInspector.AuditRule.prototype.get displayName):
            (WebInspector.AuditRule.prototype.run):
            (WebInspector.AuditRule.prototype.doRun):
            (WebInspector.AuditRule.prototype.getValue):
            (WebInspector.AuditCategoryResult):
            (WebInspector.AuditCategoryResult.prototype.addEntry):
            (WebInspector.AuditRuleResult):
            (WebInspector.AuditRuleResult.prototype.appendChild):
            (WebInspector.AuditRuleResult.prototype.set type):
            (WebInspector.AuditRuleResult.prototype.get type):
            (WebInspector.AuditsSidebarTreeElement):
            (WebInspector.AuditsSidebarTreeElement.prototype.onattach):
            (WebInspector.AuditsSidebarTreeElement.prototype.onselect):
            (WebInspector.AuditsSidebarTreeElement.prototype.get selectable):
            (WebInspector.AuditsSidebarTreeElement.prototype.refresh):
            (WebInspector.AuditResultSidebarTreeElement):
            (WebInspector.AuditResultSidebarTreeElement.prototype.onselect):
            (WebInspector.AuditResultSidebarTreeElement.prototype.get selectable):
            * inspector/front-end/WebKit.qrc:
            * inspector/front-end/audits.css: Added.
            * inspector/front-end/inspector.html:
            * inspector/front-end/inspector.js:
            (WebInspector._createPanels):
            (WebInspector.updateResource):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52558 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index a326677..73cea42 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,97 @@
+2009-12-25  Alexander Pavlov  <apavlov at chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        AuditsPanel for Web Inspector (hidden, no preset audits).
+
+        https://bugs.webkit.org/show_bug.cgi?id=31665
+
+        * English.lproj/localizedStrings.js:
+        * WebCore.gypi:
+        * WebCore.vcproj/WebCore.vcproj:
+        * inspector/front-end/AuditLauncherView.js: Added.
+        (WebInspector.AuditLauncherView.categorySortFunction):
+        (WebInspector.AuditLauncherView):
+        (WebInspector.AuditLauncherView.prototype.updateResourceTrackingState):
+        (WebInspector.AuditLauncherView.prototype._setAuditRunning):
+        (WebInspector.AuditLauncherView.prototype._launchButtonClicked.profilingFinishedCallback):
+        (WebInspector.AuditLauncherView.prototype._launchButtonClicked):
+        (WebInspector.AuditLauncherView.prototype._selectAllClicked):
+        (WebInspector.AuditLauncherView.prototype._categoryClicked):
+        (WebInspector.AuditLauncherView.prototype._createCategoryElement):
+        (WebInspector.AuditLauncherView.prototype._createLauncherUI):
+        (WebInspector.AuditLauncherView.prototype._updateButton):
+        (WebInspector.AuditLauncherView.prototype.resize):
+        * inspector/front-end/AuditResultView.js: Added.
+        (WebInspector.AuditResultView.entrySortFunction):
+        (WebInspector.AuditResultView):
+        (WebInspector.AuditCategoryResultPane):
+        (WebInspector.AuditRuleResultPane):
+        (WebInspector.AuditRuleResultPane.prototype._decorateRuleResult):
+        (WebInspector.AuditRuleResultChildSection):
+        (WebInspector.AuditRuleResultChildSection.prototype.set title):
+        (WebInspector.AuditRuleResultChildSection.prototype.expand):
+        * inspector/front-end/AuditsPanel.js: Added.
+        (WebInspector.AuditsPanel):
+        (WebInspector.AuditsPanel.prototype.toolbarItemClass.get toolbarItemLabel):
+        (WebInspector.AuditsPanel.prototype.get statusBarItems):
+        (WebInspector.AuditsPanel.prototype.get mainResourceLoadTime):
+        (WebInspector.AuditsPanel.prototype.set mainResourceLoadTime):
+        (WebInspector.AuditsPanel.prototype.get mainResourceDOMContentTime):
+        (WebInspector.AuditsPanel.prototype.set mainResourceDOMContentTime):
+        (WebInspector.AuditsPanel.prototype.get categoriesById):
+        (WebInspector.AuditsPanel.prototype.get visibleView):
+        (WebInspector.AuditsPanel.prototype._constructCategories):
+        (WebInspector.AuditsPanel.prototype._executeAudit.ruleResultReadyCallback):
+        (WebInspector.AuditsPanel.prototype._executeAudit):
+        (WebInspector.AuditsPanel.prototype._auditFinishedCallback):
+        (WebInspector.AuditsPanel.prototype.initiateAudit.initiateAuditCallback):
+        (WebInspector.AuditsPanel.prototype.initiateAudit):
+        (WebInspector.AuditsPanel.prototype._reloadResources):
+        (WebInspector.AuditsPanel.prototype._didMainResourceLoad):
+        (WebInspector.AuditsPanel.prototype.showResults):
+        (WebInspector.AuditsPanel.prototype.showLauncherView):
+        (WebInspector.AuditsPanel.prototype.showView):
+        (WebInspector.AuditsPanel.prototype.show):
+        (WebInspector.AuditsPanel.prototype.attach):
+        (WebInspector.AuditsPanel.prototype.resize):
+        (WebInspector.AuditsPanel.prototype.updateMainViewWidth):
+        (WebInspector.AuditsPanel.prototype._updateLauncherViewControls):
+        (WebInspector.AuditsPanel.prototype._clearButtonClicked):
+        (WebInspector.AuditsPanel.prototype._closeVisibleView):
+        (WebInspector.AuditCategory):
+        (WebInspector.AuditCategory.prototype.get id):
+        (WebInspector.AuditCategory.prototype.get displayName):
+        (WebInspector.AuditCategory.prototype.get ruleCount):
+        (WebInspector.AuditCategory.prototype.addRule):
+        (WebInspector.AuditCategory.prototype.runRules):
+        (WebInspector.AuditRule):
+        (WebInspector.AuditRule.prototype.get id):
+        (WebInspector.AuditRule.prototype.get displayName):
+        (WebInspector.AuditRule.prototype.run):
+        (WebInspector.AuditRule.prototype.doRun):
+        (WebInspector.AuditRule.prototype.getValue):
+        (WebInspector.AuditCategoryResult):
+        (WebInspector.AuditCategoryResult.prototype.addEntry):
+        (WebInspector.AuditRuleResult):
+        (WebInspector.AuditRuleResult.prototype.appendChild):
+        (WebInspector.AuditRuleResult.prototype.set type):
+        (WebInspector.AuditRuleResult.prototype.get type):
+        (WebInspector.AuditsSidebarTreeElement):
+        (WebInspector.AuditsSidebarTreeElement.prototype.onattach):
+        (WebInspector.AuditsSidebarTreeElement.prototype.onselect):
+        (WebInspector.AuditsSidebarTreeElement.prototype.get selectable):
+        (WebInspector.AuditsSidebarTreeElement.prototype.refresh):
+        (WebInspector.AuditResultSidebarTreeElement):
+        (WebInspector.AuditResultSidebarTreeElement.prototype.onselect):
+        (WebInspector.AuditResultSidebarTreeElement.prototype.get selectable):
+        * inspector/front-end/WebKit.qrc:
+        * inspector/front-end/audits.css: Added.
+        * inspector/front-end/inspector.html:
+        * inspector/front-end/inspector.js:
+        (WebInspector._createPanels):
+        (WebInspector.updateResource):
+
 2009-12-25  Pavel Feldman  <pfeldman at chromium.org>
 
         Reviewed by Timothy Hatcher.
diff --git a/WebCore/English.lproj/localizedStrings.js b/WebCore/English.lproj/localizedStrings.js
index 6b84021..e75eb66 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 668f823..83d9449 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -3646,6 +3646,9 @@
 
             'inspector/front-end/inspector.html',
             'inspector/front-end/AbstractTimelinePanel.js',
+            'inspector/front-end/AuditLauncherView.js',
+            'inspector/front-end/AuditResultView.js',
+            'inspector/front-end/AuditsPanel.js',
             'inspector/front-end/BottomUpProfileDataGridTree.js',
             'inspector/front-end/Breakpoint.js',
             'inspector/front-end/BreakpointsSidebarPane.js',
@@ -3721,6 +3724,7 @@
             'inspector/front-end/utilities.js',
             'inspector/front-end/View.js',
             'inspector/front-end/WatchExpressionsSidebarPane.js',
+            'inspector/front-end/audits.css',
             'inspector/front-end/inspector.css',
             'inspector/front-end/inspectorSyntaxHighlight.css',
         ],
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index 57e3dac..9df9a45 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -42708,6 +42708,22 @@
 					>
 				</File>
 				<File
+					RelativePath="..\inspector\front-end\AuditLauncherView.js"
+					>
+				</File>
+				<File
+					RelativePath="..\inspector\front-end\AuditResultView.js"
+					>
+				</File>
+				<File
+					RelativePath="..\inspector\front-end\audits.css"
+					>
+				</File>
+				<File
+					RelativePath="..\inspector\front-end\AuditsPanel.js"
+					>
+				</File>
+				<File
 					RelativePath="..\inspector\front-end\BottomUpProfileDataGridTree.js"
 					>
 				</File>
diff --git a/WebCore/inspector/front-end/AuditLauncherView.js b/WebCore/inspector/front-end/AuditLauncherView.js
new file mode 100644
index 0000000..2fee1d8
--- /dev/null
+++ b/WebCore/inspector/front-end/AuditLauncherView.js
@@ -0,0 +1,215 @@
+/*
+ * 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.AuditLauncherView = function(categoriesById, runnerCallback)
+{
+    WebInspector.View.call(this);
+    this._categoriesById = categoriesById;
+    this._runnerCallback = runnerCallback;
+    this._categoryIdPrefix = "audit-category-item-";
+    this._auditRunning = false;
+
+    this.element.addStyleClass("audit-launcher-view");
+
+    this._contentElement = document.createElement("div");
+    this._contentElement.className = "audit-launcher-view-content";
+    this.element.appendChild(this._contentElement);
+
+    function categorySortFunction(a, b)
+    {
+        var aTitle = a.displayName || "";
+        var bTitle = b.displayName || "";
+        return aTitle.localeCompare(bTitle);
+    }
+    var sortedCategories = [];
+    for (var id in this._categoriesById)
+        sortedCategories.push(this._categoriesById[id]);
+    sortedCategories.sort(categorySortFunction);
+
+    if (!sortedCategories.length) {
+        this._headerElement = document.createElement("h1");
+        this._headerElement.className = "no-audits";
+        this._headerElement.textContent = WebInspector.UIString("No audits to run");
+        this._contentElement.appendChild(this._headerElement);
+    } else
+        this._createLauncherUI(sortedCategories);
+}
+
+WebInspector.AuditLauncherView.prototype = {
+    updateResourceTrackingState: function()
+    {
+        if (!this._auditPresentStateLabelElement)
+            return;
+        if (InspectorBackend.resourceTrackingEnabled()) {
+            this._auditPresentStateLabelElement.nodeValue = WebInspector.UIString("Audit Present State");
+            this._auditPresentStateElement.disabled = false;
+            this._auditPresentStateElement.parentElement.removeStyleClass("disabled");
+        } else {
+            this._auditPresentStateLabelElement.nodeValue = WebInspector.UIString("Audit Present State (Resource Tracking must be enabled)");
+            this._auditPresentStateElement.disabled = true;
+            this._auditPresentStateElement.parentElement.addStyleClass("disabled");
+            this.auditReloadedStateElement.checked = true;
+        }
+    },
+
+    _setAuditRunning: function(auditRunning)
+    {
+        if (this._auditRunning === auditRunning)
+            return;
+        this._auditRunning = auditRunning;
+        this._updateButton();
+    },
+
+    _launchButtonClicked: function(event)
+    {
+        var catIds = [];
+        var childNodes = this._categoriesElement.childNodes;
+        for (var id in this._categoriesById) {
+            if (this._categoriesById[id]._checkboxElement.checked)
+                catIds.push(id);
+        }
+        function profilingFinishedCallback()
+        {
+            this._setAuditRunning(false);
+        }
+        this._setAuditRunning(true);
+        this._runnerCallback(catIds, this._auditPresentStateElement.checked, profilingFinishedCallback.bind(this));
+    },
+
+    _selectAllClicked: function(event)
+    {
+        var shouldCheckCategoriesOn = event.target.checked;
+        var childNodes = this._categoriesElement.childNodes;
+        for (var i = 0, length = childNodes.length; i < length; ++i)
+            childNodes[i].firstChild.checked = shouldCheckCategoriesOn;
+        this._currentCategoriesCount = shouldCheckCategoriesOn ? this._totalCategoriesCount : 0;
+        this._updateButton();
+    },
+
+    _categoryClicked: function(event)
+    {
+        this._currentCategoriesCount += event.target.checked ? 1 : -1;
+        this._selectAllCheckboxElement.checked = this._currentCategoriesCount === this._totalCategoriesCount;
+        this._updateButton();
+    },
+
+    _createCategoryElement: function(title, id)
+    {
+        var element;
+        var labelElement = document.createElement("label");
+        labelElement.id = this._categoryIdPrefix + id;
+
+        element = document.createElement("input");
+        element.type = "checkbox";
+        labelElement.appendChild(element);
+
+        labelElement.appendChild(document.createTextNode(title));
+
+        return labelElement;
+    },
+
+    _createLauncherUI: function(sortedCategories)
+    {
+        this._headerElement = document.createElement("h1");
+        this._headerElement.textContent = WebInspector.UIString("Select audits to run");
+        this._contentElement.appendChild(this._headerElement);
+
+        var categoryElement = this._createCategoryElement(WebInspector.UIString("Select All"), "");
+        categoryElement.id = "audit-launcher-selectall";
+        this._selectAllCheckboxElement = categoryElement.firstChild;
+        this._selectAllCheckboxElement.addEventListener("click", this._selectAllClicked.bind(this), false);
+        this._contentElement.appendChild(categoryElement);
+
+        this._categoriesElement = document.createElement("div");
+        this._categoriesElement.className = "audit-categories-container";
+        this._contentElement.appendChild(this._categoriesElement);
+
+        var boundCategoryClickListener = this._categoryClicked.bind(this);
+
+        for (var i = 0; i < sortedCategories.length; ++i) {
+            categoryElement = this._createCategoryElement(sortedCategories[i].displayName, sortedCategories[i].id);
+            categoryElement.firstChild.addEventListener("click", boundCategoryClickListener, false);
+            sortedCategories[i]._checkboxElement = categoryElement.firstChild;
+            this._categoriesElement.appendChild(categoryElement);
+        }
+
+        this._totalCategoriesCount = this._categoriesElement.childNodes.length;
+        this._currentCategoriesCount = 0;
+
+        this._buttonContainerElement = document.createElement("div");
+        this._buttonContainerElement.className = "button-container";
+
+        var labelElement = document.createElement("label");
+        this._auditPresentStateElement = document.createElement("input");
+        this._auditPresentStateElement.name = "audit-mode";
+        this._auditPresentStateElement.type = "radio";
+        this._auditPresentStateElement.checked = true;
+        this._auditPresentStateLabelElement = document.createTextNode("");
+        labelElement.appendChild(this._auditPresentStateElement);
+        labelElement.appendChild(this._auditPresentStateLabelElement);
+        this._buttonContainerElement.appendChild(labelElement);
+
+        labelElement = document.createElement("label");
+        this.auditReloadedStateElement = document.createElement("input");
+        this.auditReloadedStateElement.name = "audit-mode";
+        this.auditReloadedStateElement.type = "radio";
+        labelElement.appendChild(this.auditReloadedStateElement);
+        labelElement.appendChild(document.createTextNode("Reload Page and Audit on Load"));
+        this._buttonContainerElement.appendChild(labelElement);
+
+        this._launchButton = document.createElement("button");
+        this._launchButton.setAttribute("type", "button");
+        this._launchButton.addEventListener("click", this._launchButtonClicked.bind(this), false);
+        this._buttonContainerElement.appendChild(this._launchButton);
+
+        this._contentElement.appendChild(this._buttonContainerElement);
+
+        this.updateResourceTrackingState();
+        this._updateButton();
+        this.resize();
+    },
+
+    _updateButton: function()
+    {
+        this._launchButton.disabled = !this._currentCategoriesCount || this._auditRunning;
+        if (this._auditRunning)
+            this._launchButton.textContent = WebInspector.UIString("Running...");
+        else
+            this._launchButton.textContent = WebInspector.UIString("Run");
+    },
+
+    resize: function()
+    {
+        if (this._categoriesElement)
+            this._categoriesElement.style.height = (this._buttonContainerElement.totalOffsetTop - this._categoriesElement.totalOffsetTop) + "px";
+    }
+}
+
+WebInspector.AuditLauncherView.prototype.__proto__ = WebInspector.View.prototype;
diff --git a/WebCore/inspector/front-end/AuditResultView.js b/WebCore/inspector/front-end/AuditResultView.js
new file mode 100644
index 0000000..b2a0f1a
--- /dev/null
+++ b/WebCore/inspector/front-end/AuditResultView.js
@@ -0,0 +1,143 @@
+/*
+ * 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.AuditResultView = function(categoryResults)
+{
+    WebInspector.View.call(this);
+
+    this.element.addStyleClass("audit-result-view");
+
+    this.resultBarElement = document.createElement("div");
+    this.resultBarElement.id = "audit-resultbar";
+    this.element.appendChild(this.resultBarElement);
+
+    function entrySortFunction(a, b)
+    {
+        var result = b.type - a.type;
+        if (!result)
+            result = (a.value || "").localeCompare(b.value || "");
+        return result;
+    }
+
+    for (var i = 0; i < categoryResults.length; ++i) {
+        var entries = categoryResults[i].entries;
+        if (entries) {
+            entries.sort(entrySortFunction);
+            this.resultBarElement.appendChild(new WebInspector.AuditCategoryResultPane(categoryResults[i]).element);
+        }
+    }
+}
+
+WebInspector.AuditResultView.prototype.__proto__ = WebInspector.View.prototype;
+
+
+WebInspector.AuditCategoryResultPane = function(categoryResult)
+{
+    WebInspector.SidebarPane.call(this, categoryResult.title);
+    this.expand();
+    for (var i = 0; i < categoryResult.entries.length; ++i)
+        this.bodyElement.appendChild(new WebInspector.AuditRuleResultPane(categoryResult.entries[i]).element);
+}
+
+WebInspector.AuditCategoryResultPane.prototype.__proto__ = WebInspector.SidebarPane.prototype;
+
+
+WebInspector.AuditRuleResultPane = function(ruleResult)
+{
+    WebInspector.SidebarPane.call(this, ruleResult.value);
+    if (!ruleResult.children)
+        return;
+
+    this._decorateRuleResult(ruleResult);
+
+    for (var i = 0; i < ruleResult.children.length; ++i) {
+        var section = new WebInspector.AuditRuleResultChildSection(ruleResult.children[i]);
+        section.expand();
+        this.bodyElement.appendChild(section.element);
+    }
+}
+
+WebInspector.AuditRuleResultPane.prototype = {
+    _decorateRuleResult: function(ruleResult)
+    {
+        if (ruleResult.type == WebInspector.AuditRuleResult.Type.NA)
+            return;
+
+        var scoreElement = document.createElement("img");
+        scoreElement.className = "score";
+        var className = (ruleResult.type == WebInspector.AuditRuleResult.Type.Violation) ? "red" : "green";
+        scoreElement.addStyleClass(className);
+        this.element.insertBefore(scoreElement, this.element.firstChild);
+    }
+}
+
+WebInspector.AuditRuleResultPane.prototype.__proto__ = WebInspector.SidebarPane.prototype;
+
+
+WebInspector.AuditRuleResultChildSection = function(entry)
+{
+    WebInspector.Section.call(this, entry.value);
+    var children = entry.children;
+    this._hasChildren = !!children && children.length;
+    if (!this._hasChildren)
+        this.element.addStyleClass("blank-section");
+    else {
+        this.contentElement = document.createElement("div");
+        this.contentElement.addStyleClass("section-content");
+        for (var i = 0; i < children.length; ++i) {
+            var paraElement = document.createElement("p");
+            paraElement.innerHTML = children[i].value;
+            this.contentElement.appendChild(paraElement);
+        }
+        this.contentElement.appendChild(paraElement);
+        this.element.appendChild(this.contentElement);
+    }
+}
+
+WebInspector.AuditRuleResultChildSection.prototype = {
+
+    // title is considered pure HTML
+    set title(x)
+    {
+        if (this._title === x)
+            return;
+        this._title = x;
+
+        this.titleElement.innerHTML = x;
+    },
+
+    expand: function()
+    {
+        if (this._hasChildren)
+            WebInspector.Section.prototype.expand.call(this);
+    }
+}
+
+WebInspector.AuditRuleResultChildSection.prototype.__proto__ = WebInspector.Section.prototype;
diff --git a/WebCore/inspector/front-end/AuditsPanel.js b/WebCore/inspector/front-end/AuditsPanel.js
new file mode 100644
index 0000000..99784a1
--- /dev/null
+++ b/WebCore/inspector/front-end/AuditsPanel.js
@@ -0,0 +1,473 @@
+/*
+ * 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.AuditsPanel = function()
+{
+    WebInspector.Panel.call(this);
+
+    this._constructCategories();
+
+    this.createSidebar();
+    this.auditsTreeElement = new WebInspector.SidebarSectionTreeElement("", {}, true);
+    this.sidebarTree.appendChild(this.auditsTreeElement);
+    this.auditsTreeElement.expand();
+
+    this.auditsItemTreeElement = new WebInspector.AuditsSidebarTreeElement();
+    this.auditsTreeElement.appendChild(this.auditsItemTreeElement);
+
+    this.auditResultsTreeElement = new WebInspector.SidebarSectionTreeElement(WebInspector.UIString("RESULTS"), {}, true);
+    this.sidebarTree.appendChild(this.auditResultsTreeElement);
+    this.auditResultsTreeElement.expand();
+
+    this.element.addStyleClass("audits");
+
+    this.clearResultsButton = new WebInspector.StatusBarButton(WebInspector.UIString("Clear audit results."), "clear-audit-results-status-bar-item");
+    this.clearResultsButton.addEventListener("click", this._clearButtonClicked.bind(this), false);
+
+    this.viewsContainerElement = document.createElement("div");
+    this.viewsContainerElement.id = "audit-views";
+    this.element.appendChild(this.viewsContainerElement);
+}
+
+WebInspector.AuditsPanel.prototype = {
+    toolbarItemClass: "audits",
+
+    get toolbarItemLabel()
+    {
+        return WebInspector.UIString("Audits");
+    },
+
+    get statusBarItems()
+    {
+        return [this.clearResultsButton.element];
+    },
+
+    get mainResourceLoadTime()
+    {
+        return this._mainResourceLoadTime;
+    },
+
+    set mainResourceLoadTime(x)
+    {
+        this._mainResourceLoadTime = x;
+        this._didMainResourceLoad();
+    },
+
+    get mainResourceDOMContentTime()
+    {
+        return this._mainResourceDOMContentTime;
+    },
+
+    set mainResourceDOMContentTime(x)
+    {
+        this._mainResourceDOMContentTime = x;
+    },
+
+    get categoriesById()
+    {
+        return this._auditCategoriesById;
+    },
+
+    get visibleView()
+    {
+        return this._visibleView;
+    },
+
+    _constructCategories: function()
+    {
+        this._auditCategoriesById = {};
+        for (var categoryCtorID in WebInspector.AuditCategories) {
+            var auditCategory = new WebInspector.AuditCategories[categoryCtorID]();
+            this.categoriesById[auditCategory.id] = auditCategory;
+        }
+    },
+
+    _executeAudit: function(categories, resultCallback)
+    {
+        var resources = [];
+        for (var id in WebInspector.resources)
+            resources.push(WebInspector.resources[id]);
+
+        var rulesRemaining = 0;
+        for (var i = 0; i < categories.length; ++i)
+            rulesRemaining += categories[i].ruleCount;
+
+        var results = [];
+        var mainResourceURL = WebInspector.mainResource.url;
+
+        function ruleResultReadyCallback(categoryResult, ruleResult)
+        {
+            if (ruleResult.children)
+                categoryResult.entries.push(ruleResult);
+
+            --rulesRemaining;
+
+            if (!rulesRemaining && resultCallback)
+                resultCallback(mainResourceURL, results);
+        }
+
+        if (!rulesRemaining) {
+            resultCallback(mainResourceURL, results);
+            return;
+        }
+
+        for (var i = 0; i < categories.length; ++i) {
+            var category = categories[i];
+            var result = new WebInspector.AuditCategoryResult(category);
+            results.push(result);
+            category.runRules(resources, ruleResultReadyCallback.bind(null, result));
+        }
+    },
+
+    _auditFinishedCallback: function(launcherCallback, mainResourceURL, results)
+    {
+        var children = this.auditResultsTreeElement.children;
+        var ordinal = 1;
+        for (var i = 0; i < children.length; ++i) {
+            if (children[i].mainResourceURL === mainResourceURL)
+                ordinal++;
+        }
+
+        var resultTreeElement = new WebInspector.AuditResultSidebarTreeElement(results, mainResourceURL, ordinal);
+        this.auditResultsTreeElement.appendChild(resultTreeElement);
+        resultTreeElement.reveal();
+        resultTreeElement.select();
+        if (launcherCallback)
+            launcherCallback();
+    },
+
+    initiateAudit: function(categoryIds, runImmediately, launcherCallback)
+    {
+        if (!categoryIds || !categoryIds.length)
+            return;
+
+        var categories = [];
+        for (var i = 0; i < categoryIds.length; ++i)
+            categories.push(this.categoriesById[categoryIds[i]]);
+
+        function initiateAuditCallback(categories, launcherCallback)
+        {
+            this._executeAudit(categories, this._auditFinishedCallback.bind(this, launcherCallback));
+        }
+
+        if (runImmediately)
+            initiateAuditCallback.call(this, categories, launcherCallback);
+        else
+            this._reloadResources(initiateAuditCallback.bind(this, categories, launcherCallback));
+    },
+
+    _reloadResources: function(callback)
+    {
+        function nullCallback()
+        {
+        }
+        this._resourceTrackingCallback = callback;
+        if (!InspectorBackend.resourceTrackingEnabled()) {
+            InspectorBackend.enableResourceTracking(false);
+            this._updateLauncherViewControls();
+        } else
+            InjectedScriptAccess.evaluate("window.location.reload()", nullCallback);
+    },
+
+    _didMainResourceLoad: function()
+    {
+        if (this._resourceTrackingCallback) {
+            var callback = this._resourceTrackingCallback;
+            this._resourceTrackingCallback = null;
+            callback();
+        }
+    },
+
+    showResults: function(categoryResults)
+    {
+        if (!categoryResults._resultView)
+            categoryResults._resultView = new WebInspector.AuditResultView(categoryResults);
+
+        this.showView(categoryResults._resultView);
+    },
+
+    showLauncherView: function()
+    {
+        if (!this._launcherView)
+            this._launcherView = new WebInspector.AuditLauncherView(this.categoriesById, this.initiateAudit.bind(this));
+
+        this.showView(this._launcherView);
+    },
+
+    showView: function(view)
+    {
+        if (view) {
+            if (this._visibleView === view)
+                return;
+            this._closeVisibleView();
+            this._visibleView = view;
+        }
+        var visibleView = this.visibleView;
+        if (visibleView)
+            visibleView.show(this.viewsContainerElement);
+    },
+
+    show: function()
+    {
+        WebInspector.Panel.prototype.show.call(this);
+
+        this.showView();
+        this._updateLauncherViewControls();
+    },
+
+    attach: function()
+    {
+        WebInspector.Panel.prototype.attach.call(this);
+
+        this.auditsItemTreeElement.select();
+    },
+
+    resize: function()
+    {
+        var visibleView = this.visibleView;
+        if (visibleView && "resize" in visibleView)
+            visibleView.resize();
+    },
+
+    updateMainViewWidth: function(width)
+    {
+        this.viewsContainerElement.style.left = width + "px";
+    },
+
+    _updateLauncherViewControls: function()
+    {
+        if (this._launcherView)
+            this._launcherView.updateResourceTrackingState();
+    },
+
+    _clearButtonClicked: function()
+    {
+        this.auditsItemTreeElement.reveal();
+        this.auditsItemTreeElement.select();
+        this.auditResultsTreeElement.removeChildren();
+    },
+
+    _closeVisibleView: function()
+    {
+        if (this.visibleView)
+            this.visibleView.hide();
+    }
+}
+
+WebInspector.AuditsPanel.prototype.__proto__ = WebInspector.Panel.prototype;
+
+
+
+WebInspector.AuditCategory = function(id, displayName)
+{
+    this._id = id;
+    this._displayName = displayName;
+    this._rules = [];
+}
+
+WebInspector.AuditCategory.prototype = {
+    get id()
+    {
+        return this._id;
+    },
+
+    get displayName()
+    {
+        return this._displayName;
+    },
+
+    get ruleCount()
+    {
+        return this._rules.length;
+    },
+
+    addRule: function(rule)
+    {
+        this._rules.push(rule);
+    },
+
+    runRules: function(resources, callback)
+    {
+        for (var i = 0; i < this._rules.length; ++i)
+            this._rules[i].run(resources, callback);
+    }
+}
+
+
+WebInspector.AuditRule = function(id, displayName, parametersObject)
+{
+    this._id = id;
+    this._displayName = displayName;
+    this._parametersObject = parametersObject;
+}
+
+WebInspector.AuditRule.prototype = {
+    get id()
+    {
+        return this._id;
+    },
+
+    get displayName()
+    {
+        return this._displayName;
+    },
+
+    run: function(resources, callback)
+    {
+        this.doRun(resources, new WebInspector.AuditRuleResult(this.displayName), callback);
+    },
+
+    doRun: function(resources, result, callback)
+    {
+        throw new Error("doRun() not implemented");
+    },
+
+    getValue: function(key)
+    {
+        if (key in this._parametersObject)
+            return this._parametersObject[key];
+        else
+            throw new Error(key + " not found in rule parameters");
+    }
+}
+
+
+WebInspector.AuditCategoryResult = function(category)
+{
+    this.categoryId = category.id;
+    this.title = category.displayName;
+    this.entries = [];
+}
+
+WebInspector.AuditCategoryResult.prototype = {
+    addEntry: function(value)
+    {
+        var entry = new WebInspector.AuditRuleResult(value);
+        this.entries.push(entry);
+        return entry;
+    }
+}
+
+/**
+ * @param {string} value The result message HTML contents.
+ */
+WebInspector.AuditRuleResult = function(value)
+{
+    this.value = value;
+    this.type = WebInspector.AuditRuleResult.Type.NA;
+}
+
+WebInspector.AuditRuleResult.Type = {
+    NA: 0,
+    Hint: 1,
+    Violation: 2
+}
+
+WebInspector.AuditRuleResult.prototype = {
+    appendChild: function(value)
+    {
+        if (!this.children)
+            this.children = [];
+        var entry = new WebInspector.AuditRuleResult(value);
+        this.children.push(entry);
+        return entry;
+    },
+
+    set type(x)
+    {
+        this._type = x;
+    },
+
+    get type()
+    {
+        return this._type;
+    }
+}
+
+
+WebInspector.AuditsSidebarTreeElement = function()
+{
+    this.small = false;
+
+    WebInspector.SidebarTreeElement.call(this, "audits-sidebar-tree-item", WebInspector.UIString("Audits"), "", null, false);
+}
+
+WebInspector.AuditsSidebarTreeElement.prototype = {
+    onattach: function()
+    {
+        WebInspector.SidebarTreeElement.prototype.onattach.call(this);
+    },
+
+    onselect: function()
+    {
+        WebInspector.panels.audits.showLauncherView();
+    },
+
+    get selectable()
+    {
+        return true;
+    },
+
+    refresh: function()
+    {
+        this.refreshTitles();
+    }
+}
+
+WebInspector.AuditsSidebarTreeElement.prototype.__proto__ = WebInspector.SidebarTreeElement.prototype;
+
+
+WebInspector.AuditResultSidebarTreeElement = function(results, mainResourceURL, ordinal)
+{
+    this.results = results;
+    this.mainResourceURL = mainResourceURL;
+
+    WebInspector.SidebarTreeElement.call(this, "audit-result-sidebar-tree-item", String.sprintf("%s (%d)", mainResourceURL, ordinal), "", {}, false);
+}
+
+WebInspector.AuditResultSidebarTreeElement.prototype = {
+    onselect: function()
+    {
+        WebInspector.panels.audits.showResults(this.results);
+    },
+
+    get selectable()
+    {
+        return true;
+    }
+}
+
+WebInspector.AuditResultSidebarTreeElement.prototype.__proto__ = WebInspector.SidebarTreeElement.prototype;
+
+// Contributed audit rules should go into this namespace.
+WebInspector.AuditRules = {};
+
+// Contributed audit categories should go into this namespace.
+WebInspector.AuditCategories = {};
diff --git a/WebCore/inspector/front-end/WebKit.qrc b/WebCore/inspector/front-end/WebKit.qrc
index 5885eba..4a21e2c 100644
--- a/WebCore/inspector/front-end/WebKit.qrc
+++ b/WebCore/inspector/front-end/WebKit.qrc
@@ -2,6 +2,9 @@
 <qresource prefix="/webkit/inspector">
     <file>inspector.html</file>
     <file>AbstractTimelinePanel.js</file>
+    <file>AuditLauncherView.js</file>
+    <file>AuditResultView.js</file>
+    <file>AuditsPanel.js</file>
     <file>BottomUpProfileDataGridTree.js</file>
     <file>Breakpoint.js</file>
     <file>BreakpointsSidebarPane.js</file>
@@ -77,6 +80,7 @@
     <file>utilities.js</file>
     <file>View.js</file>
     <file>WatchExpressionsSidebarPane.js</file>
+    <file>audits.css</file>
     <file>inspector.css</file>
     <file>inspectorSyntaxHighlight.css</file>
     <file>Images/back.png</file>
diff --git a/WebCore/inspector/front-end/audits.css b/WebCore/inspector/front-end/audits.css
new file mode 100644
index 0000000..1bcd808
--- /dev/null
+++ b/WebCore/inspector/front-end/audits.css
@@ -0,0 +1,277 @@
+/*
+ * Copyright (C) 2008 Apple Inc.  All rights reserved.
+ * 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.
+ */
+
+.audits-sidebar-tree-item .icon {
+    content: url(Images/resourcesTimeGraphIcon.png);
+}
+
+.audit-result-sidebar-tree-item .icon {
+    content: url(Images/resourceDocumentIcon.png);
+}
+
+#audit-views {
+    position: absolute;
+    top: 0;
+    right: 0;
+    left: 200px;
+    bottom: 0;
+    overflow: auto;
+}
+
+button.clear-audit-results-status-bar-item .glyph {
+    -webkit-mask-image: url(Images/clearConsoleButtonGlyph.png);
+}
+
+.audit-result-view {
+    display: none;
+    overflow: auto;
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+}
+
+.audit-result-view.visible {
+    display: block;
+}
+
+#audit-resultbar {
+    position: absolute;
+    top: 0;
+    right: 0;
+    bottom: 0;
+    width: 100%;
+    background-color: rgb(245, 245, 245);
+    border-left: 1px solid rgb(64%, 64%, 64%);
+    cursor: default;
+    overflow: auto;
+}
+
+#audit-resultbar > .pane img.score {
+    float: left;
+    margin-top: 2px;
+    position: relative;
+    height: 16px;
+    width: 16px;
+    z-index: 100;
+}
+
+#audit-resultbar > .pane img.score.red {
+    content: url(Images/errorRedDot.png);
+}
+
+#audit-resultbar > .pane img.score.green {
+    content: url(Images/successGreenDot.png);
+}
+
+#audit-resultbar > .pane > .body > .pane:nth-of-type(2n) {
+    background-color: rgba(0, 0, 0, 0.05);
+}
+
+#audit-resultbar > .pane > .body > .pane > .title {
+    padding-left: 16px;
+    background-image: none;
+    border-bottom: none;
+}
+
+#audit-resultbar > .pane > .body > .pane > .body {
+    background-color: transparent;
+}
+
+#audit-resultbar > .pane > .body > .pane .section {
+    margin-left: 16px;
+}
+
+#audit-resultbar .section .header {
+    border: 0;
+    background-image: none;
+    background-color: transparent;
+}
+
+#audit-resultbar .section .header > .title {
+    color: rgb(0, 0, 0);
+}
+
+#audit-resultbar .section .section-content {
+    width: 100%;
+    padding-left: 18px;
+    display: none;
+}
+
+#audit-resultbar .section.expanded .section-content {
+    display: block;
+}
+
+#audit-resultbar .section.expanded .section-content > p:nth-of-type(1) {
+    margin-top: 0;
+}
+
+#audit-resultbar .section.expanded .section-content > p:nth-of-type(1) > *:nth-child(1) {
+    margin-top: 0;
+}
+
+#audit-resultbar .section .header::before {
+    content: url(Images/treeRightTriangleBlack.png);
+}
+
+#audit-resultbar .section.expanded .header::before {
+    content: url(Images/treeDownTriangleBlack.png);
+}
+
+div.panel.audits .sidebar > ol.sidebar-tree > li:nth-child(1) {
+    height: 0px;
+    padding-top: 0;
+    padding-bottom: 0;
+}
+
+.audit-launcher-view {
+    z-index: 1000;
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+    background-color: white;
+    font-size: 13px;
+    overflow-x: hidden;
+    overflow-y: overlay;
+    display: none;
+}
+
+.audit-launcher-view.visible {
+    display: block;
+}
+
+.audit-launcher-view .audit-launcher-view-content {
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+    padding: 0 0 0 16px;
+    white-space: nowrap;
+}
+
+.audit-launcher-view h1 {
+    color: rgb(110, 116, 128);
+    font-size: 16px;
+    line-height: 20px;
+    font-weight: normal;
+    padding-top: 15px;
+}
+
+.audit-launcher-view h1.no-audits {
+    text-align: center;
+    font-style: italic;
+    position: relative;
+    left: -8px;
+}
+
+.audit-launcher-view div.button-container {
+    position: absolute;
+    width: 100%;
+    bottom: 16px;
+    padding-top: 16px;
+}
+
+.audit-launcher-view div.audit-categories-container {
+    position: relative;
+    top: 11px;
+    left: 0;
+    width: 100%;
+    overflow-y: auto;
+}
+
+.audit-launcher-view button {
+    color: rgb(6, 6, 6);
+    background-color: transparent;
+    border: 1px solid rgb(165, 165, 165);
+    background-color: rgb(237, 237, 237);
+    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(252, 252, 252)), to(rgb(223, 223, 223)));
+    -webkit-border-radius: 12px;
+    -webkit-appearance: none;
+}
+
+.audit-launcher-view button {
+    font-size: 13px;
+    padding: 3px 20px;
+    height: 24px;
+    margin: 0 5px 0 0;
+}
+
+.audit-launcher-view button:active {
+    background-color: rgb(215, 215, 215);
+    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(194, 194, 194)), to(rgb(239, 239, 239)));
+}
+
+body.inactive .audit-launcher-view button, .audit-launcher-view button:disabled {
+    color: rgb(130, 130, 130);
+    border-color: rgb(212, 212, 212);
+    background-color: rgb(239, 239, 239);
+    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(250, 250, 250)), to(rgb(235, 235, 235)));
+}
+
+.audit-launcher-view label {
+    position: relative;
+    display: block;
+    text-align: left;
+    word-break: break-word;
+    padding: 0 0 5px 0;
+}
+
+.audit-launcher-view label.disabled {
+    color: rgb(130, 130, 130);
+}
+
+.audit-launcher-view input[type="checkbox"] {
+    margin-left: 0;
+}
+
+.audit-launcher-view input[type="radio"] {
+    height: 17px;
+    width: 17px;
+    border: 1px solid rgb(165, 165, 165);
+    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(252, 252, 252)), to(rgb(223, 223, 223)));
+    -webkit-border-radius: 8px;
+    -webkit-appearance: none;
+    vertical-align: middle;
+    margin: 0 5px 5px 0;
+}
+
+.audit-launcher-view input[type="radio"]:active {
+    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(194, 194, 194)), to(rgb(239, 239, 239)));
+}
+
+.audit-launcher-view input[type="radio"]:checked {
+    background: url(Images/radioDot.png) center no-repeat,
+                -webkit-gradient(linear, left top, left bottom, from(rgb(252, 252, 252)), to(rgb(223, 223, 223)));
+}
diff --git a/WebCore/inspector/front-end/inspector.html b/WebCore/inspector/front-end/inspector.html
index 3b5aa08..9f78c0f 100644
--- a/WebCore/inspector/front-end/inspector.html
+++ b/WebCore/inspector/front-end/inspector.html
@@ -29,6 +29,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 <html>
 <head>
     <meta http-equiv="content-type" content="text/html; charset=utf-8">
+    <link rel="stylesheet" type="text/css" href="audits.css">
     <link rel="stylesheet" type="text/css" href="inspector.css">
     <link rel="stylesheet" type="text/css" href="inspectorSyntaxHighlight.css">
     <script type="text/javascript" src="utilities.js"></script>
@@ -85,6 +86,9 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     <script type="text/javascript" src="StoragePanel.js"></script>
     <script type="text/javascript" src="ProfilesPanel.js"></script>
     <script type="text/javascript" src="ConsolePanel.js"></script>
+    <script type="text/javascript" src="AuditsPanel.js"></script>
+    <script type="text/javascript" src="AuditResultView.js"></script>
+    <script type="text/javascript" src="AuditLauncherView.js"></script>
     <script type="text/javascript" src="ResourceView.js"></script>
     <script type="text/javascript" src="SourceFrame.js"></script>
     <script type="text/javascript" src="SourceSyntaxHighlighter.js"></script>
diff --git a/WebCore/inspector/front-end/inspector.js b/WebCore/inspector/front-end/inspector.js
index 7deb1e2..47759ea 100644
--- a/WebCore/inspector/front-end/inspector.js
+++ b/WebCore/inspector/front-end/inspector.js
@@ -177,6 +177,11 @@ var WebInspector = {
 
         if (hiddenPanels.indexOf("storage") === -1 && hiddenPanels.indexOf("databases") === -1)
             this.panels.storage = new WebInspector.StoragePanel();
+
+        // FIXME: Uncomment when ready.
+        // if (hiddenPanels.indexOf("audits") === -1)
+        //    this.panels.audits = new WebInspector.AuditsPanel();
+
         if (hiddenPanels.indexOf("console") === -1)
             this.panels.console = new WebInspector.ConsolePanel();
     },
@@ -967,7 +972,7 @@ WebInspector.updateResource = function(identifier, payload)
     }
 
     if (payload.didRequestChange) {
-        resource.host = payload.domain;
+        resource.domain = payload.host;
         resource.path = payload.path;
         resource.lastPathComponent = payload.lastPathComponent;
         resource.requestHeaders = payload.requestHeaders;
@@ -1021,6 +1026,8 @@ WebInspector.updateResource = function(identifier, payload)
             // of the resources panel instead of the individual resource.
             if (this.panels.resources)
                 this.panels.resources.mainResourceLoadTime = payload.loadEventTime;
+            if (this.panels.audits)
+                this.panels.audits.mainResourceLoadTime = payload.loadEventTime;
         }
 
         if (payload.domContentEventTime) {
@@ -1028,6 +1035,8 @@ WebInspector.updateResource = function(identifier, payload)
             // the resources panel for the same reasons as above.
             if (this.panels.resources)
                 this.panels.resources.mainResourceDOMContentTime = payload.domContentEventTime;
+            if (this.panels.audits)
+                this.panels.audits.mainResourceDOMContentTime = payload.domContentEventTime;
         }
     }
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list