Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js

Issue 2932543002: DevTools: reveal and highlight dom nodes when searching in elements panel. (Closed)
Patch Set: rebaseline Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 if (typeof searchResult.node === 'undefined') { 545 if (typeof searchResult.node === 'undefined') {
546 // No data for slot, request it. 546 // No data for slot, request it.
547 searchResult.domModel.searchResult(searchResult.index).then(node => { 547 searchResult.domModel.searchResult(searchResult.index).then(node => {
548 searchResult.node = node; 548 searchResult.node = node;
549 this._highlightCurrentSearchResult(); 549 this._highlightCurrentSearchResult();
550 }); 550 });
551 return; 551 return;
552 } 552 }
553 553
554 var treeElement = this._treeElementForNode(searchResult.node); 554 var treeElement = this._treeElementForNode(searchResult.node);
555 searchResult.node.scrollIntoView();
555 if (treeElement) { 556 if (treeElement) {
556 treeElement.highlightSearchResults(this._searchConfig.query); 557 treeElement.highlightSearchResults(this._searchConfig.query);
557 treeElement.reveal(); 558 treeElement.reveal();
558 var matches = treeElement.listItemElement.getElementsByClassName(UI.highli ghtedSearchResultClassName); 559 var matches = treeElement.listItemElement.getElementsByClassName(UI.highli ghtedSearchResultClassName);
559 if (matches.length) 560 if (matches.length)
560 matches[0].scrollIntoViewIfNeeded(false); 561 matches[0].scrollIntoViewIfNeeded(false);
561 } 562 }
562 } 563 }
563 564
564 _hideSearchHighlights() { 565 _hideSearchHighlights() {
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
985 * @param {!SDK.DOMNode} node 986 * @param {!SDK.DOMNode} node
986 * @return {?{title: string, color: string}} 987 * @return {?{title: string, color: string}}
987 */ 988 */
988 decorate(node) { 989 decorate(node) {
989 return { 990 return {
990 color: 'orange', 991 color: 'orange',
991 title: Common.UIString('Element state: %s', ':' + node.domModel().cssModel ().pseudoState(node).join(', :')) 992 title: Common.UIString('Element state: %s', ':' + node.domModel().cssModel ().pseudoState(node).join(', :'))
992 }; 993 };
993 } 994 }
994 }; 995 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698