Changeset 222181 in webkit


Ignore:
Timestamp:
Sep 18, 2017 2:33:41 PM (7 years ago)
Author:
BJ Burg
Message:

Web Inspector: introduce an AppController class and shared instance of it
https://bugs.webkit.org/show_bug.cgi?id=177024

Reviewed by Matt Baker.

WebInspectorUI currently has an app controller singleton that's distributed
among many properties on the WI object, which also serves as a namespace for
classes, enums, and other frontend objects. The singleton should be a proper
class so that we can think more easily about what state is global.

In the process of moving pieces of Main.js into AppController, I intend to move
most UI related code into a view controller class for the top level view.
AppController really shouldn't be doing anything to the view hierarchy or DOM.
It is yet to be determined how responsibility for global DOM events, such as
those for keyboard shortcuts, will be handled.

This larger refactoring project will let us more easily do things like connect
to multiple debuggables in the same Inspector instance, and switch between views
of different debuggable targets. Even if this never comes to pass, the code will
be a lot easier to reason about and maintain in the future.

For the first patch, introduce {AppController, TestAppController} <: AppControllerBase.
Shared code goes in the base class. In the Main.html and Test.html files, first
construct the AppController and then call .initialize() to avoid cyclic dependencies
on the global singleton WI.sharedApp.

  • UserInterface/Main.html:
  • UserInterface/Test.html:
  • UserInterface/Test/Test.js:

(WI.loaded):

  • UserInterface/Base/Main.js:

(WI.loaded):
Move some shared code out of here into AppControllerBase.constructor.
Eventually WI.loaded should not exist, and its code will move elsewhere.

(WI.contentLoaded):
Adopt global reference.

  • UserInterface/Controllers/AppControllerBase.js: Copied from Source/WebInspectorUI/UserInterface/Protocol/MainTarget.js.

(WI.AppControllerBase):
(WI.AppControllerBase.prototype.get hasExtraDomains):
(WI.AppControllerBase.prototype.get debuggableType):
(WI.AppControllerBase.prototype.initialize):

  • UserInterface/Controllers/AppController.js: New.

(WI.AppController):
(WI.AppController.prototype.get hasExtraDomains):
(WI.AppController.prototype.get debuggableType):
(WI.AppController.prototype.activateExtraDomains):

  • UserInterface/Test/TestAppController.js: New.

(WI.TestAppController):
(WI.TestAppController.prototype.get hasExtraDomains):
(WI.TestAppController.prototype.get debuggableType):

  • UserInterface/Controllers/TimelineManager.js:

(WI.TimelineManager.defaultTimelineTypes):
(WI.TimelineManager.availableTimelineTypes):
(WI.TimelineManager.prototype.scriptProfilerProgrammaticCaptureStarted):
(WI.TimelineManager.prototype.scriptProfilerProgrammaticCaptureStopped):
(WI.TimelineManager.prototype.scriptProfilerTrackingCompleted):

  • UserInterface/Models/TimelineRecording.js:

(WI.TimelineRecording.sourceCodeTimelinesSupported):

  • UserInterface/Protocol/InspectorObserver.js:

(WI.InspectorObserver.prototype.inspect):
(WI.InspectorObserver.prototype.activateExtraDomains):
(WI.InspectorObserver):

  • UserInterface/Protocol/MainTarget.js:

(WI.MainTarget):
(WI.MainTarget.prototype.get displayName):

  • UserInterface/Views/ResourceSidebarPanel.js:

(WI.ResourceSidebarPanel):
(WI.ResourceSidebarPanel.prototype.initialLayout):
(WI.ResourceSidebarPanel.prototype._addScript):
(WI.ResourceSidebarPanel.prototype._extraDomainsActivated):

  • UserInterface/Views/Toolbar.js:

Use WI.sharedApp.{debuggableType, hasExtraDomains}.

