| Index: third_party/WebKit/Source/devtools/front_end/components/ObjectPropertiesSection.js
|
| diff --git a/third_party/WebKit/Source/devtools/front_end/components/ObjectPropertiesSection.js b/third_party/WebKit/Source/devtools/front_end/components/ObjectPropertiesSection.js
|
| index 6ce99dc00c1f1c94d3aad73d8a81079a16be65ce..0185ab8db2cc3962b61e354d929110dfcef5bbf7 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/components/ObjectPropertiesSection.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/components/ObjectPropertiesSection.js
|
| @@ -213,9 +213,55 @@ WebInspector.ObjectPropertyTreeElement = function(property)
|
| TreeElement.call(this);
|
| this.toggleOnClick = true;
|
| this.selectable = false;
|
| + /** @type {!Array.<!Object>} */
|
| + this._highlightChanges = [];
|
| }
|
|
|
| WebInspector.ObjectPropertyTreeElement.prototype = {
|
| + /**
|
| + * @param {!RegExp} regex
|
| + * @param {string=} additionalCssClassName
|
| + * @return {boolean}
|
| + */
|
| + setSearchRegex: function(regex, additionalCssClassName) {
|
| + var cssClasses = WebInspector.highlightedSearchResultClassName;
|
| + if (additionalCssClassName)
|
| + cssClasses += " " + additionalCssClassName;
|
| + this.revertHighlightChanges();
|
| +
|
| + this._applySearch(regex, this.nameElement, cssClasses);
|
| + var valueType = this.property.value.type;
|
| + if (valueType !== "object" && valueType !== "array")
|
| + this._applySearch(regex, this.valueElement, cssClasses);
|
| +
|
| + return !!this._highlightChanges.length;
|
| + },
|
| +
|
| + /**
|
| + * @param {!RegExp} regex
|
| + * @param {!Element} element
|
| + * @param {string} cssClassName
|
| + */
|
| + _applySearch: function(regex, element, cssClassName)
|
| + {
|
| + var ranges = [];
|
| + var content = element.textContent;
|
| + regex.lastIndex = 0;
|
| + var match = regex.exec(content);
|
| + while (match) {
|
| + ranges.push(new WebInspector.SourceRange(match.index, match[0].length));
|
| + match = regex.exec(content);
|
| + }
|
| + if (ranges.length)
|
| + WebInspector.highlightRangesWithStyleClass(element, ranges, cssClassName, this._highlightChanges);
|
| + },
|
| +
|
| + revertHighlightChanges: function()
|
| + {
|
| + WebInspector.revertDomChanges(this._highlightChanges);
|
| + this._highlightChanges = [];
|
| + },
|
| +
|
| onpopulate: function()
|
| {
|
| var propertyValue = /** @type {!WebInspector.RemoteObject} */ (this.property.value);
|
|
|