diff --git a/src/mini/shady.html b/src/mini/shady.html
index cb9b7137d3..8d96fc7b57 100644
--- a/src/mini/shady.html
+++ b/src/mini/shady.html
@@ -129,6 +129,10 @@
_finishDistribute: function() {
// compose self
if (this._useContent) {
+ // note: it's important to mark this clean before distribution
+ // so that attachment that provokes additional distribution (e.g.
+ // adding something to your parentNode) works
+ this.shadyRoot._distributionClean = true;
if (hasInsertionPoint(this.shadyRoot)) {
this._composeTree();
} else {
@@ -146,7 +150,6 @@
}
}
this.shadyRoot._hasDistributed = true;
- this.shadyRoot._distributionClean = true;
}
},