Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(197)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js

Issue 2356423002: [DevTools] Turn WebInspector.Panel into a web component.
Patch Set: partial fixes Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
4 * Copyright (C) 2009 Joseph Pecoraro 4 * Copyright (C) 2009 Joseph Pecoraro
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 24 matching lines...) Expand all
35 * @implements {WebInspector.ViewLocationResolver} 35 * @implements {WebInspector.ViewLocationResolver}
36 * @extends {WebInspector.Panel} 36 * @extends {WebInspector.Panel}
37 */ 37 */
38 WebInspector.ElementsPanel = function() 38 WebInspector.ElementsPanel = function()
39 { 39 {
40 WebInspector.Panel.call(this, "elements"); 40 WebInspector.Panel.call(this, "elements");
41 this.registerRequiredCSS("elements/elementsPanel.css"); 41 this.registerRequiredCSS("elements/elementsPanel.css");
42 42
43 this._splitWidget = new WebInspector.SplitWidget(true, true, "elementsPanelS plitViewState", 325, 325); 43 this._splitWidget = new WebInspector.SplitWidget(true, true, "elementsPanelS plitViewState", 325, 325);
44 this._splitWidget.addEventListener(WebInspector.SplitWidget.Events.SidebarSi zeChanged, this._updateTreeOutlineVisibleWidth.bind(this)); 44 this._splitWidget.addEventListener(WebInspector.SplitWidget.Events.SidebarSi zeChanged, this._updateTreeOutlineVisibleWidth.bind(this));
45 this._splitWidget.show(this.element); 45 this._splitWidget.show(this.contentElement);
46 46
47 this._searchableView = new WebInspector.SearchableView(this); 47 this._searchableView = new WebInspector.SearchableView(this);
48 this._searchableView.setMinimumSize(25, 28); 48 this._searchableView.setMinimumSize(25, 28);
49 this._searchableView.setPlaceholder(WebInspector.UIString("Find by string, s elector, or XPath")); 49 this._searchableView.setPlaceholder(WebInspector.UIString("Find by string, s elector, or XPath"));
50 var stackElement = this._searchableView.element; 50 var stackElement = this._searchableView.element;
51 51
52 this._contentElement = createElement("div"); 52 this._contentElement = createElement("div");
53 var crumbsContainer = createElement("div"); 53 var crumbsContainer = createElement("div");
54 stackElement.appendChild(this._contentElement); 54 stackElement.appendChild(this._contentElement);
55 stackElement.appendChild(crumbsContainer); 55 stackElement.appendChild(crumbsContainer);
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 this._contentElement.removeChild(treeOutline.element); 307 this._contentElement.removeChild(treeOutline.element);
308 } 308 }
309 if (this._popoverHelper) 309 if (this._popoverHelper)
310 this._popoverHelper.hidePopover(); 310 this._popoverHelper.hidePopover();
311 WebInspector.Panel.prototype.willHide.call(this); 311 WebInspector.Panel.prototype.willHide.call(this);
312 }, 312 },
313 313
314 onResize: function() 314 onResize: function()
315 { 315 {
316 if (WebInspector.moduleSetting("sidebarPosition").get() === "auto") 316 if (WebInspector.moduleSetting("sidebarPosition").get() === "auto")
317 this.element.window().requestAnimationFrame(this._updateSidebarPosit ion.bind(this)); // Do not force layout. 317 this.contentElement.window().requestAnimationFrame(this._updateSideb arPosition.bind(this)); // Do not force layout.
318 this._updateTreeOutlineVisibleWidth(); 318 this._updateTreeOutlineVisibleWidth();
319 }, 319 },
320 320
321 /** 321 /**
322 * @param {!WebInspector.Event} event 322 * @param {!WebInspector.Event} event
323 */ 323 */
324 _selectedNodeChanged: function(event) 324 _selectedNodeChanged: function(event)
325 { 325 {
326 var selectedNode = /** @type {?WebInspector.DOMNode} */ (event.data); 326 var selectedNode = /** @type {?WebInspector.DOMNode} */ (event.data);
327 for (var i = 0; i < this._treeOutlines.length; ++i) { 327 for (var i = 0; i < this._treeOutlines.length; ++i) {
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after
1115 /** 1115 /**
1116 * @override 1116 * @override
1117 * @param {!WebInspector.DOMNode} node 1117 * @param {!WebInspector.DOMNode} node
1118 * @return {?{title: string, color: string}} 1118 * @return {?{title: string, color: string}}
1119 */ 1119 */
1120 decorate: function(node) 1120 decorate: function(node)
1121 { 1121 {
1122 return { color: "orange", title: WebInspector.UIString("Element state: % s", ":" + WebInspector.CSSModel.fromNode(node).pseudoState(node).join(", :")) }; 1122 return { color: "orange", title: WebInspector.UIString("Element state: % s", ":" + WebInspector.CSSModel.fromNode(node).pseudoState(node).join(", :")) };
1123 } 1123 }
1124 } 1124 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698