| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |