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

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

Issue 2770743004: DevTools: improve $0 selected element hint in elements (Closed)
Patch Set: ac Created 3 years, 8 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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 _createSelection() { 229 _createSelection() {
230 var listItemElement = this.listItemElement; 230 var listItemElement = this.listItemElement;
231 if (!listItemElement) 231 if (!listItemElement)
232 return; 232 return;
233 233
234 if (!this.selectionElement) { 234 if (!this.selectionElement) {
235 this.selectionElement = createElement('div'); 235 this.selectionElement = createElement('div');
236 this.selectionElement.className = 'selection fill'; 236 this.selectionElement.className = 'selection fill';
237 this.selectionElement.style.setProperty('margin-left', (-this._computeLeft Indent()) + 'px'); 237 this.selectionElement.style.setProperty('margin-left', (-this._computeLeft Indent()) + 'px');
238 listItemElement.insertBefore(this.selectionElement, listItemElement.firstC hild); 238 listItemElement.insertBefore(this.selectionElement, listItemElement.firstC hild);
239
240 var hintElement = listItemElement.createChild('div', 'selected-hint');
lushnikov 2017/03/24 22:05:11 you gonna re-create this multiple times on .update
luoe 2017/03/25 01:38:23 I've added a check to make sure a hintElement does
241 hintElement.title = Common.UIString('Use $0 in the console to refer to thi s element.');
239 } 242 }
240 } 243 }
241 244
242 /** 245 /**
243 * @override 246 * @override
244 */ 247 */
245 onbind() { 248 onbind() {
246 if (!this._elementCloseTag) 249 if (!this._elementCloseTag)
247 this._node[this.treeOutline.treeElementSymbol()] = this; 250 this._node[this.treeOutline.treeElementSymbol()] = this;
248 } 251 }
(...skipping 1360 matching lines...) Expand 10 before | Expand all | Expand 10 after
1609 Elements.ElementsTreeElement.ForbiddenClosingTagElements = new Set([ 1612 Elements.ElementsTreeElement.ForbiddenClosingTagElements = new Set([
1610 'area', 'base', 'basefont', 'br', 'canvas', 'col', 'command', 'embed', 'frame', 'hr', 1613 'area', 'base', 'basefont', 'br', 'canvas', 'col', 'command', 'embed', 'frame', 'hr',
1611 'img', 'input', 'keygen', 'link', 'menuitem', 'meta', 'param', 'source', 'track', 'wbr' 1614 'img', 'input', 'keygen', 'link', 'menuitem', 'meta', 'param', 'source', 'track', 'wbr'
1612 ]); 1615 ]);
1613 1616
1614 // These tags we do not allow editing their tag name. 1617 // These tags we do not allow editing their tag name.
1615 Elements.ElementsTreeElement.EditTagBlacklist = new Set(['html', 'head', 'body'] ); 1618 Elements.ElementsTreeElement.EditTagBlacklist = new Set(['html', 'head', 'body'] );
1616 1619
1617 /** @typedef {{cancel: function(), commit: function(), resize: function(), edito r:!UI.TextEditor}} */ 1620 /** @typedef {{cancel: function(), commit: function(), resize: function(), edito r:!UI.TextEditor}} */
1618 Elements.MultilineEditorController; 1621 Elements.MultilineEditorController;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698