@@ -1,5 +1,8 @@
+import cache from '../core/base/cache';
+
 function windowIsTopMatches(node) {
 	return (
+		cache.get('isTopWindow') ||
 		node.ownerDocument.defaultView.self === node.ownerDocument.defaultView.top
 	);
 }
function windowIsTopMatches(node) {
	return (
		node.ownerDocument.defaultView.self === node.ownerDocument.defaultView.top
	);
}

export default windowIsTopMatches;

Why not pass the options around, or record what we think is the top level in the context object and pass that around? This is basically using the cache as a way to create global variables. Global variables is something we're trying to get out of, lets not add more of them.