Changeset 206106 in webkit


Ignore:
Timestamp:
Sep 19, 2016 12:08:45 PM (8 years ago)
Author:
Matt Baker
Message:

Unreviewed, reverting changeset https://trac.webkit.org/changeset/206101.

Revert https://bugs.webkit.org/show_bug.cgi?id=162165:
Web Inspector: Make it easier to create a view from an existing DOM element.

  • UserInterface/Base/Main.js:

(WebInspector.contentLoaded):

  • UserInterface/Views/View.js:

(WebInspector.View):

Location:
trunk/Source/WebInspectorUI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r206105 r206106  
     12016-09-19  Matt Baker  <mattbaker@apple.com>
     2
     3        Unreviewed, reverting changeset https://trac.webkit.org/changeset/206101.
     4
     5        Revert https://bugs.webkit.org/show_bug.cgi?id=162165:
     6        Web Inspector: Make it easier to create a view from an existing DOM element.
     7
     8        * UserInterface/Base/Main.js:
     9        (WebInspector.contentLoaded):
     10        * UserInterface/Views/View.js:
     11        (WebInspector.View):
     12
    1132016-09-19  Joseph Pecoraro  <pecoraro@apple.com>
    214
     
    1123        Default the functionName to the empty string. This will compare
    1224        favorably against other empty function names instead of null.
    13 
    14 2016-09-19  Matt Baker  <mattbaker@apple.com>
    15 
    16         Web Inspector: Make it easier to create a view from an existing DOM element
    17         https://bugs.webkit.org/show_bug.cgi?id=162165
    18         <rdar://problem/28365848>
    19 
    20         Reviewed by Timothy Hatcher.
    21 
    22         * UserInterface/Base/Main.js:
    23         (WebInspector.contentLoaded):
    24         Pass id string for views created from existing DOM elements.
    25 
    26         * UserInterface/Views/View.js:
    27         (WebInspector.View):
    28         Change `element` to `elementOrIdentifier`. If the value is a string,
    29         treat it as an element identifier. If the identifier is invalid, create
    30         a default element.
    3125
    32262016-09-19  Joseph Pecoraro  <pecoraro@apple.com>
  • trunk/Source/WebInspectorUI/UserInterface/Base/Main.js

    r206101 r206106  
    228228
    229229    // Create the user interface elements.
    230     this.toolbar = new WebInspector.Toolbar("toolbar", null, true);
     230    this.toolbar = new WebInspector.Toolbar(document.getElementById("toolbar"), null, true);
    231231    this.toolbar.displayMode = WebInspector.Toolbar.DisplayMode.IconOnly;
    232232    this.toolbar.sizeMode = WebInspector.Toolbar.SizeMode.Small;
    233233
    234     this.tabBar = new WebInspector.TabBar("tab-bar");
     234    this.tabBar = new WebInspector.TabBar(document.getElementById("tab-bar"));
    235235    this.tabBar.addEventListener(WebInspector.TabBar.Event.NewTabItemClicked, this._newTabItemClicked, this);
    236236    this.tabBar.addEventListener(WebInspector.TabBar.Event.OpenDefaultTab, this._openDefaultTab, this);
     
    240240    this._contentElement.setAttribute("aria-label", WebInspector.UIString("Content"));
    241241
    242     this.splitContentBrowser = new WebInspector.ContentBrowser("split-content-browser", this, true, true);
     242    this.splitContentBrowser = new WebInspector.ContentBrowser(document.getElementById("split-content-browser"), this, true, true);
    243243    this.splitContentBrowser.navigationBar.element.addEventListener("mousedown", this._consoleResizerMouseDown.bind(this));
    244244
    245     this.quickConsole = new WebInspector.QuickConsole("quick-console");
     245    this.quickConsole = new WebInspector.QuickConsole(document.getElementById("quick-console"));
    246246    this.quickConsole.addEventListener(WebInspector.QuickConsole.Event.DidResize, this._quickConsoleDidResize, this);
    247247
     
    253253
    254254    // FIXME: The sidebars should be flipped in RTL languages.
    255     this.navigationSidebar = new WebInspector.Sidebar("navigation-sidebar", WebInspector.Sidebar.Sides.Left);
     255    this.navigationSidebar = new WebInspector.Sidebar(document.getElementById("navigation-sidebar"), WebInspector.Sidebar.Sides.Left);
    256256    this.navigationSidebar.addEventListener(WebInspector.Sidebar.Event.WidthDidChange, this._sidebarWidthDidChange, this);
    257257
    258     this.detailsSidebar = new WebInspector.Sidebar("details-sidebar", WebInspector.Sidebar.Sides.Right, null, null, WebInspector.UIString("Details"), true);
     258    this.detailsSidebar = new WebInspector.Sidebar(document.getElementById("details-sidebar"), WebInspector.Sidebar.Sides.Right, null, null, WebInspector.UIString("Details"), true);
    259259    this.detailsSidebar.addEventListener(WebInspector.Sidebar.Event.WidthDidChange, this._sidebarWidthDidChange, this);
    260260
     
    277277    this._openNewTabKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl | WebInspector.KeyboardShortcut.Modifier.Option, "T", this.showNewTabTab.bind(this));
    278278
    279     this.tabBrowser = new WebInspector.TabBrowser("tab-browser", this.tabBar, this.navigationSidebar, this.detailsSidebar);
     279    this.tabBrowser = new WebInspector.TabBrowser(document.getElementById("tab-browser"), this.tabBar, this.navigationSidebar, this.detailsSidebar);
    280280    this.tabBrowser.addEventListener(WebInspector.TabBrowser.Event.SelectedTabContentViewDidChange, this._tabBrowserSelectedTabContentViewDidChange, this);
    281281
  • trunk/Source/WebInspectorUI/UserInterface/Views/View.js

    r206101 r206106  
    2626WebInspector.View = class View extends WebInspector.Object
    2727{
    28     constructor(elementOrIdentifier)
     28    constructor(element)
    2929    {
    3030        super();
    3131
    32         if (elementOrIdentifier instanceof HTMLElement)
    33             this._element = elementOrIdentifier;
    34         else if (typeof elementOrIdentifier === "string") {
    35             this._element = document.getElementById(elementOrIdentifier);
    36             console.assert(this._element, "Couldn't create view for unknown element " + elementOrIdentifier);
    37         }
    38 
    39         this._element = this._element || document.createElement("div");
     32        this._element = element || document.createElement("div");
    4033        this._element.__view = this;
    4134        this._parentView = null;
Note: See TracChangeset for help on using the changeset viewer.