diff --git a/src/lib/dom-api-shady.html b/src/lib/dom-api-shady.html
index 46d445ce89..0e0b24a297 100644
--- a/src/lib/dom-api-shady.html
+++ b/src/lib/dom-api-shady.html
@@ -188,7 +188,7 @@
// can be cached while an element is inside a fragment.
// If this happens and we cache the result, the value can become stale
// because for perf we avoid processing the subtree of added fragments.
- if (root || document.contains(node)) {
+ if (root || document.documentElement.contains(node)) {
node._ownerShadyRoot = root;
}
}