зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1341562 - fix CustomizableUI's overflow insertion to not break if buttons aren't where we expect them, r=jaws
MozReview-Commit-ID: Fs9IYC4bvL9 --HG-- extra : rebase_source : af948f85e4675b0e83abbe6e554646b13603111a
This commit is contained in:
Родитель
5a12fa89ac
Коммит
29bf378255
|
@ -4215,7 +4215,10 @@ OverflowableToolbar.prototype = {
|
|||
let inserted = false;
|
||||
for (; beforeNodeIndex < placements.length; beforeNodeIndex++) {
|
||||
let beforeNode = this._target.getElementsByAttribute("id", placements[beforeNodeIndex])[0];
|
||||
if (beforeNode) {
|
||||
// Unfortunately, XUL add-ons can mess with nodes after they are inserted,
|
||||
// and this breaks the following code if the button isn't where we expect
|
||||
// it to be (ie not a child of the target). In this case, ignore the node.
|
||||
if (beforeNode && this._target == beforeNode.parentElement) {
|
||||
this._target.insertBefore(child, beforeNode);
|
||||
inserted = true;
|
||||
break;
|
||||
|
|
Загрузка…
Ссылка в новой задаче