Bug 1409088: followup: Reword no longer accurate part of the comment in RemoveDestInsertionPoint. r=me
authorEmilio Cobos Álvarez <emilio@crisal.io>
Fri, 20 Oct 2017 00:19:58 +0200
changeset 683852 36a03481388877058ced00d03297b918f0eda378
parent 683851 544b2dfa1b065fb49ea6f4b84edaa1cc95d5df86
child 683853 ff9088972319ed49297b6cbd134e1d3fb121ed64
push id85474
push userbmo:emilio@crisal.io
push dateFri, 20 Oct 2017 10:02:12 +0000
reviewersme
bugs1409088
milestone58.0a1
Bug 1409088: followup: Reword no longer accurate part of the comment in RemoveDestInsertionPoint. r=me MozReview-Commit-ID: 2gbxreSgkqi
dom/base/ShadowRoot.cpp
--- a/dom/base/ShadowRoot.cpp
+++ b/dom/base/ShadowRoot.cpp
@@ -233,18 +233,21 @@ ShadowRoot::RemoveInsertionPoint(HTMLCon
   mInsertionPoints.RemoveElement(aInsertionPoint);
 }
 
 void
 ShadowRoot::RemoveDestInsertionPoint(nsIContent* aInsertionPoint,
                                      nsTArray<nsIContent*>& aDestInsertionPoints)
 {
   // Remove the insertion point from the destination insertion points.
-  // Also remove all succeeding insertion points because it is no longer
-  // possible for the content to be distributed into deeper node trees.
+  //
+  // Note that while it sounds tempting to just remove all the insertion points
+  // after it too, since they're usually after in tree position, it may not be
+  // the case when we're redistributing after new insertion points have been
+  // bound to the tree before aInsertionPoint, see bug 1409088.
   int32_t index = aDestInsertionPoints.IndexOf(aInsertionPoint);
 
   // It's possible that we already removed the insertion point while processing
   // other insertion point removals / fallback content redistribution (which
   // does DestInsertionPoints().Clear()).
   if (index >= 0) {
     aDestInsertionPoints.RemoveElementAt(index);
   }