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

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

Issue 2551283002: [DevTools] Fix null tooltip errors (Closed)
Patch Set: address feedback 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 12 matching lines...) Expand all
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 * @param {!Element} element 32 * @param {!Element} element
33 * @param {!Element|string} tooltipContent 33 * @param {?Element|string} tooltipContent
34 * @param {string=} actionId 34 * @param {string=} actionId
35 * @param {!Object=} options 35 * @param {!Object=} options
36 */ 36 */
37 static install(element, tooltipContent, actionId, options) { 37 static install(element, tooltipContent, actionId, options) {
38 if (typeof tooltipContent === 'string' && tooltipContent === '') { 38 if (!tooltipContent) {
39 delete element[UI.Tooltip._symbol]; 39 delete element[UI.Tooltip._symbol];
40 return; 40 return;
41 } 41 }
42 element[UI.Tooltip._symbol] = {content: tooltipContent, actionId: actionId, options: options || {}}; 42 element[UI.Tooltip._symbol] = {content: tooltipContent, actionId: actionId, options: options || {}};
43 } 43 }
44 44
45 /** 45 /**
46 * @param {!Element} element 46 * @param {!Element} element
47 */ 47 */
48 static addNativeOverrideContainer(element) { 48 static addNativeOverrideContainer(element) {
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 }, 191 },
192 192
193 /** 193 /**
194 * @param {!Element|string} x 194 * @param {!Element|string} x
195 * @this {!Element} 195 * @this {!Element}
196 */ 196 */
197 set: function(x) { 197 set: function(x) {
198 UI.Tooltip.install(this, x); 198 UI.Tooltip.install(this, x);
199 } 199 }
200 }); 200 });
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