зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1157201 - Prevent exception while hovering the rule-view. r=pbrosset
This commit is contained in:
Родитель
b560b0ca8d
Коммит
11b2ddad6e
|
@ -368,6 +368,8 @@ Tooltip.prototype = {
|
||||||
* A function that accepts a node argument and returns true or false
|
* A function that accepts a node argument and returns true or false
|
||||||
* (or a promise that resolves or rejects) to signify if the tooltip
|
* (or a promise that resolves or rejects) to signify if the tooltip
|
||||||
* should be shown on that node or not.
|
* should be shown on that node or not.
|
||||||
|
* If the promise rejects, it must reject `false` as value.
|
||||||
|
* Any other value is going to be logged as unexpected error.
|
||||||
* Additionally, the function receives a second argument which is the
|
* Additionally, the function receives a second argument which is the
|
||||||
* tooltip instance itself, to be used to add/modify the content of the
|
* tooltip instance itself, to be used to add/modify the content of the
|
||||||
* tooltip if needed. If omitted, the tooltip will be shown everytime.
|
* tooltip if needed. If omitted, the tooltip will be shown everytime.
|
||||||
|
|
|
@ -341,13 +341,13 @@ TooltipsOverlay.prototype = {
|
||||||
let nodeInfo = this.view.getNodeInfo(target);
|
let nodeInfo = this.view.getNodeInfo(target);
|
||||||
if (!nodeInfo) {
|
if (!nodeInfo) {
|
||||||
// The hovered node isn't something we care about
|
// The hovered node isn't something we care about
|
||||||
return promise.reject();
|
return promise.reject(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
let type = this._getTooltipType(nodeInfo);
|
let type = this._getTooltipType(nodeInfo);
|
||||||
if (!type) {
|
if (!type) {
|
||||||
// There is no tooltip type defined for the hovered node
|
// There is no tooltip type defined for the hovered node
|
||||||
return promise.reject();
|
return promise.reject(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.isRuleView && this.colorPicker.tooltip.isShown()) {
|
if (this.isRuleView && this.colorPicker.tooltip.isShown()) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче