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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui/Tooltip.js

Issue 2551283002: [DevTools] Fix null tooltip errors (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 /** 4 /**
5 * @unrestricted 5 * @unrestricted
6 */ 6 */
7 UI.Tooltip = class { 7 UI.Tooltip = class {
8 /** 8 /**
9 * @param {!Document} doc 9 * @param {!Document} doc
10 */ 10 */
(...skipping 11 matching lines...) Expand all
22 } 22 }
23 23
24 /** 24 /**
25 * @param {!Document} doc 25 * @param {!Document} doc
26 */ 26 */
27 static installHandler(doc) { 27 static installHandler(doc) {
28 new UI.Tooltip(doc); 28 new UI.Tooltip(doc);
29 } 29 }
30 30
31 /** 31 /**
32 * Installs the tooltipContent to be shown on mouseover, called when title is set on an Element.
lushnikov 2016/12/06 01:19:37 style: please, drop the documentation comment (i k
paulirish 2016/12/06 01:37:27 Isn't that old policy? Blink is open to comments f
lushnikov 2016/12/06 22:30:23 Let's discuss this on Thursday! We should either
phulce 2016/12/06 23:09:32 Done.
33 * Removes the tooltip if content is null or empty.
34 *
32 * @param {!Element} element 35 * @param {!Element} element
33 * @param {!Element|string} tooltipContent 36 * @param {?Element|string} tooltipContent
34 * @param {string=} actionId 37 * @param {string=} actionId
35 * @param {!Object=} options 38 * @param {!Object=} options
36 */ 39 */
37 static install(element, tooltipContent, actionId, options) { 40 static install(element, tooltipContent, actionId, options) {
38 if (typeof tooltipContent === 'string' && tooltipContent === '') { 41 if (tooltipContent === null || tooltipContent === '') {
lushnikov 2016/12/06 01:19:36 if (!tooltipContent) { ... }
phulce 2016/12/06 23:09:32 Done.
39 delete element[UI.Tooltip._symbol]; 42 delete element[UI.Tooltip._symbol];
40 return; 43 return;
41 } 44 }
42 element[UI.Tooltip._symbol] = {content: tooltipContent, actionId: actionId, options: options || {}}; 45 element[UI.Tooltip._symbol] = {content: tooltipContent, actionId: actionId, options: options || {}};
43 } 46 }
44 47
45 /** 48 /**
46 * @param {!Element} element 49 * @param {!Element} element
47 */ 50 */
48 static addNativeOverrideContainer(element) { 51 static addNativeOverrideContainer(element) {
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 }, 194 },
192 195
193 /** 196 /**
194 * @param {!Element|string} x 197 * @param {!Element|string} x
195 * @this {!Element} 198 * @this {!Element}
196 */ 199 */
197 set: function(x) { 200 set: function(x) {
198 UI.Tooltip.install(this, x); 201 UI.Tooltip.install(this, x);
199 } 202 }
200 }); 203 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698