Bug 1512581 - Match original behaviour of insertbefore/insertafter attributes; r=Fallen DONTBUILD
authorGeoff Lankow <geoff@darktrojan.net>
Fri, 21 Dec 2018 22:27:05 +1300
changeset 34043 8a7f1cf1ba4e940788ac10a522dcd4cc1ff3cd5a
parent 34042 08d2439c136503d104edf824264d221dfbcebaf6
child 34044 1f255495f7a15d5b8094512f76cf8078b2a61e76
push id389
push userclokep@gmail.com
push dateMon, 18 Mar 2019 19:01:53 +0000
reviewersFallen
bugs1512581
Bug 1512581 - Match original behaviour of insertbefore/insertafter attributes; r=Fallen DONTBUILD
common/src/Overlays.jsm
--- a/common/src/Overlays.jsm
+++ b/common/src/Overlays.jsm
@@ -349,17 +349,17 @@ class Overlays {
     }
 
     if (pos) {
       for (let id of pos.split(",")) {
         let targetchild = this.document.getElementById(id);
         if (targetchild && targetchild.parentNode == parent) {
           parent.insertBefore(node, after ? targetchild.nextSibling : targetchild);
           wasInserted = true;
-          // Not breaking here to match original behavior
+          break;
         }
       }
     }
 
     if (!wasInserted) {
       // position is 1-based
       let position = parseInt(node.getAttribute("position"), 10);
       if (position > 0 && (position - 1) <= parent.childNodes.length) {