Changeset 206106 in webkit
- Timestamp:
- Sep 19, 2016 12:08:45 PM (8 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r206105 r206106 1 2016-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 1 13 2016-09-19 Joseph Pecoraro <pecoraro@apple.com> 2 14 … … 11 23 Default the functionName to the empty string. This will compare 12 24 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 element17 https://bugs.webkit.org/show_bug.cgi?id=16216518 <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, create30 a default element.31 25 32 26 2016-09-19 Joseph Pecoraro <pecoraro@apple.com> -
trunk/Source/WebInspectorUI/UserInterface/Base/Main.js
r206101 r206106 228 228 229 229 // 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); 231 231 this.toolbar.displayMode = WebInspector.Toolbar.DisplayMode.IconOnly; 232 232 this.toolbar.sizeMode = WebInspector.Toolbar.SizeMode.Small; 233 233 234 this.tabBar = new WebInspector.TabBar( "tab-bar");234 this.tabBar = new WebInspector.TabBar(document.getElementById("tab-bar")); 235 235 this.tabBar.addEventListener(WebInspector.TabBar.Event.NewTabItemClicked, this._newTabItemClicked, this); 236 236 this.tabBar.addEventListener(WebInspector.TabBar.Event.OpenDefaultTab, this._openDefaultTab, this); … … 240 240 this._contentElement.setAttribute("aria-label", WebInspector.UIString("Content")); 241 241 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); 243 243 this.splitContentBrowser.navigationBar.element.addEventListener("mousedown", this._consoleResizerMouseDown.bind(this)); 244 244 245 this.quickConsole = new WebInspector.QuickConsole( "quick-console");245 this.quickConsole = new WebInspector.QuickConsole(document.getElementById("quick-console")); 246 246 this.quickConsole.addEventListener(WebInspector.QuickConsole.Event.DidResize, this._quickConsoleDidResize, this); 247 247 … … 253 253 254 254 // 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); 256 256 this.navigationSidebar.addEventListener(WebInspector.Sidebar.Event.WidthDidChange, this._sidebarWidthDidChange, this); 257 257 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); 259 259 this.detailsSidebar.addEventListener(WebInspector.Sidebar.Event.WidthDidChange, this._sidebarWidthDidChange, this); 260 260 … … 277 277 this._openNewTabKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl | WebInspector.KeyboardShortcut.Modifier.Option, "T", this.showNewTabTab.bind(this)); 278 278 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); 280 280 this.tabBrowser.addEventListener(WebInspector.TabBrowser.Event.SelectedTabContentViewDidChange, this._tabBrowserSelectedTabContentViewDidChange, this); 281 281 -
trunk/Source/WebInspectorUI/UserInterface/Views/View.js
r206101 r206106 26 26 WebInspector.View = class View extends WebInspector.Object 27 27 { 28 constructor(element OrIdentifier)28 constructor(element) 29 29 { 30 30 super(); 31 31 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"); 40 33 this._element.__view = this; 41 34 this._parentView = null;
Note: See TracChangeset
for help on using the changeset viewer.