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 33189 8a7f1cf1ba4e
parent 33188 08d2439c1365
child 33190 1f255495f7a1
push id2368
push userclokep@gmail.com
push dateMon, 28 Jan 2019 21:12:50 +0000
treeherdercomm-beta@56d23c07d815 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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) {