Chromium Code Reviews| Index: Source/devtools/front_end/ui/UIUtils.js |
| diff --git a/Source/devtools/front_end/ui/UIUtils.js b/Source/devtools/front_end/ui/UIUtils.js |
| index 62bce6d70212b9851418b62f133749f79630835f..0a8c2a09c25d07867ad331490038a9aaa7c480d5 100644 |
| --- a/Source/devtools/front_end/ui/UIUtils.js |
| +++ b/Source/devtools/front_end/ui/UIUtils.js |
| @@ -29,6 +29,9 @@ |
| * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| */ |
| +WebInspector.highlightedSearchResultClassName = "highlighted-search-result"; |
| +WebInspector.currentHighlightedSearchResultClassName = "current-search-result"; |
| + |
| /** |
| * @param {!Element} element |
| * @param {?function(!MouseEvent): boolean} elementDragStart |
| @@ -788,7 +791,8 @@ WebInspector.highlightSearchResult = function(element, offset, length, domChange |
| */ |
| WebInspector.highlightSearchResults = function(element, resultRanges, changes) |
|
lushnikov
2014/11/07 16:27:19
This method exists by mistake, it's not general. L
aknudsen
2014/11/08 12:00:53
Acknowledged.
aknudsen
2014/11/09 00:02:14
Done.
|
| { |
| - return WebInspector.highlightRangesWithStyleClass(element, resultRanges, "highlighted-search-result", changes); |
| + return WebInspector.highlightRangesWithStyleClass(element, resultRanges, |
| + WebInspector.highlightedSearchResultClassName, changes); |
| } |
| /** |
| @@ -796,7 +800,9 @@ WebInspector.highlightSearchResults = function(element, resultRanges, changes) |
| */ |
| WebInspector.removeSearchResultsHighlight = function(element) |
|
lushnikov
2014/11/07 16:27:19
this method should accept one more argument - styl
aknudsen
2014/11/08 12:00:53
Acknowledged.
aknudsen
2014/11/09 00:02:14
Done.
|
| { |
| - var highlightBits = element.querySelectorAll(".highlighted-search-result"); |
| + var query = "." + WebInspector.highlightedSearchResultClassName + ",." + |
| + WebInspector.currentHighlightedSearchResultClassName; |
| + var highlightBits = element.querySelectorAll(query); |
| for (var i = 0; i < highlightBits.length; ++i) { |
| var span = highlightBits[i]; |
| span.parentElement.replaceChild(createTextNode(span.textContent), span); |