Changeset 54591 in webkit


Ignore:
Timestamp:
Feb 10, 2010 1:56:01 AM (14 years ago)
Author:
apavlov@chromium.org
Message:

2010-02-09 Alexander Pavlov <apavlov@chromium.org>

Reviewed by Pavel Feldman.

Web Inspector: Add two basic categories for the Audits panel
https://bugs.webkit.org/show_bug.cgi?id=32930

  • WebCore.gypi:
  • WebCore.vcproj/WebCore.vcproj:
  • inspector/front-end/AuditCategories.js: Added. (WebInspector.AuditCategories.PagePerformance): (WebInspector.AuditCategories.PagePerformance.prototype.initialize): (WebInspector.AuditCategories.NetworkUtilization): (WebInspector.AuditCategories.NetworkUtilization.prototype.initialize):
  • inspector/front-end/AuditLauncherView.js: (WebInspector.AuditLauncherView.prototype.updateResourceTrackingState): (WebInspector.AuditLauncherView.prototype._createLauncherUI): (WebInspector.AuditLauncherView.prototype.show):
  • inspector/front-end/AuditRules.js: Added. (WebInspector.AuditRules.arrayAsUL): (WebInspector.AuditRules.getDomainToResourcesMap): (WebInspector.AuditRules.evaluateInTargetWindow): (WebInspector.AuditRules.GzipRule): (WebInspector.AuditRules.GzipRule.prototype.doRun): (WebInspector.AuditRules.GzipRule.prototype._isCompressed): (WebInspector.AuditRules.GzipRule.prototype._shouldCompress): (WebInspector.AuditRules.CombineExternalResourcesRule): (WebInspector.AuditRules.CombineExternalResourcesRule.prototype.doRun): (WebInspector.AuditRules.CombineJsResourcesRule): (WebInspector.AuditRules.CombineCssResourcesRule): (WebInspector.AuditRules.MinimizeDnsLookupsRule): (WebInspector.AuditRules.MinimizeDnsLookupsRule.prototype.doRun): (WebInspector.AuditRules.ParallelizeDownloadRule): (WebInspector.AuditRules.ParallelizeDownloadRule.prototype.doRun): (WebInspector.AuditRules.UnusedCssRule): (WebInspector.AuditRules.UnusedCssRule.prototype._getUnusedStylesheetRatioMessage): (WebInspector.AuditRules.UnusedCssRule.prototype._getUnusedTotalRatioMessage): (WebInspector.AuditRules.UnusedCssRule.prototype.doRun.evalCallback): (WebInspector.AuditRules.UnusedCssRule.prototype.doRun.routine): (WebInspector.AuditRules.UnusedCssRule.prototype.doRun): (WebInspector.AuditRules.CacheControlRule): (WebInspector.AuditRules.CacheControlRule.prototype.InfoCheck.1.FailCheck.0.WarningCheck.1.SevereCheck.2.doRun): (WebInspector.AuditRules.CacheControlRule.prototype.handleNonCacheableResources): (WebInspector.AuditRules.CacheControlRule.prototype._cacheableAndNonCacheableResources): (WebInspector.AuditRules.CacheControlRule.prototype.execCheck): (WebInspector.AuditRules.CacheControlRule.prototype.freshnessLifetimeGreaterThan): (WebInspector.AuditRules.CacheControlRule.prototype.responseHeader): (WebInspector.AuditRules.CacheControlRule.prototype.hasResponseHeader): (WebInspector.AuditRules.CacheControlRule.prototype.isCompressible): (WebInspector.AuditRules.CacheControlRule.prototype.isPubliclyCacheable): (WebInspector.AuditRules.CacheControlRule.prototype.responseHeaderMatch): (WebInspector.AuditRules.CacheControlRule.prototype.hasExplicitExpiration): (WebInspector.AuditRules.CacheControlRule.prototype._isExplicitlyNonCacheable): (WebInspector.AuditRules.CacheControlRule.prototype.isCacheableResource): (WebInspector.AuditRules.BrowserCacheControlRule): (WebInspector.AuditRules.BrowserCacheControlRule.prototype.handleNonCacheableResources): (WebInspector.AuditRules.BrowserCacheControlRule.prototype.runChecks): (WebInspector.AuditRules.BrowserCacheControlRule.prototype._missingExpirationCheck): (WebInspector.AuditRules.BrowserCacheControlRule.prototype._varyCheck): (WebInspector.AuditRules.BrowserCacheControlRule.prototype._oneMonthExpirationCheck): (WebInspector.AuditRules.BrowserCacheControlRule.prototype._oneYearExpirationCheck): (WebInspector.AuditRules.ProxyCacheControlRule): (WebInspector.AuditRules.ProxyCacheControlRule.prototype.runChecks): (WebInspector.AuditRules.ProxyCacheControlRule.prototype._questionMarkCheck): (WebInspector.AuditRules.ProxyCacheControlRule.prototype._publicCachingCheck): (WebInspector.AuditRules.ProxyCacheControlRule.prototype._setCookieCacheableCheck): (WebInspector.AuditRules.ImageDimensionsRule): (WebInspector.AuditRules.ImageDimensionsRule.prototype.doRun): (WebInspector.AuditRules.ImageDimensionsRule.prototype.doRun.routine.hasDimension): (WebInspector.AuditRules.ImageDimensionsRule.prototype.doRun.routine.hasWidth): (WebInspector.AuditRules.ImageDimensionsRule.prototype.doRun.routine.hasHeight): (WebInspector.AuditRules.ImageDimensionsRule.prototype.doRun.routine): (WebInspector.AuditRules.CssInHeadRule): (WebInspector.AuditRules.CssInHeadRule.prototype.doRun): (WebInspector.AuditRules.CssInHeadRule.prototype.doRun.routine.allViews): (WebInspector.AuditRules.CssInHeadRule.prototype.doRun.routine): (WebInspector.AuditRules.StylesScriptsOrderRule): (WebInspector.AuditRules.StylesScriptsOrderRule.prototype.doRun): (WebInspector.AuditRules.StylesScriptsOrderRule.prototype.doRun.routine): (WebInspector.AuditRules.CookieRuleBase): (WebInspector.AuditRules.CookieRuleBase.prototype.doRun.resultCallback): (WebInspector.AuditRules.CookieRuleBase.prototype.doRun): (WebInspector.AuditRules.CookieRuleBase.prototype.mapResourceCookies): (WebInspector.AuditRules.CookieRuleBase.prototype._callbackForResourceCookiePairs): (WebInspector.AuditRules.CookieSizeRule): (WebInspector.AuditRules.CookieSizeRule.prototype._average): (WebInspector.AuditRules.CookieSizeRule.prototype._max): (WebInspector.AuditRules.CookieSizeRule.prototype.processCookies): (WebInspector.AuditRules.CookieSizeRule.prototype.processCookies.avgSizeSorter): (WebInspector.AuditRules.StaticCookielessRule): (WebInspector.AuditRules.StaticCookielessRule.prototype.processCookies): (WebInspector.AuditRules.StaticCookielessRule.prototype._collectorCallback):
  • inspector/front-end/AuditsPanel.js: (WebInspector.AuditsPanel.prototype._constructCategories): (WebInspector.AuditsPanel.prototype._reloadResources): (WebInspector.AuditsPanel.prototype.show): (WebInspector.AuditsPanel.prototype._updateLauncherViewControls): (WebInspector.AuditCategory): (WebInspector.AuditCategory.prototype.get id): (WebInspector.AuditCategory.prototype.get ruleCount): (WebInspector.AuditCategory.prototype.runRules): (WebInspector.AuditCategory.prototype._ensureInitialized): (WebInspector.AuditCategoryResult):
  • inspector/front-end/WebKit.qrc:
  • inspector/front-end/audits.css:
  • inspector/front-end/inspector.html:
  • inspector/front-end/inspector.js: (WebInspector.loaded): (WebInspector.addPanelToolbarIcon): (WebInspector.documentKeyDown):
