| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> | 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> |
| 4 * Copyright (C) 2009 Joseph Pecoraro | 4 * Copyright (C) 2009 Joseph Pecoraro |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * | 9 * |
| 10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
| (...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 if (typeof searchResult.node === 'undefined') { | 628 if (typeof searchResult.node === 'undefined') { |
| 629 // No data for slot, request it. | 629 // No data for slot, request it. |
| 630 searchResult.domModel.searchResult(searchResult.index).then(node => { | 630 searchResult.domModel.searchResult(searchResult.index).then(node => { |
| 631 searchResult.node = node; | 631 searchResult.node = node; |
| 632 this._highlightCurrentSearchResult(); | 632 this._highlightCurrentSearchResult(); |
| 633 }); | 633 }); |
| 634 return; | 634 return; |
| 635 } | 635 } |
| 636 | 636 |
| 637 var treeElement = this._treeElementForNode(searchResult.node); | 637 var treeElement = this._treeElementForNode(searchResult.node); |
| 638 searchResult.node.scrollIntoView(); |
| 638 if (treeElement) { | 639 if (treeElement) { |
| 639 treeElement.highlightSearchResults(this._searchConfig.query); | 640 treeElement.highlightSearchResults(this._searchConfig.query); |
| 640 treeElement.reveal(); | 641 treeElement.reveal(); |
| 641 var matches = treeElement.listItemElement.getElementsByClassName(UI.highli
ghtedSearchResultClassName); | 642 var matches = treeElement.listItemElement.getElementsByClassName(UI.highli
ghtedSearchResultClassName); |
| 642 if (matches.length) | 643 if (matches.length) |
| 643 matches[0].scrollIntoViewIfNeeded(false); | 644 matches[0].scrollIntoViewIfNeeded(false); |
| 644 } | 645 } |
| 645 } | 646 } |
| 646 | 647 |
| 647 _hideSearchHighlights() { | 648 _hideSearchHighlights() { |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1071 * @param {!SDK.DOMNode} node | 1072 * @param {!SDK.DOMNode} node |
| 1072 * @return {?{title: string, color: string}} | 1073 * @return {?{title: string, color: string}} |
| 1073 */ | 1074 */ |
| 1074 decorate(node) { | 1075 decorate(node) { |
| 1075 return { | 1076 return { |
| 1076 color: 'orange', | 1077 color: 'orange', |
| 1077 title: Common.UIString('Element state: %s', ':' + node.domModel().cssModel
().pseudoState(node).join(', :')) | 1078 title: Common.UIString('Element state: %s', ':' + node.domModel().cssModel
().pseudoState(node).join(', :')) |
| 1078 }; | 1079 }; |
| 1079 } | 1080 } |
| 1080 }; | 1081 }; |
| OLD | NEW |