Bug 1512581 - Match original behaviour of insertbefore/insertafter attributes; r=Fallen a=jorgk
authorGeoff Lankow <geoff@darktrojan.net>
Fri, 21 Dec 2018 22:27:05 +1300
changeset 33898 994a012451923d399d70cb0b00cb63146e2ac312
parent 33897 44241fb0b16211fe4e3cbe66c7689e9c742e9730
child 33899 61f7be1b30e13797c65b4313c40e6f56abe2251d
push id388
push userclokep@gmail.com
push dateMon, 28 Jan 2019 20:54:56 +0000
reviewersFallen, jorgk
bugs1512581
Bug 1512581 - Match original behaviour of insertbefore/insertafter attributes; r=Fallen a=jorgk
common/src/Overlays.jsm
--- a/common/src/Overlays.jsm
+++ b/common/src/Overlays.jsm
@@ -351,17 +351,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) {