Right now https://w3c.github.io/webappsec-secure-contexts/#gather-ancestors says to include the opener browsing context.
In the case that an http page opens a window and loads a data: URI it should be clear that the data: URI is not secure. If the http page is replaced by an https page then at that point the algo will claim the window the data: URI was loaded in is secure though.