<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[52558] trunk/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/52558">52558</a></dd>
<dt>Author</dt> <dd>pfeldman@chromium.org</dd>
<dt>Date</dt> <dd>2009-12-25 06:58:54 -0800 (Fri, 25 Dec 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>2009-12-25  Alexander Pavlov  &lt;apavlov@chromium.org&gt;

        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):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkWebCoreChangeLog">trunk/WebCore/ChangeLog</a></li>
<li><a href="#trunkWebCoreEnglishlprojlocalizedStringsjs">trunk/WebCore/English.lproj/localizedStrings.js</a></li>
<li><a href="#trunkWebCoreWebCoregypi">trunk/WebCore/WebCore.gypi</a></li>
<li><a href="#trunkWebCoreWebCorevcprojWebCorevcproj">trunk/WebCore/WebCore.vcproj/WebCore.vcproj</a></li>
<li><a href="#trunkWebCoreinspectorfrontendWebKitqrc">trunk/WebCore/inspector/front-end/WebKit.qrc</a></li>
<li><a href="#trunkWebCoreinspectorfrontendinspectorhtml">trunk/WebCore/inspector/front-end/inspector.html</a></li>
<li><a href="#trunkWebCoreinspectorfrontendinspectorjs">trunk/WebCore/inspector/front-end/inspector.js</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkWebCoreinspectorfrontendAuditLauncherViewjs">trunk/WebCore/inspector/front-end/AuditLauncherView.js</a></li>
<li><a href="#trunkWebCoreinspectorfrontendAuditResultViewjs">trunk/WebCore/inspector/front-end/AuditResultView.js</a></li>
<li><a href="#trunkWebCoreinspectorfrontendAuditsPaneljs">trunk/WebCore/inspector/front-end/AuditsPanel.js</a></li>
<li><a href="#trunkWebCoreinspectorfrontendauditscss">trunk/WebCore/inspector/front-end/audits.css</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/ChangeLog (52557 => 52558)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/ChangeLog        2009-12-25 14:37:07 UTC (rev 52557)
+++ trunk/WebCore/ChangeLog        2009-12-25 14:58:54 UTC (rev 52558)
</span><span class="lines">@@ -1,3 +1,97 @@
</span><ins>+2009-12-25  Alexander Pavlov  &lt;apavlov@chromium.org&gt;
+
+        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):
+
</ins><span class="cx"> 2009-12-25  Pavel Feldman  &lt;pfeldman@chromium.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Timothy Hatcher.
</span></span></pre></div>
<a id="trunkWebCoreEnglishlprojlocalizedStringsjs"></a>
<div class="binary"><h4>Modified: trunk/WebCore/English.lproj/localizedStrings.js</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="trunkWebCoreWebCoregypi"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/WebCore.gypi (52557 => 52558)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/WebCore.gypi        2009-12-25 14:37:07 UTC (rev 52557)
+++ trunk/WebCore/WebCore.gypi        2009-12-25 14:58:54 UTC (rev 52558)
</span><span class="lines">@@ -3646,6 +3646,9 @@
</span><span class="cx"> 
</span><span class="cx">             'inspector/front-end/inspector.html',
</span><span class="cx">             'inspector/front-end/AbstractTimelinePanel.js',
</span><ins>+            'inspector/front-end/AuditLauncherView.js',
+            'inspector/front-end/AuditResultView.js',
+            'inspector/front-end/AuditsPanel.js',
</ins><span class="cx">             'inspector/front-end/BottomUpProfileDataGridTree.js',
</span><span class="cx">             'inspector/front-end/Breakpoint.js',
</span><span class="cx">             'inspector/front-end/BreakpointsSidebarPane.js',
</span><span class="lines">@@ -3721,6 +3724,7 @@
</span><span class="cx">             'inspector/front-end/utilities.js',
</span><span class="cx">             'inspector/front-end/View.js',
</span><span class="cx">             'inspector/front-end/WatchExpressionsSidebarPane.js',
</span><ins>+            'inspector/front-end/audits.css',
</ins><span class="cx">             'inspector/front-end/inspector.css',
</span><span class="cx">             'inspector/front-end/inspectorSyntaxHighlight.css',
</span><span class="cx">         ],
</span></span></pre></div>
<a id="trunkWebCoreWebCorevcprojWebCorevcproj"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/WebCore.vcproj/WebCore.vcproj (52557 => 52558)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/WebCore.vcproj/WebCore.vcproj        2009-12-25 14:37:07 UTC (rev 52557)
+++ trunk/WebCore/WebCore.vcproj/WebCore.vcproj        2009-12-25 14:58:54 UTC (rev 52558)
</span><span class="lines">@@ -42708,6 +42708,22 @@
</span><span class="cx">                                         &gt;
</span><span class="cx">                                 &lt;/File&gt;
</span><span class="cx">                                 &lt;File
</span><ins>+                                        RelativePath=&quot;..\inspector\front-end\AuditLauncherView.js&quot;
+                                        &gt;
+                                &lt;/File&gt;
+                                &lt;File
+                                        RelativePath=&quot;..\inspector\front-end\AuditResultView.js&quot;
+                                        &gt;
+                                &lt;/File&gt;
+                                &lt;File
+                                        RelativePath=&quot;..\inspector\front-end\audits.css&quot;
+                                        &gt;
+                                &lt;/File&gt;
+                                &lt;File
+                                        RelativePath=&quot;..\inspector\front-end\AuditsPanel.js&quot;
+                                        &gt;
+                                &lt;/File&gt;
+                                &lt;File
</ins><span class="cx">                                         RelativePath=&quot;..\inspector\front-end\BottomUpProfileDataGridTree.js&quot;
</span><span class="cx">                                         &gt;
</span><span class="cx">                                 &lt;/File&gt;
</span></span></pre></div>
<a id="trunkWebCoreinspectorfrontendAuditLauncherViewjs"></a>
<div class="addfile"><h4>Added: trunk/WebCore/inspector/front-end/AuditLauncherView.js (0 => 52558)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/front-end/AuditLauncherView.js                                (rev 0)
+++ trunk/WebCore/inspector/front-end/AuditLauncherView.js        2009-12-25 14:58:54 UTC (rev 52558)
</span><span class="lines">@@ -0,0 +1,215 @@
</span><ins>+/*
+ * 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
+ * &quot;AS IS&quot; 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 = &quot;audit-category-item-&quot;;
+    this._auditRunning = false;
+
+    this.element.addStyleClass(&quot;audit-launcher-view&quot;);
+
+    this._contentElement = document.createElement(&quot;div&quot;);
+    this._contentElement.className = &quot;audit-launcher-view-content&quot;;
+    this.element.appendChild(this._contentElement);
+
+    function categorySortFunction(a, b)
+    {
+        var aTitle = a.displayName || &quot;&quot;;
+        var bTitle = b.displayName || &quot;&quot;;
+        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(&quot;h1&quot;);
+        this._headerElement.className = &quot;no-audits&quot;;
+        this._headerElement.textContent = WebInspector.UIString(&quot;No audits to run&quot;);
+        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(&quot;Audit Present State&quot;);
+            this._auditPresentStateElement.disabled = false;
+            this._auditPresentStateElement.parentElement.removeStyleClass(&quot;disabled&quot;);
+        } else {
+            this._auditPresentStateLabelElement.nodeValue = WebInspector.UIString(&quot;Audit Present State (Resource Tracking must be enabled)&quot;);
+            this._auditPresentStateElement.disabled = true;
+            this._auditPresentStateElement.parentElement.addStyleClass(&quot;disabled&quot;);
+            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 &lt; 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(&quot;label&quot;);
+        labelElement.id = this._categoryIdPrefix + id;
+
+        element = document.createElement(&quot;input&quot;);
+        element.type = &quot;checkbox&quot;;
+        labelElement.appendChild(element);
+
+        labelElement.appendChild(document.createTextNode(title));
+
+        return labelElement;
+    },
+
+    _createLauncherUI: function(sortedCategories)
+    {
+        this._headerElement = document.createElement(&quot;h1&quot;);
+        this._headerElement.textContent = WebInspector.UIString(&quot;Select audits to run&quot;);
+        this._contentElement.appendChild(this._headerElement);
+
+        var categoryElement = this._createCategoryElement(WebInspector.UIString(&quot;Select All&quot;), &quot;&quot;);
+        categoryElement.id = &quot;audit-launcher-selectall&quot;;
+        this._selectAllCheckboxElement = categoryElement.firstChild;
+        this._selectAllCheckboxElement.addEventListener(&quot;click&quot;, this._selectAllClicked.bind(this), false);
+        this._contentElement.appendChild(categoryElement);
+
+        this._categoriesElement = document.createElement(&quot;div&quot;);
+        this._categoriesElement.className = &quot;audit-categories-container&quot;;
+        this._contentElement.appendChild(this._categoriesElement);
+
+        var boundCategoryClickListener = this._categoryClicked.bind(this);
+
+        for (var i = 0; i &lt; sortedCategories.length; ++i) {
+            categoryElement = this._createCategoryElement(sortedCategories[i].displayName, sortedCategories[i].id);
+            categoryElement.firstChild.addEventListener(&quot;click&quot;, boundCategoryClickListener, false);
+            sortedCategories[i]._checkboxElement = categoryElement.firstChild;
+            this._categoriesElement.appendChild(categoryElement);
+        }
+
+        this._totalCategoriesCount = this._categoriesElement.childNodes.length;
+        this._currentCategoriesCount = 0;
+
+        this._buttonContainerElement = document.createElement(&quot;div&quot;);
+        this._buttonContainerElement.className = &quot;button-container&quot;;
+
+        var labelElement = document.createElement(&quot;label&quot;);
+        this._auditPresentStateElement = document.createElement(&quot;input&quot;);
+        this._auditPresentStateElement.name = &quot;audit-mode&quot;;
+        this._auditPresentStateElement.type = &quot;radio&quot;;
+        this._auditPresentStateElement.checked = true;
+        this._auditPresentStateLabelElement = document.createTextNode(&quot;&quot;);
+        labelElement.appendChild(this._auditPresentStateElement);
+        labelElement.appendChild(this._auditPresentStateLabelElement);
+        this._buttonContainerElement.appendChild(labelElement);
+
+        labelElement = document.createElement(&quot;label&quot;);
+        this.auditReloadedStateElement = document.createElement(&quot;input&quot;);
+        this.auditReloadedStateElement.name = &quot;audit-mode&quot;;
+        this.auditReloadedStateElement.type = &quot;radio&quot;;
+        labelElement.appendChild(this.auditReloadedStateElement);
+        labelElement.appendChild(document.createTextNode(&quot;Reload Page and Audit on Load&quot;));
+        this._buttonContainerElement.appendChild(labelElement);
+
+        this._launchButton = document.createElement(&quot;button&quot;);
+        this._launchButton.setAttribute(&quot;type&quot;, &quot;button&quot;);
+        this._launchButton.addEventListener(&quot;click&quot;, 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(&quot;Running...&quot;);
+        else
+            this._launchButton.textContent = WebInspector.UIString(&quot;Run&quot;);
+    },
+
+    resize: function()
+    {
+        if (this._categoriesElement)
+            this._categoriesElement.style.height = (this._buttonContainerElement.totalOffsetTop - this._categoriesElement.totalOffsetTop) + &quot;px&quot;;
+    }
+}
+
+WebInspector.AuditLauncherView.prototype.__proto__ = WebInspector.View.prototype;
</ins><span class="cx">Property changes on: trunk/WebCore/inspector/front-end/AuditLauncherView.js
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkWebCoreinspectorfrontendAuditResultViewjs"></a>
<div class="addfile"><h4>Added: trunk/WebCore/inspector/front-end/AuditResultView.js (0 => 52558)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/front-end/AuditResultView.js                                (rev 0)
+++ trunk/WebCore/inspector/front-end/AuditResultView.js        2009-12-25 14:58:54 UTC (rev 52558)
</span><span class="lines">@@ -0,0 +1,143 @@
</span><ins>+/*
+ * 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
+ * &quot;AS IS&quot; 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(&quot;audit-result-view&quot;);
+
+    this.resultBarElement = document.createElement(&quot;div&quot;);
+    this.resultBarElement.id = &quot;audit-resultbar&quot;;
+    this.element.appendChild(this.resultBarElement);
+
+    function entrySortFunction(a, b)
+    {
+        var result = b.type - a.type;
+        if (!result)
+            result = (a.value || &quot;&quot;).localeCompare(b.value || &quot;&quot;);
+        return result;
+    }
+
+    for (var i = 0; i &lt; 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 &lt; 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 &lt; 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(&quot;img&quot;);
+        scoreElement.className = &quot;score&quot;;
+        var className = (ruleResult.type == WebInspector.AuditRuleResult.Type.Violation) ? &quot;red&quot; : &quot;green&quot;;
+        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 &amp;&amp; children.length;
+    if (!this._hasChildren)
+        this.element.addStyleClass(&quot;blank-section&quot;);
+    else {
+        this.contentElement = document.createElement(&quot;div&quot;);
+        this.contentElement.addStyleClass(&quot;section-content&quot;);
+        for (var i = 0; i &lt; children.length; ++i) {
+            var paraElement = document.createElement(&quot;p&quot;);
+            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;
</ins><span class="cx">Property changes on: trunk/WebCore/inspector/front-end/AuditResultView.js
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkWebCoreinspectorfrontendAuditsPaneljs"></a>
<div class="addfile"><h4>Added: trunk/WebCore/inspector/front-end/AuditsPanel.js (0 => 52558)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/front-end/AuditsPanel.js                                (rev 0)
+++ trunk/WebCore/inspector/front-end/AuditsPanel.js        2009-12-25 14:58:54 UTC (rev 52558)
</span><span class="lines">@@ -0,0 +1,473 @@
</span><ins>+/*
+ * 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
+ * &quot;AS IS&quot; 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(&quot;&quot;, {}, 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(&quot;RESULTS&quot;), {}, true);
+    this.sidebarTree.appendChild(this.auditResultsTreeElement);
+    this.auditResultsTreeElement.expand();
+
+    this.element.addStyleClass(&quot;audits&quot;);
+
+    this.clearResultsButton = new WebInspector.StatusBarButton(WebInspector.UIString(&quot;Clear audit results.&quot;), &quot;clear-audit-results-status-bar-item&quot;);
+    this.clearResultsButton.addEventListener(&quot;click&quot;, this._clearButtonClicked.bind(this), false);
+
+    this.viewsContainerElement = document.createElement(&quot;div&quot;);
+    this.viewsContainerElement.id = &quot;audit-views&quot;;
+    this.element.appendChild(this.viewsContainerElement);
+}
+
+WebInspector.AuditsPanel.prototype = {
+    toolbarItemClass: &quot;audits&quot;,
+
+    get toolbarItemLabel()
+    {
+        return WebInspector.UIString(&quot;Audits&quot;);
+    },
+
+    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 &lt; 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 &amp;&amp; resultCallback)
+                resultCallback(mainResourceURL, results);
+        }
+
+        if (!rulesRemaining) {
+            resultCallback(mainResourceURL, results);
+            return;
+        }
+
+        for (var i = 0; i &lt; 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 &lt; 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 &lt; 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(&quot;window.location.reload()&quot;, 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 &amp;&amp; &quot;resize&quot; in visibleView)
+            visibleView.resize();
+    },
+
+    updateMainViewWidth: function(width)
+    {
+        this.viewsContainerElement.style.left = width + &quot;px&quot;;
+    },
+
+    _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 &lt; 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(&quot;doRun() not implemented&quot;);
+    },
+
+    getValue: function(key)
+    {
+        if (key in this._parametersObject)
+            return this._parametersObject[key];
+        else
+            throw new Error(key + &quot; not found in rule parameters&quot;);
+    }
+}
+
+
+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, &quot;audits-sidebar-tree-item&quot;, WebInspector.UIString(&quot;Audits&quot;), &quot;&quot;, 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, &quot;audit-result-sidebar-tree-item&quot;, String.sprintf(&quot;%s (%d)&quot;, mainResourceURL, ordinal), &quot;&quot;, {}, 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 = {};
</ins><span class="cx">Property changes on: trunk/WebCore/inspector/front-end/AuditsPanel.js
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkWebCoreinspectorfrontendWebKitqrc"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/inspector/front-end/WebKit.qrc (52557 => 52558)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/front-end/WebKit.qrc        2009-12-25 14:37:07 UTC (rev 52557)
+++ trunk/WebCore/inspector/front-end/WebKit.qrc        2009-12-25 14:58:54 UTC (rev 52558)
</span><span class="lines">@@ -2,6 +2,9 @@
</span><span class="cx"> &lt;qresource prefix=&quot;/webkit/inspector&quot;&gt;
</span><span class="cx">     &lt;file&gt;inspector.html&lt;/file&gt;
</span><span class="cx">     &lt;file&gt;AbstractTimelinePanel.js&lt;/file&gt;
</span><ins>+    &lt;file&gt;AuditLauncherView.js&lt;/file&gt;
+    &lt;file&gt;AuditResultView.js&lt;/file&gt;
+    &lt;file&gt;AuditsPanel.js&lt;/file&gt;
</ins><span class="cx">     &lt;file&gt;BottomUpProfileDataGridTree.js&lt;/file&gt;
</span><span class="cx">     &lt;file&gt;Breakpoint.js&lt;/file&gt;
</span><span class="cx">     &lt;file&gt;BreakpointsSidebarPane.js&lt;/file&gt;
</span><span class="lines">@@ -77,6 +80,7 @@
</span><span class="cx">     &lt;file&gt;utilities.js&lt;/file&gt;
</span><span class="cx">     &lt;file&gt;View.js&lt;/file&gt;
</span><span class="cx">     &lt;file&gt;WatchExpressionsSidebarPane.js&lt;/file&gt;
</span><ins>+    &lt;file&gt;audits.css&lt;/file&gt;
</ins><span class="cx">     &lt;file&gt;inspector.css&lt;/file&gt;
</span><span class="cx">     &lt;file&gt;inspectorSyntaxHighlight.css&lt;/file&gt;
</span><span class="cx">     &lt;file&gt;Images/back.png&lt;/file&gt;
</span></span></pre></div>
<a id="trunkWebCoreinspectorfrontendauditscss"></a>
<div class="addfile"><h4>Added: trunk/WebCore/inspector/front-end/audits.css (0 => 52558)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/front-end/audits.css                                (rev 0)
+++ trunk/WebCore/inspector/front-end/audits.css        2009-12-25 14:58:54 UTC (rev 52558)
</span><span class="lines">@@ -0,0 +1,277 @@
</span><ins>+/*
+ * 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
+ * &quot;AS IS&quot; 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 &gt; .pane img.score {
+    float: left;
+    margin-top: 2px;
+    position: relative;
+    height: 16px;
+    width: 16px;
+    z-index: 100;
+}
+
+#audit-resultbar &gt; .pane img.score.red {
+    content: url(Images/errorRedDot.png);
+}
+
+#audit-resultbar &gt; .pane img.score.green {
+    content: url(Images/successGreenDot.png);
+}
+
+#audit-resultbar &gt; .pane &gt; .body &gt; .pane:nth-of-type(2n) {
+    background-color: rgba(0, 0, 0, 0.05);
+}
+
+#audit-resultbar &gt; .pane &gt; .body &gt; .pane &gt; .title {
+    padding-left: 16px;
+    background-image: none;
+    border-bottom: none;
+}
+
+#audit-resultbar &gt; .pane &gt; .body &gt; .pane &gt; .body {
+    background-color: transparent;
+}
+
+#audit-resultbar &gt; .pane &gt; .body &gt; .pane .section {
+    margin-left: 16px;
+}
+
+#audit-resultbar .section .header {
+    border: 0;
+    background-image: none;
+    background-color: transparent;
+}
+
+#audit-resultbar .section .header &gt; .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 &gt; p:nth-of-type(1) {
+    margin-top: 0;
+}
+
+#audit-resultbar .section.expanded .section-content &gt; p:nth-of-type(1) &gt; *: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 &gt; ol.sidebar-tree &gt; 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=&quot;checkbox&quot;] {
+    margin-left: 0;
+}
+
+.audit-launcher-view input[type=&quot;radio&quot;] {
+    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=&quot;radio&quot;]: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=&quot;radio&quot;]: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)));
+}
</ins><span class="cx">Property changes on: trunk/WebCore/inspector/front-end/audits.css
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkWebCoreinspectorfrontendinspectorhtml"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/inspector/front-end/inspector.html (52557 => 52558)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/front-end/inspector.html        2009-12-25 14:37:07 UTC (rev 52557)
+++ trunk/WebCore/inspector/front-end/inspector.html        2009-12-25 14:58:54 UTC (rev 52558)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> &lt;html&gt;
</span><span class="cx"> &lt;head&gt;
</span><span class="cx">     &lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;
</span><ins>+    &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;audits.css&quot;&gt;
</ins><span class="cx">     &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;inspector.css&quot;&gt;
</span><span class="cx">     &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;inspectorSyntaxHighlight.css&quot;&gt;
</span><span class="cx">     &lt;script type=&quot;text/javascript&quot; src=&quot;utilities.js&quot;&gt;&lt;/script&gt;
</span><span class="lines">@@ -85,6 +86,9 @@
</span><span class="cx">     &lt;script type=&quot;text/javascript&quot; src=&quot;StoragePanel.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script type=&quot;text/javascript&quot; src=&quot;ProfilesPanel.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script type=&quot;text/javascript&quot; src=&quot;ConsolePanel.js&quot;&gt;&lt;/script&gt;
</span><ins>+    &lt;script type=&quot;text/javascript&quot; src=&quot;AuditsPanel.js&quot;&gt;&lt;/script&gt;
+    &lt;script type=&quot;text/javascript&quot; src=&quot;AuditResultView.js&quot;&gt;&lt;/script&gt;
+    &lt;script type=&quot;text/javascript&quot; src=&quot;AuditLauncherView.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx">     &lt;script type=&quot;text/javascript&quot; src=&quot;ResourceView.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script type=&quot;text/javascript&quot; src=&quot;SourceFrame.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script type=&quot;text/javascript&quot; src=&quot;SourceSyntaxHighlighter.js&quot;&gt;&lt;/script&gt;
</span></span></pre></div>
<a id="trunkWebCoreinspectorfrontendinspectorjs"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/inspector/front-end/inspector.js (52557 => 52558)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/front-end/inspector.js        2009-12-25 14:37:07 UTC (rev 52557)
+++ trunk/WebCore/inspector/front-end/inspector.js        2009-12-25 14:58:54 UTC (rev 52558)
</span><span class="lines">@@ -177,6 +177,11 @@
</span><span class="cx"> 
</span><span class="cx">         if (hiddenPanels.indexOf(&quot;storage&quot;) === -1 &amp;&amp; hiddenPanels.indexOf(&quot;databases&quot;) === -1)
</span><span class="cx">             this.panels.storage = new WebInspector.StoragePanel();
</span><ins>+
+        // FIXME: Uncomment when ready.
+        // if (hiddenPanels.indexOf(&quot;audits&quot;) === -1)
+        //    this.panels.audits = new WebInspector.AuditsPanel();
+
</ins><span class="cx">         if (hiddenPanels.indexOf(&quot;console&quot;) === -1)
</span><span class="cx">             this.panels.console = new WebInspector.ConsolePanel();
</span><span class="cx">     },
</span><span class="lines">@@ -967,7 +972,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (payload.didRequestChange) {
</span><del>-        resource.host = payload.domain;
</del><ins>+        resource.domain = payload.host;
</ins><span class="cx">         resource.path = payload.path;
</span><span class="cx">         resource.lastPathComponent = payload.lastPathComponent;
</span><span class="cx">         resource.requestHeaders = payload.requestHeaders;
</span><span class="lines">@@ -1021,6 +1026,8 @@
</span><span class="cx">             // of the resources panel instead of the individual resource.
</span><span class="cx">             if (this.panels.resources)
</span><span class="cx">                 this.panels.resources.mainResourceLoadTime = payload.loadEventTime;
</span><ins>+            if (this.panels.audits)
+                this.panels.audits.mainResourceLoadTime = payload.loadEventTime;
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if (payload.domContentEventTime) {
</span><span class="lines">@@ -1028,6 +1035,8 @@
</span><span class="cx">             // the resources panel for the same reasons as above.
</span><span class="cx">             if (this.panels.resources)
</span><span class="cx">                 this.panels.resources.mainResourceDOMContentTime = payload.domContentEventTime;
</span><ins>+            if (this.panels.audits)
+                this.panels.audits.mainResourceDOMContentTime = payload.domContentEventTime;
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>