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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/network/XMLView.js

Issue 2328643002: [DevTools] Migrate XMLView to TreeOutlineInShadow. (Closed)
Patch Set: Created 4 years, 3 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @constructor 6 * @constructor
7 * @extends {WebInspector.Widget} 7 * @extends {WebInspector.Widget}
8 * @implements {WebInspector.Searchable} 8 * @implements {WebInspector.Searchable}
9 * @param {!Document} parsedXML 9 * @param {!Document} parsedXML
10 */ 10 */
11 WebInspector.XMLView = function(parsedXML) 11 WebInspector.XMLView = function(parsedXML)
12 { 12 {
13 WebInspector.Widget.call(this, true); 13 WebInspector.Widget.call(this, true);
14 this.registerRequiredCSS("network/xmlView.css"); 14 this.registerRequiredCSS("network/xmlView.css");
15 this.contentElement.classList.add("shadow-xml-view", "source-code"); 15 this.contentElement.classList.add("shadow-xml-view", "source-code");
16 this._treeOutline = new TreeOutline(); 16 this._treeOutline = new TreeOutlineInShadow();
17 this._treeOutline.registerRequiredCSS("network/xmlTree.css");
17 this.contentElement.appendChild(this._treeOutline.element); 18 this.contentElement.appendChild(this._treeOutline.element);
18 19
19 /** @type {?WebInspector.SearchableView} */ 20 /** @type {?WebInspector.SearchableView} */
20 this._searchableView; 21 this._searchableView;
21 /** @type {number} */ 22 /** @type {number} */
22 this._currentSearchFocusIndex = 0; 23 this._currentSearchFocusIndex = 0;
23 /** @type {!Array.<!TreeElement>} */ 24 /** @type {!Array.<!TreeElement>} */
24 this._currentSearchTreeElements = []; 25 this._currentSearchTreeElements = [];
25 /** @type {?WebInspector.SearchableView.SearchConfig} */ 26 /** @type {?WebInspector.SearchableView.SearchConfig} */
26 this._searchConfig; 27 this._searchConfig;
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 root.appendChild(new WebInspector.XMLView.Node(currentNode, false, xmlVi ew)); 265 root.appendChild(new WebInspector.XMLView.Node(currentNode, false, xmlVi ew));
265 } 266 }
266 } 267 }
267 268
268 WebInspector.XMLView.Node.prototype = { 269 WebInspector.XMLView.Node.prototype = {
269 /** 270 /**
270 * @param {?RegExp} regex 271 * @param {?RegExp} regex
271 * @param {string=} additionalCssClassName 272 * @param {string=} additionalCssClassName
272 * @return {boolean} 273 * @return {boolean}
273 */ 274 */
274 setSearchRegex: function(regex, additionalCssClassName) { 275 setSearchRegex: function(regex, additionalCssClassName)
276 {
275 this.revertHighlightChanges(); 277 this.revertHighlightChanges();
276 if (!regex) 278 if (!regex)
277 return false; 279 return false;
278 if (this._closeTag && this.parent && !this.parent.expanded) 280 if (this._closeTag && this.parent && !this.parent.expanded)
279 return false; 281 return false;
280 regex.lastIndex = 0; 282 regex.lastIndex = 0;
281 var cssClasses = WebInspector.highlightedSearchResultClassName; 283 var cssClasses = WebInspector.highlightedSearchResultClassName;
282 if (additionalCssClassName) 284 if (additionalCssClassName)
283 cssClasses += " " + additionalCssClassName; 285 cssClasses += " " + additionalCssClassName;
284 var content = this.listItemElement.textContent.replace(/\xA0/g, " "); 286 var content = this.listItemElement.textContent.replace(/\xA0/g, " ");
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 }, 386 },
385 387
386 onpopulate: function() 388 onpopulate: function()
387 { 389 {
388 WebInspector.XMLView.Node.populate(this, this._node, this._xmlView); 390 WebInspector.XMLView.Node.populate(this, this._node, this._xmlView);
389 this.appendChild(new WebInspector.XMLView.Node(this._node, true, this._x mlView)); 391 this.appendChild(new WebInspector.XMLView.Node(this._node, true, this._x mlView));
390 }, 392 },
391 393
392 __proto__: TreeElement.prototype 394 __proto__: TreeElement.prototype
393 } 395 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/BUILD.gn ('k') | third_party/WebKit/Source/devtools/front_end/network/module.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698