Location:
trunk/WebCore
Files:
2 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r54587 r54591  
     12010-02-09  Alexander Pavlov  <apavlov@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        Web Inspector: Add two basic categories for the Audits panel
     6        https://bugs.webkit.org/show_bug.cgi?id=32930
     7
     8        * WebCore.gypi:
     9        * WebCore.vcproj/WebCore.vcproj:
     10        * inspector/front-end/AuditCategories.js: Added.
     11        (WebInspector.AuditCategories.PagePerformance):
     12        (WebInspector.AuditCategories.PagePerformance.prototype.initialize):
     13        (WebInspector.AuditCategories.NetworkUtilization):
     14        (WebInspector.AuditCategories.NetworkUtilization.prototype.initialize):
     15        * inspector/front-end/AuditLauncherView.js:
     16        (WebInspector.AuditLauncherView.prototype.updateResourceTrackingState):
     17        (WebInspector.AuditLauncherView.prototype._createLauncherUI):
     18        (WebInspector.AuditLauncherView.prototype.show):
     19        * inspector/front-end/AuditRules.js: Added.
     20        (WebInspector.AuditRules.arrayAsUL):
     21        (WebInspector.AuditRules.getDomainToResourcesMap):
     22        (WebInspector.AuditRules.evaluateInTargetWindow):
     23        (WebInspector.AuditRules.GzipRule):
     24        (WebInspector.AuditRules.GzipRule.prototype.doRun):
     25        (WebInspector.AuditRules.GzipRule.prototype._isCompressed):
     26        (WebInspector.AuditRules.GzipRule.prototype._shouldCompress):
     27        (WebInspector.AuditRules.CombineExternalResourcesRule):
     28        (WebInspector.AuditRules.CombineExternalResourcesRule.prototype.doRun):
     29        (WebInspector.AuditRules.CombineJsResourcesRule):
     30        (WebInspector.AuditRules.CombineCssResourcesRule):
     31        (WebInspector.AuditRules.MinimizeDnsLookupsRule):
     32        (WebInspector.AuditRules.MinimizeDnsLookupsRule.prototype.doRun):
     33        (WebInspector.AuditRules.ParallelizeDownloadRule):
     34        (WebInspector.AuditRules.ParallelizeDownloadRule.prototype.doRun):
     35        (WebInspector.AuditRules.UnusedCssRule):
     36        (WebInspector.AuditRules.UnusedCssRule.prototype._getUnusedStylesheetRatioMessage):
     37        (WebInspector.AuditRules.UnusedCssRule.prototype._getUnusedTotalRatioMessage):
     38        (WebInspector.AuditRules.UnusedCssRule.prototype.doRun.evalCallback):
     39        (WebInspector.AuditRules.UnusedCssRule.prototype.doRun.routine):
     40        (WebInspector.AuditRules.UnusedCssRule.prototype.doRun):
     41        (WebInspector.AuditRules.CacheControlRule):
     42        (WebInspector.AuditRules.CacheControlRule.prototype.InfoCheck.1.FailCheck.0.WarningCheck.1.SevereCheck.2.doRun):
     43        (WebInspector.AuditRules.CacheControlRule.prototype.handleNonCacheableResources):
     44        (WebInspector.AuditRules.CacheControlRule.prototype._cacheableAndNonCacheableResources):
     45        (WebInspector.AuditRules.CacheControlRule.prototype.execCheck):
     46        (WebInspector.AuditRules.CacheControlRule.prototype.freshnessLifetimeGreaterThan):
     47        (WebInspector.AuditRules.CacheControlRule.prototype.responseHeader):
     48        (WebInspector.AuditRules.CacheControlRule.prototype.hasResponseHeader):
     49        (WebInspector.AuditRules.CacheControlRule.prototype.isCompressible):
     50        (WebInspector.AuditRules.CacheControlRule.prototype.isPubliclyCacheable):
     51        (WebInspector.AuditRules.CacheControlRule.prototype.responseHeaderMatch):
     52        (WebInspector.AuditRules.CacheControlRule.prototype.hasExplicitExpiration):
     53        (WebInspector.AuditRules.CacheControlRule.prototype._isExplicitlyNonCacheable):
     54        (WebInspector.AuditRules.CacheControlRule.prototype.isCacheableResource):
     55        (WebInspector.AuditRules.BrowserCacheControlRule):
     56        (WebInspector.AuditRules.BrowserCacheControlRule.prototype.handleNonCacheableResources):
     57        (WebInspector.AuditRules.BrowserCacheControlRule.prototype.runChecks):
     58        (WebInspector.AuditRules.BrowserCacheControlRule.prototype._missingExpirationCheck):
     59        (WebInspector.AuditRules.BrowserCacheControlRule.prototype._varyCheck):
     60        (WebInspector.AuditRules.BrowserCacheControlRule.prototype._oneMonthExpirationCheck):
     61        (WebInspector.AuditRules.BrowserCacheControlRule.prototype._oneYearExpirationCheck):
     62        (WebInspector.AuditRules.ProxyCacheControlRule):
     63        (WebInspector.AuditRules.ProxyCacheControlRule.prototype.runChecks):
     64        (WebInspector.AuditRules.ProxyCacheControlRule.prototype._questionMarkCheck):
     65        (WebInspector.AuditRules.ProxyCacheControlRule.prototype._publicCachingCheck):
     66        (WebInspector.AuditRules.ProxyCacheControlRule.prototype._setCookieCacheableCheck):
     67        (WebInspector.AuditRules.ImageDimensionsRule):
     68        (WebInspector.AuditRules.ImageDimensionsRule.prototype.doRun):
     69        (WebInspector.AuditRules.ImageDimensionsRule.prototype.doRun.routine.hasDimension):
     70        (WebInspector.AuditRules.ImageDimensionsRule.prototype.doRun.routine.hasWidth):
     71        (WebInspector.AuditRules.ImageDimensionsRule.prototype.doRun.routine.hasHeight):
     72        (WebInspector.AuditRules.ImageDimensionsRule.prototype.doRun.routine):
     73        (WebInspector.AuditRules.CssInHeadRule):
     74        (WebInspector.AuditRules.CssInHeadRule.prototype.doRun):
     75        (WebInspector.AuditRules.CssInHeadRule.prototype.doRun.routine.allViews):
     76        (WebInspector.AuditRules.CssInHeadRule.prototype.doRun.routine):
     77        (WebInspector.AuditRules.StylesScriptsOrderRule):
     78        (WebInspector.AuditRules.StylesScriptsOrderRule.prototype.doRun):
     79        (WebInspector.AuditRules.StylesScriptsOrderRule.prototype.doRun.routine):
     80        (WebInspector.AuditRules.CookieRuleBase):
     81        (WebInspector.AuditRules.CookieRuleBase.prototype.doRun.resultCallback):
     82        (WebInspector.AuditRules.CookieRuleBase.prototype.doRun):
     83        (WebInspector.AuditRules.CookieRuleBase.prototype.mapResourceCookies):
     84        (WebInspector.AuditRules.CookieRuleBase.prototype._callbackForResourceCookiePairs):
     85        (WebInspector.AuditRules.CookieSizeRule):
     86        (WebInspector.AuditRules.CookieSizeRule.prototype._average):
     87        (WebInspector.AuditRules.CookieSizeRule.prototype._max):
     88        (WebInspector.AuditRules.CookieSizeRule.prototype.processCookies):
     89        (WebInspector.AuditRules.CookieSizeRule.prototype.processCookies.avgSizeSorter):
     90        (WebInspector.AuditRules.StaticCookielessRule):
     91        (WebInspector.AuditRules.StaticCookielessRule.prototype.processCookies):
     92        (WebInspector.AuditRules.StaticCookielessRule.prototype._collectorCallback):
     93        * inspector/front-end/AuditsPanel.js:
     94        (WebInspector.AuditsPanel.prototype._constructCategories):
     95        (WebInspector.AuditsPanel.prototype._reloadResources):
     96        (WebInspector.AuditsPanel.prototype.show):
     97        (WebInspector.AuditsPanel.prototype._updateLauncherViewControls):
     98        (WebInspector.AuditCategory):
     99        (WebInspector.AuditCategory.prototype.get id):
     100        (WebInspector.AuditCategory.prototype.get ruleCount):
     101        (WebInspector.AuditCategory.prototype.runRules):
     102        (WebInspector.AuditCategory.prototype._ensureInitialized):
     103        (WebInspector.AuditCategoryResult):
     104        * inspector/front-end/WebKit.qrc:
     105        * inspector/front-end/audits.css:
     106        * inspector/front-end/inspector.html:
     107        * inspector/front-end/inspector.js:
     108        (WebInspector.loaded):
     109        (WebInspector.addPanelToolbarIcon):
     110        (WebInspector.documentKeyDown):
     111
    11122010-02-10  Adam Barth  <abarth@webkit.org>
    2113
  • trunk/WebCore/WebCore.gypi

    r54527 r54591  
    37013701            'inspector/front-end/inspector.html',
    37023702            'inspector/front-end/AbstractTimelinePanel.js',
     3703            'inspector/front-end/AuditCategories.js',
    37033704            'inspector/front-end/AuditLauncherView.js',
    37043705            'inspector/front-end/AuditResultView.js',
     3706            'inspector/front-end/AuditRules.js',
    37053707            'inspector/front-end/AuditsPanel.js',
    37063708            'inspector/front-end/BottomUpProfileDataGridTree.js',
  • trunk/WebCore/WebCore.vcproj/WebCore.vcproj

    r54334 r54591  
    4270142701                                </File>
    4270242702                                <File
     42703                                        RelativePath="..\inspector\front-end\AuditCategories.js"
     42704                                        >
     42705                                </File>
     42706                                <File
    4270342707                                        RelativePath="..\inspector\front-end\AuditLauncherView.js"
    4270442708                                        >
     
    4270642710                                <File
    4270742711                                        RelativePath="..\inspector\front-end\AuditResultView.js"
     42712                                        >
     42713                                </File>
     42714                                <File
     42715                                        RelativePath="..\inspector\front-end\AuditRules.js"
    4270842716                                        >
    4270942717                                </File>
  • trunk/WebCore/inspector/front-end/AuditLauncherView.js

    r52629 r54591  
    6464
    6565WebInspector.AuditLauncherView.prototype = {
    66     updateResourceTrackingState: function()
     66    updateResourceTrackingState: function(isTracking)
    6767    {
    6868        if (!this._auditPresentStateLabelElement)
    6969            return;
    70         if (InspectorBackend.resourceTrackingEnabled()) {
     70        if (isTracking) {
    7171            this._auditPresentStateLabelElement.nodeValue = WebInspector.UIString("Audit Present State");
    7272            this._auditPresentStateElement.disabled = false;
     
    198198        this.updateResourceTrackingState();
    199199        this._updateButton();
    200         this.resize();
    201200    },
    202201
     
    210209    },
    211210
     211    show: function(parentElement)
     212    {
     213        WebInspector.View.prototype.show.call(this, parentElement);
     214        setTimeout(this.resize(), 0);
     215    },
     216
    212217    resize: function()
    213218    {
  • trunk/WebCore/inspector/front-end/AuditsPanel.js

    r53766 r54591  
    106106        for (var categoryCtorID in WebInspector.AuditCategories) {
    107107            var auditCategory = new WebInspector.AuditCategories[categoryCtorID]();
    108             this.categoriesById[auditCategory.id] = auditCategory;
     108            auditCategory._id = categoryCtorID;
     109            this.categoriesById[categoryCtorID] = auditCategory;
    109110        }
    110111    },
     
    186187    _reloadResources: function(callback)
    187188    {
    188         function nullCallback()
    189         {
    190         }
    191189        this._resourceTrackingCallback = callback;
     190
    192191        if (!InspectorBackend.resourceTrackingEnabled()) {
    193192            InspectorBackend.enableResourceTracking(false);
    194             this._updateLauncherViewControls();
     193            this._updateLauncherViewControls(true);
    195194        } else
    196             InjectedScriptAccess.getDefault().evaluate("window.location.reload()", nullCallback);
     195            InjectedScriptAccess.getDefault().evaluate("window.location.reload()", switchCallback);
    197196    },
    198197
     
    240239
    241240        this.showView();
    242         this._updateLauncherViewControls();
     241        this._updateLauncherViewControls(InspectorBackend.resourceTrackingEnabled());
    243242    },
    244243
     
    255254    },
    256255
    257     _updateLauncherViewControls: function()
     256    _updateLauncherViewControls: function(isTracking)
    258257    {
    259258        if (this._launcherView)
    260             this._launcherView.updateResourceTrackingState();
     259            this._launcherView.updateResourceTrackingState(isTracking);
    261260    },
    262261
     
    279278
    280279
    281 WebInspector.AuditCategory = function(id, displayName)
    282 {
    283     this._id = id;
     280WebInspector.AuditCategory = function(displayName)
     281{
    284282    this._displayName = displayName;
    285283    this._rules = [];
     
    289287    get id()
    290288    {
     289        // this._id value is injected at construction time.
    291290        return this._id;
    292291    },
     
    299298    get ruleCount()
    300299    {
     300        this._ensureInitialized();
    301301        return this._rules.length;
    302302    },
     
    309309    runRules: function(resources, callback)
    310310    {
     311        this._ensureInitialized();
    311312        for (var i = 0; i < this._rules.length; ++i)
    312313            this._rules[i].run(resources, callback);
     314    },
     315
     316    _ensureInitialized: function()
     317    {
     318        if (!this._initialized) {
     319            if ("initialize" in this)
     320                this.initialize();
     321            this._initialized = true;
     322        }
    313323    }
    314324}
     
    355365WebInspector.AuditCategoryResult = function(category)
    356366{
    357     this.categoryId = category.id;
    358367    this.title = category.displayName;
    359368    this.entries = [];
     
    379388
    380389WebInspector.AuditRuleResult.Type = {
     390    // Does not denote a discovered flaw but rather represents an informational message.
    381391    NA: 0,
     392
     393    // Denotes a minor impact on the checked metric.
    382394    Hint: 1,
     395
     396    // Denotes a major impact on the checked metric.
    383397    Violation: 2
    384398}
  • trunk/WebCore/inspector/front-end/WebKit.qrc

    r54110 r54591  
    33    <file>inspector.html</file>
    44    <file>AbstractTimelinePanel.js</file>
     5    <file>AuditCategories.js</file>
    56    <file>AuditLauncherView.js</file>
    67    <file>AuditResultView.js</file>
     8    <file>AuditRules.js</file>
    79    <file>AuditsPanel.js</file>
    810    <file>BottomUpProfileDataGridTree.js</file>
  • trunk/WebCore/inspector/front-end/audits.css

    r52629 r54591  
    263263}
    264264
    265 .audit-launcher-view input[type="radio"]:active {
     265.audit-launcher-view input[type="radio"]:active:not(:disabled) {
    266266    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(194, 194, 194)), to(rgb(239, 239, 239)));
    267267}
    268268
    269 .audit-launcher-view input[type="radio"]:checked {
     269.audit-launcher-view input[type="radio"]:checked:not(:disabled), .audit-launcher-view input[type="radio"]:checked:disabled {
    270270    background: url(Images/radioDot.png) center no-repeat,
    271271                -webkit-gradient(linear, left top, left bottom, from(rgb(252, 252, 252)), to(rgb(223, 223, 223)));
  • trunk/WebCore/inspector/front-end/inspector.html

    r54110 r54591  
    9292    <script type="text/javascript" src="AuditResultView.js"></script>
    9393    <script type="text/javascript" src="AuditLauncherView.js"></script>
     94    <script type="text/javascript" src="AuditRules.js"></script>
     95    <script type="text/javascript" src="AuditCategories.js"></script>
    9496    <script type="text/javascript" src="ResourceView.js"></script>
    9597    <script type="text/javascript" src="SourceFrame.js"></script>
  • trunk/WebCore/inspector/front-end/inspector.js

    r54435 r54591  
    469469
    470470    this.panelOrder = [];
    471     for (var panelName in this.panels) {
    472         var panel = this.panels[panelName];
    473         var panelToolbarItem = panel.toolbarItem;
    474         this.panelOrder.push(panel);
    475         panelToolbarItem.addEventListener("click", this._toolbarItemClicked.bind(this));
    476         if (previousToolbarItem)
    477             toolbarElement.insertBefore(panelToolbarItem, previousToolbarItem.nextSibling);
    478         else
    479             toolbarElement.insertBefore(panelToolbarItem, toolbarElement.firstChild);
    480         previousToolbarItem = panelToolbarItem;
    481     }
     471    for (var panelName in this.panels)
     472        previousToolbarItem = WebInspector.addPanelToolbarIcon(toolbarElement, this.panels[panelName], previousToolbarItem);
    482473
    483474    this.Tips = {
     
    528519
    529520    InspectorFrontendHost.loaded();
     521}
     522
     523WebInspector.addPanelToolbarIcon = function(toolbarElement, panel, previousToolbarItem)
     524{
     525    var panelToolbarItem = panel.toolbarItem;
     526    this.panelOrder.push(panel);
     527    panelToolbarItem.addEventListener("click", this._toolbarItemClicked.bind(this));
     528    if (previousToolbarItem)
     529        toolbarElement.insertBefore(panelToolbarItem, previousToolbarItem.nextSibling);
     530    else
     531        toolbarElement.insertBefore(panelToolbarItem, toolbarElement.firstChild);
     532    return panelToolbarItem;
    530533}
    531534
     
    750753
    751754            if (shouldShowAuditsPanel) {
    752                 if (!this.panels.audits)
     755                if (!this.panels.audits) {
    753756                    this.panels.audits = new WebInspector.AuditsPanel();
     757                    var toolbarElement = document.getElementById("toolbar");
     758                    WebInspector.addPanelToolbarIcon(toolbarElement, this.panels.audits, this.panels.console.toolbarItem);
     759                }
    754760                this.currentPanel = this.panels.audits;
    755761            }
Note: See TracChangeset for help on using the changeset viewer.