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

Unified Diff: third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeElement.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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeElement.js
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeElement.js b/third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeElement.js
index 32f18f1ca3783193d8e29ac3b565b01344b93f61..9b8180d47af5c4e341dec331748e3c40757f6361 100644
--- a/third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeElement.js
+++ b/third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeElement.js
@@ -460,15 +460,13 @@ Elements.ElementsTreeElement = class extends UI.TreeElement {
populateTagContextMenu(contextMenu, event) {
// Add attribute-related actions.
var treeElement = this._elementCloseTag ? this.treeOutline.findTreeElement(this._node) : this;
- contextMenu.appendItem(
- Common.UIString.capitalize('Add ^attribute'), treeElement._addNewAttribute.bind(treeElement));
+ contextMenu.appendItem(Common.UIString('Add attribute'), treeElement._addNewAttribute.bind(treeElement));
var attribute = event.target.enclosingNodeOrSelfWithClass('webkit-html-attribute');
var newAttribute = event.target.enclosingNodeOrSelfWithClass('add-attribute');
if (attribute && !newAttribute) {
contextMenu.appendItem(
- Common.UIString.capitalize('Edit ^attribute'),
- this._startEditingAttribute.bind(this, attribute, event.target));
+ Common.UIString('Edit attribute'), this._startEditingAttribute.bind(this, attribute, event.target));
}
this.populateNodeContextMenu(contextMenu);
Elements.ElementsTreeElement.populateForcedPseudoStateItems(contextMenu, treeElement.node());
@@ -480,12 +478,12 @@ Elements.ElementsTreeElement = class extends UI.TreeElement {
* @param {!UI.ContextMenu} contextMenu
*/
populateScrollIntoView(contextMenu) {
- contextMenu.appendItem(Common.UIString.capitalize('Scroll into ^view'), this._scrollIntoView.bind(this));
+ contextMenu.appendItem(Common.UIString('Scroll into view'), () => this._node.scrollIntoView());
}
populateTextContextMenu(contextMenu, textNode) {
if (!this._editing)
- contextMenu.appendItem(Common.UIString.capitalize('Edit ^text'), this._startEditingTextNode.bind(this, textNode));
+ contextMenu.appendItem(Common.UIString('Edit text'), this._startEditingTextNode.bind(this, textNode));
this.populateNodeContextMenu(contextMenu);
}
@@ -508,7 +506,7 @@ Elements.ElementsTreeElement = class extends UI.TreeElement {
menuItem.setShortcut(createShortcut('V', modifier));
}
if (this._node.nodeType() === Node.ELEMENT_NODE)
- copyMenu.appendItem(Common.UIString.capitalize('Copy selector'), this._copyCSSPath.bind(this));
+ copyMenu.appendItem(Common.UIString('Copy selector'), this._copyCSSPath.bind(this));
if (!isShadowRoot)
copyMenu.appendItem(Common.UIString('Copy XPath'), this._copyXPath.bind(this));
if (!isShadowRoot) {
@@ -1629,23 +1627,6 @@ Elements.ElementsTreeElement = class extends UI.TreeElement {
UI.highlightSearchResults(this.listItemElement, matchRanges, this._highlightResult);
}
- _scrollIntoView() {
- function scrollIntoViewCallback(object) {
- /**
- * @suppressReceiverCheck
- * @this {!Element}
- */
- function scrollIntoView() {
- this.scrollIntoViewIfNeeded(true);
- }
-
- if (object)
- object.callFunction(scrollIntoView);
- }
-
- this._node.resolveToObject('', scrollIntoViewCallback);
- }
-
_editAsHTML() {
var promise = Common.Revealer.revealPromise(this.node());
promise.then(() => UI.actionRegistry.action('elements.edit-as-html').execute());

Powered by Google App Engine
This is Rietveld 408576698