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 * @implements {UI.Searchable} | 5 * @implements {UI.Searchable} |
6 * @unrestricted | 6 * @unrestricted |
7 */ | 7 */ |
8 Network.XMLView = class extends UI.Widget { | 8 Network.XMLView = class extends UI.Widget { |
9 /** | 9 /** |
10 * @param {!Document} parsedXML | 10 * @param {!Document} parsedXML |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 if (this._closeTag && this.parent && !this.parent.expanded) | 263 if (this._closeTag && this.parent && !this.parent.expanded) |
264 return false; | 264 return false; |
265 regex.lastIndex = 0; | 265 regex.lastIndex = 0; |
266 var cssClasses = UI.highlightedSearchResultClassName; | 266 var cssClasses = UI.highlightedSearchResultClassName; |
267 if (additionalCssClassName) | 267 if (additionalCssClassName) |
268 cssClasses += ' ' + additionalCssClassName; | 268 cssClasses += ' ' + additionalCssClassName; |
269 var content = this.listItemElement.textContent.replace(/\xA0/g, ' '); | 269 var content = this.listItemElement.textContent.replace(/\xA0/g, ' '); |
270 var match = regex.exec(content); | 270 var match = regex.exec(content); |
271 var ranges = []; | 271 var ranges = []; |
272 while (match) { | 272 while (match) { |
273 ranges.push(new Common.SourceRange(match.index, match[0].length)); | 273 ranges.push(new TextUtils.SourceRange(match.index, match[0].length)); |
274 match = regex.exec(content); | 274 match = regex.exec(content); |
275 } | 275 } |
276 if (ranges.length) | 276 if (ranges.length) |
277 UI.highlightRangesWithStyleClass(this.listItemElement, ranges, cssClasses,
this._highlightChanges); | 277 UI.highlightRangesWithStyleClass(this.listItemElement, ranges, cssClasses,
this._highlightChanges); |
278 return !!this._highlightChanges.length; | 278 return !!this._highlightChanges.length; |
279 } | 279 } |
280 | 280 |
281 revertHighlightChanges() { | 281 revertHighlightChanges() { |
282 UI.revertDomChanges(this._highlightChanges); | 282 UI.revertDomChanges(this._highlightChanges); |
283 this._highlightChanges = []; | 283 this._highlightChanges = []; |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 } | 366 } |
367 | 367 |
368 /** | 368 /** |
369 * @override | 369 * @override |
370 */ | 370 */ |
371 onpopulate() { | 371 onpopulate() { |
372 Network.XMLView.Node.populate(this, this._node, this._xmlView); | 372 Network.XMLView.Node.populate(this, this._node, this._xmlView); |
373 this.appendChild(new Network.XMLView.Node(this._node, true, this._xmlView)); | 373 this.appendChild(new Network.XMLView.Node(this._node, true, this._xmlView)); |
374 } | 374 } |
375 }; | 375 }; |
OLD | NEW |