Location:
trunk/Source/WebInspectorUI
Files:
11 edited
3 copied

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r222174 r222181  
     12017-09-18  Brian Burg  <bburg@apple.com>
     2
     3        Web Inspector: introduce an AppController class and shared instance of it
     4        https://bugs.webkit.org/show_bug.cgi?id=177024
     5
     6        Reviewed by Matt Baker.
     7
     8        WebInspectorUI currently has an app controller singleton that's distributed
     9        among many properties on the WI object, which also serves as a namespace for
     10        classes, enums, and other frontend objects. The singleton should be a proper
     11        class so that we can think more easily about what state is global.
     12
     13        In the process of moving pieces of Main.js into AppController, I intend to move
     14        most UI related code into a view controller class for the top level view.
     15        AppController really shouldn't be doing anything to the view hierarchy or DOM.
     16        It is yet to be determined how responsibility for global DOM events, such as
     17        those for keyboard shortcuts, will be handled.
     18
     19        This larger refactoring project will let us more easily do things like connect
     20        to multiple debuggables in the same Inspector instance, and switch between views
     21        of different debuggable targets. Even if this never comes to pass, the code will
     22        be a lot easier to reason about and maintain in the future.
     23
     24        For the first patch, introduce {AppController, TestAppController} <: AppControllerBase.
     25        Shared code goes in the base class. In the Main.html and Test.html files, first
     26        construct the AppController and then call .initialize() to avoid cyclic dependencies
     27        on the global singleton WI.sharedApp.
     28
     29        * UserInterface/Main.html:
     30        * UserInterface/Test.html:
     31        * UserInterface/Test/Test.js:
     32        (WI.loaded):
     33        * UserInterface/Base/Main.js:
     34        (WI.loaded):
     35        Move some shared code out of here into AppControllerBase.constructor.
     36        Eventually WI.loaded should not exist, and its code will move elsewhere.
     37
     38        (WI.contentLoaded):
     39        Adopt global reference.
     40
     41        * UserInterface/Controllers/AppControllerBase.js: Copied from Source/WebInspectorUI/UserInterface/Protocol/MainTarget.js.
     42        (WI.AppControllerBase):
     43        (WI.AppControllerBase.prototype.get hasExtraDomains):
     44        (WI.AppControllerBase.prototype.get debuggableType):
     45        (WI.AppControllerBase.prototype.initialize):
     46
     47        * UserInterface/Controllers/AppController.js: New.
     48        (WI.AppController):
     49        (WI.AppController.prototype.get hasExtraDomains):
     50        (WI.AppController.prototype.get debuggableType):
     51        (WI.AppController.prototype.activateExtraDomains):
     52
     53        * UserInterface/Test/TestAppController.js: New.
     54        (WI.TestAppController):
     55        (WI.TestAppController.prototype.get hasExtraDomains):
     56        (WI.TestAppController.prototype.get debuggableType):
     57
     58        * UserInterface/Controllers/TimelineManager.js:
     59        (WI.TimelineManager.defaultTimelineTypes):
     60        (WI.TimelineManager.availableTimelineTypes):
     61        (WI.TimelineManager.prototype.scriptProfilerProgrammaticCaptureStarted):
     62        (WI.TimelineManager.prototype.scriptProfilerProgrammaticCaptureStopped):
     63        (WI.TimelineManager.prototype.scriptProfilerTrackingCompleted):
     64        * UserInterface/Models/TimelineRecording.js:
     65        (WI.TimelineRecording.sourceCodeTimelinesSupported):
     66        * UserInterface/Protocol/InspectorObserver.js:
     67        (WI.InspectorObserver.prototype.inspect):
     68        (WI.InspectorObserver.prototype.activateExtraDomains):
     69        (WI.InspectorObserver):
     70        * UserInterface/Protocol/MainTarget.js:
     71        (WI.MainTarget):
     72        (WI.MainTarget.prototype.get displayName):
     73        * UserInterface/Views/ResourceSidebarPanel.js:
     74        (WI.ResourceSidebarPanel):
     75        (WI.ResourceSidebarPanel.prototype.initialLayout):
     76        (WI.ResourceSidebarPanel.prototype._addScript):
     77        (WI.ResourceSidebarPanel.prototype._extraDomainsActivated):
     78        * UserInterface/Views/Toolbar.js:
     79        Use WI.sharedApp.{debuggableType, hasExtraDomains}.
     80
    1812017-09-18  Matt Baker  <mattbaker@apple.com>
    282
  • trunk/Source/WebInspectorUI/UserInterface/Base/Main.js

    r221943 r222181  
    3434};
    3535
    36 WI.DebuggableType = {
    37     Web: "web",
    38     JavaScript: "javascript"
    39 };
    40 
    4136WI.SelectedSidebarPanelCookieKey = "selected-sidebar-panel";
    4237WI.TypeIdentifierCookieKey = "represented-object-type";
     
    5651WI.loaded = function()
    5752{
    58     this.debuggableType = InspectorFrontendHost.debuggableType() === "web" ? WI.DebuggableType.Web : WI.DebuggableType.JavaScript;
    59     this.hasExtraDomains = false;
    60 
    6153    // Register observers for events from the InspectorBackend.
    6254    if (InspectorBackend.registerInspectorDispatcher)
     
    248240    }
    249241
    250     document.body.classList.add(this.debuggableType);
     242    document.body.classList.add(WI.sharedApp.debuggableType);
    251243    document.body.setAttribute("dir", this.resolvedLayoutDirection());
    252244
     
    379371
    380372    var toolTip;
    381     if (WI.debuggableType === WI.DebuggableType.JavaScript)
     373    if (WI.sharedApp.debuggableType === WI.DebuggableType.JavaScript)
    382374        toolTip = WI.UIString("Restart (%s)").format(this._reloadPageKeyboardShortcut.displayName);
    383375    else
     
    705697WI.activateExtraDomains = function(domains)
    706698{
    707     this.hasExtraDomains = true;
    708 
    709     for (var domain of domains) {
    710         var agent = InspectorBackend.activateDomain(domain);
    711         if (agent.enable)
    712             agent.enable();
    713     }
    714 
    715699    this.notifications.dispatchEventToListeners(WI.Notification.ExtraDomainsActivated, {"domains": domains});
    716700
     
    18601844{
    18611845    // COMPATIBILITY (iOS 7): Page.archive did not exist yet.
    1862     if (!window.PageAgent || !PageAgent.archive || this.debuggableType !== WI.DebuggableType.Web) {
     1846    if (!window.PageAgent || !PageAgent.archive || this.sharedApp.debuggableType !== WI.DebuggableType.Web) {
    18631847        this._downloadToolbarButton.hidden = true;
    18641848        return;
     
    25902574{
    25912575    // COMPATIBILITY (iOS 7): Page.archive did not exist yet.
    2592     if (!PageAgent.archive || this.debuggableType !== WI.DebuggableType.Web)
     2576    if (!PageAgent.archive || this.sharedApp.debuggableType !== WI.DebuggableType.Web)
    25932577        return false;
    25942578
  • trunk/Source/WebInspectorUI/UserInterface/Controllers/AppController.js

    r222180 r222181  
    11/*
    2  * Copyright (C) 2016 Apple Inc. All rights reserved.
     2 * Copyright (C) 2017 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 WI.MainTarget = class MainTarget extends WI.Target
     26WI.AppController = class AppController extends WI.AppControllerBase
    2727{
    28     constructor(connection)
     28    constructor()
    2929    {
    30         super("main", "", WI.Target.Type.Main, InspectorBackend.mainConnection);
     30        super();
    3131
    32         let displayName = WI.debuggableType === WI.DebuggableType.Web ? WI.UIString("Main Frame") : this.displayName;
    33         this._executionContext = new WI.ExecutionContext(this, WI.RuntimeManager.TopLevelContextExecutionIdentifier, displayName, true, null);
     32        this._hasExtraDomains = false;
     33        this._debuggableType = InspectorFrontendHost.debuggableType() === "web" ? WI.DebuggableType.Web : WI.DebuggableType.JavaScript;
    3434    }
    3535
    36     // Protected (Target)
     36    // Properties.
    3737
    38     get displayName()
     38    get hasExtraDomains() { return this._hasExtraDomains; }
     39    get debuggableType() { return this._debuggableType; }
     40
     41    // API.
     42
     43    activateExtraDomains(domains)
    3944    {
    40         switch (WI.debuggableType) {
    41         case WI.DebuggableType.Web:
    42             return WI.UIString("Page");
    43         case WI.DebuggableType.JavaScript:
    44             return WI.UIString("JavaScript Context");
    45         default:
    46             console.error("Unexpected debuggable type: ", WI.debuggableType);
    47             return WI.UIString("Main");
     45        if (this._hasExtraDomains)
     46            throw new Error("Extra domains have already been activated, cannot activate again.");
     47
     48        this._hasExtraDomains = true;
     49
     50        for (let domain of domains) {
     51            let agent = InspectorBackend.activateDomain(domain);
     52            if (agent.enable)
     53                agent.enable();
    4854        }
    49     }
    5055
    51     get mainResource()
    52     {
    53         let mainFrame = WI.frameResourceManager.mainFrame;
    54         return mainFrame ? mainFrame.mainResource : null;
     56        // FIXME: all code within WI.activateExtraDomains should be distributed elsewhere.
     57        WI.activateExtraDomains();
    5558    }
    5659};
  • trunk/Source/WebInspectorUI/UserInterface/Controllers/AppControllerBase.js

    r222180 r222181  
    11/*
    2  * Copyright (C) 2016 Apple Inc. All rights reserved.
     2 * Copyright (C) 2017 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 WI.MainTarget = class MainTarget extends WI.Target
     26WI.DebuggableType = {
     27    Web: "web",
     28    JavaScript: "javascript"
     29};
     30
     31WI.NotImplementedError = class NotImplementedError extends Error
    2732{
    28     constructor(connection)
     33    constructor(message="This method is not implemented.")
    2934    {
    30         super("main", "", WI.Target.Type.Main, InspectorBackend.mainConnection);
    31 
    32         let displayName = WI.debuggableType === WI.DebuggableType.Web ? WI.UIString("Main Frame") : this.displayName;
    33         this._executionContext = new WI.ExecutionContext(this, WI.RuntimeManager.TopLevelContextExecutionIdentifier, displayName, true, null);
     35        super(message);
    3436    }
    3537
    36     // Protected (Target)
     38    static subclassMustOverride()
     39    {
     40        return new WI.NotImplementedError("This method must be overridden by a subclass.");
     41    }
     42};
    3743
    38     get displayName()
     44WI.AppControllerBase = class AppControllerBase
     45{
     46    constructor()
    3947    {
    40         switch (WI.debuggableType) {
    41         case WI.DebuggableType.Web:
    42             return WI.UIString("Page");
    43         case WI.DebuggableType.JavaScript:
    44             return WI.UIString("JavaScript Context");
    45         default:
    46             console.error("Unexpected debuggable type: ", WI.debuggableType);
    47             return WI.UIString("Main");
    48         }
     48        this._initialized = false;
    4949    }
    5050
    51     get mainResource()
     51    get hasExtraDomains() { throw WI.NotImplementedError.subclassMustOverride(); }
     52    get debuggableType() { throw WI.NotImplementedError.subclassMustOverride(); }
     53
     54    // Since various members of the app controller depend on the global singleton to exist,
     55    // some initialization needs to happen after the app controller has been constructed.
     56    initialize()
    5257    {
    53         let mainFrame = WI.frameResourceManager.mainFrame;
    54         return mainFrame ? mainFrame.mainResource : null;
     58        if (this._initialized)
     59            throw new Error("App controller is already initialized.");
     60
     61        this._initialized = true;
     62
     63        // FIXME: eventually all code within WI.loaded should be distributed elsewhere.
     64        WI.loaded();
    5565    }
    5666};
  • trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js

    r222064 r222181  
    6767    static defaultTimelineTypes()
    6868    {
    69         if (WI.debuggableType === WI.DebuggableType.JavaScript) {
     69        if (WI.sharedApp.debuggableType === WI.DebuggableType.JavaScript) {
    7070            let defaultTypes = [WI.TimelineRecord.Type.Script];
    7171            if (WI.HeapAllocationsInstrument.supported())
     
    8989    {
    9090        let types = WI.TimelineManager.defaultTimelineTypes();
    91         if (WI.debuggableType === WI.DebuggableType.JavaScript)
     91        if (WI.sharedApp.debuggableType === WI.DebuggableType.JavaScript)
    9292            return types;
    9393
     
    879879    {
    880880        // FIXME: <https://webkit.org/b/158753> Generalize the concept of Instruments on the backend to work equally for JSContext and Web inspection
    881         console.assert(WI.debuggableType === WI.DebuggableType.JavaScript);
     881        console.assert(WI.sharedApp.debuggableType === WI.DebuggableType.JavaScript);
    882882        console.assert(!this._isCapturing);
    883883
     
    888888    {
    889889        // FIXME: <https://webkit.org/b/158753> Generalize the concept of Instruments on the backend to work equally for JSContext and Web inspection
    890         console.assert(WI.debuggableType === WI.DebuggableType.JavaScript);
     890        console.assert(WI.sharedApp.debuggableType === WI.DebuggableType.JavaScript);
    891891        console.assert(this._isCapturing);
    892892
     
    978978        // Associate the ScriptProfiler created records with Web Timeline records.
    979979        // Filter out the already added ScriptProfiler events which should not have been wrapped.
    980         if (WI.debuggableType !== WI.DebuggableType.JavaScript) {
     980        if (WI.sharedApp.debuggableType !== WI.DebuggableType.JavaScript) {
    981981            this._scriptProfilerRecords = this._scriptProfilerRecords.filter((x) => x.__scriptProfilerType === ScriptProfilerAgent.EventType.Other);
    982982            this._mergeScriptProfileRecords();
  • trunk/Source/WebInspectorUI/UserInterface/Main.html

    r221943 r222181  
    818818
    819819    <script src="Base/Main.js"></script>
     820    <script src="Controllers/AppControllerBase.js"></script>
     821    <script src="Controllers/AppController.js"></script>
    820822
    821823    <script src="Debug/Bootstrap.js"></script>
     
    825827
    826828    <script>
    827         WI.loaded();
     829        WI.sharedApp = new WI.AppController;
     830        WI.sharedApp.initialize();
    828831    </script>
    829832</head>
  • trunk/Source/WebInspectorUI/UserInterface/Models/TimelineRecording.js

    r220119 r222181  
    5757    static sourceCodeTimelinesSupported()
    5858    {
    59         return WI.debuggableType === WI.DebuggableType.Web;
     59        return WI.sharedApp.debuggableType === WI.DebuggableType.Web;
    6060    }
    6161
  • trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorObserver.js

    r220119 r222181  
    5656            });
    5757            remoteObject.release();
    58             return;           
     58            return;
    5959        }
    6060
     
    6969    activateExtraDomains(domains)
    7070    {
    71         WI.activateExtraDomains(domains);
     71        WI.sharedApp.activateExtraDomains(domains);
    7272    }
    7373};
  • trunk/Source/WebInspectorUI/UserInterface/Protocol/MainTarget.js

    r220119 r222181  
    3030        super("main", "", WI.Target.Type.Main, InspectorBackend.mainConnection);
    3131
    32         let displayName = WI.debuggableType === WI.DebuggableType.Web ? WI.UIString("Main Frame") : this.displayName;
     32        let displayName = WI.sharedApp.debuggableType === WI.DebuggableType.Web ? WI.UIString("Main Frame") : this.displayName;
    3333        this._executionContext = new WI.ExecutionContext(this, WI.RuntimeManager.TopLevelContextExecutionIdentifier, displayName, true, null);
    3434    }
     
    3838    get displayName()
    3939    {
    40         switch (WI.debuggableType) {
     40        switch (WI.sharedApp.debuggableType) {
    4141        case WI.DebuggableType.Web:
    4242            return WI.UIString("Page");
     
    4444            return WI.UIString("JavaScript Context");
    4545        default:
    46             console.error("Unexpected debuggable type: ", WI.debuggableType);
     46            console.error("Unexpected debuggable type: ", WI.sharedApp.debuggableType);
    4747            return WI.UIString("Main");
    4848        }
  • trunk/Source/WebInspectorUI/UserInterface/Test.html

    r222052 r222181  
    4747
    4848    <script src="Test/Test.js"></script>
     49    <script src="Controllers/AppControllerBase.js"></script>
     50    <script src="Test/TestAppController.js"></script>
    4951
    5052    <script src="Base/DOMUtilities.js"></script>
     
    217219
    218220    <script type="text/javascript">
    219         WI.loaded();
     221        WI.sharedApp = new WI.TestAppController;
     222        WI.sharedApp.initialize();
    220223
    221224        // Debug logging is synchronous on the test page.
  • trunk/Source/WebInspectorUI/UserInterface/Test/Test.js

    r222052 r222181  
    2424 */
    2525
    26 WI.DebuggableType = {
    27     Web: "web",
    28     JavaScript: "javascript"
    29 };
    30 
    3126WI.loaded = function()
    3227{
    33     this.debuggableType = WI.DebuggableType.Web;
    34     this.hasExtraDomains = false;
    35 
    3628    // Register observers for events from the InspectorBackend.
    3729    // The initialization order should match the same in Main.js.
  • trunk/Source/WebInspectorUI/UserInterface/Test/TestAppController.js

    r222180 r222181  
    11/*
    2  * Copyright (C) 2016 Apple Inc. All rights reserved.
     2 * Copyright (C) 2017 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 WI.MainTarget = class MainTarget extends WI.Target
     26WI.TestAppController = class TestAppController extends WI.AppControllerBase
    2727{
    28     constructor(connection)
     28    constructor()
    2929    {
    30         super("main", "", WI.Target.Type.Main, InspectorBackend.mainConnection);
    31 
    32         let displayName = WI.debuggableType === WI.DebuggableType.Web ? WI.UIString("Main Frame") : this.displayName;
    33         this._executionContext = new WI.ExecutionContext(this, WI.RuntimeManager.TopLevelContextExecutionIdentifier, displayName, true, null);
     30        super();
    3431    }
    3532
    36     // Protected (Target)
    37 
    38     get displayName()
    39     {
    40         switch (WI.debuggableType) {
    41         case WI.DebuggableType.Web:
    42             return WI.UIString("Page");
    43         case WI.DebuggableType.JavaScript:
    44             return WI.UIString("JavaScript Context");
    45         default:
    46             console.error("Unexpected debuggable type: ", WI.debuggableType);
    47             return WI.UIString("Main");
    48         }
    49     }
    50 
    51     get mainResource()
    52     {
    53         let mainFrame = WI.frameResourceManager.mainFrame;
    54         return mainFrame ? mainFrame.mainResource : null;
    55     }
     33    get hasExtraDomains() { return false; }
     34    get debuggableType() { return WI.DebuggableType.Web; }
    5635};
  • trunk/Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js

    r220609 r222181  
    7777        this.contentTreeOutline.includeSourceMapResourceChildren = true;
    7878
    79         if (WI.debuggableType === WI.DebuggableType.JavaScript) {
     79        if (WI.sharedApp.debuggableType === WI.DebuggableType.JavaScript) {
    8080            this.contentTreeOutline.disclosureButtons = false;
    8181            WI.SourceCode.addEventListener(WI.SourceCode.Event.SourceMapAdded, () => { this.contentTreeOutline.disclosureButtons = true; }, this);
     
    204204            this._addScript(script);
    205205
    206             if (script.sourceMaps.length && WI.debuggableType === WI.DebuggableType.JavaScript)
     206            if (script.sourceMaps.length && WI.sharedApp.debuggableType === WI.DebuggableType.JavaScript)
    207207                this.contentTreeOutline.disclosureButtons = true;
    208208        }
     
    336336            parentFolderTreeElement = this._extensionScriptsFolderTreeElement;
    337337        } else {
    338             if (WI.debuggableType === WI.DebuggableType.JavaScript && !WI.hasExtraDomains)
     338            if (WI.sharedApp.debuggableType === WI.DebuggableType.JavaScript && !WI.sharedApp.hasExtraDomains)
    339339                insertIntoTopLevel = true;
    340340            else {
     
    497497    _extraDomainsActivated()
    498498    {
    499         if (WI.debuggableType === WI.DebuggableType.JavaScript)
     499        if (WI.sharedApp.debuggableType === WI.DebuggableType.JavaScript)
    500500            this.contentTreeOutline.disclosureButtons = true;
    501501    }
  • trunk/Source/WebInspectorUI/UserInterface/Views/Toolbar.js

    r220119 r222181  
    102102
    103103        // Force collapsed style for JavaScript debuggables.
    104         if (WI.debuggableType === WI.DebuggableType.JavaScript) {
     104        if (WI.sharedApp.debuggableType === WI.DebuggableType.JavaScript) {
    105105            this.element.classList.add(WI.NavigationBar.CollapsedStyleClassName);
    106106            return;
Note: See TracChangeset for help on using the changeset viewer.