Previously, Blink always treated data: URL iframes as non-secure contexts, 
meaning that all `[SecureContext]`-gated APIs were not exposed in these 
windows.

In https://crrev.com/c/8717534, I'm updating Blink to match the HTML 
Standard and the Secure Contexts Standard. After this, Blink will consider 
data: URL iframes as secure contexts if their top-level context is a secure 
context. Top-level data: URL windows remain insecure as they have been in 
Chrome, and as specified by HTML.

*Compat/interop risk*

Aside from passing a few WPTs (see credentialscontainer-frame-basics 
<https://wpt.fyi/results/credential-management/credentialscontainer-frame-basics.https.html?label=experimental&label=master&aligned>,
 
basic-popup-and-iframe-tests 
<https://wpt.fyi/results/secure-contexts/basic-popup-and-iframe-tests.https.html?label=experimental&label=master&aligned>,
 
etc.), this change brings Chromium in alignment with other browsers. 
Firefox has had this behavior for a while, and Safari recently aligned on 
this behavior too (see https://github.com/WebKit/WebKit/pull/77381).

Compat-wise, the only breakage potential would be for code that *relies* on 
`window.isSecureContext === false` and [SecureContext]-gated APIs *not* being 
present in these frames. I think this is highly unlikely, however the 
change will of course land behind the `DataUrlSubframeSecureContext` flag, 
enabled by default, which can act as a kill-switch.

*Isolated Web Apps compat*: before this change, IWAs kept 
isolated-context-only APIs (Direct Sockets, Smart Card, Web Printing, ...) 
out of data: URL iframes by simply relying on the fact that these iframes 
were non-secure contexts. The CL above would've changed this, however to 
preserve this behavior of *not* exposing these APIs to data: URL iframes, I 
landed https://crrev.com/c/8723493 along with IWA owners, to mark 
opaque-origin documents as "never isolated contexts".

*Links*

   - CLs: https://crrev.com/c/8723493, https://crrev.com/c/8717534
   - Bugs: https://crbug.com/584687955, https://crbug.com/417215493
   - 
   Spec: https://html.spec.whatwg.org/multipage/webappapis.html#secure-context, 
https://w3c.github.io/webappsec-secure-contexts/#potentially-trustworthy-url

Thanks,
Dom

-- 
You received this message because you are subscribed to the Google Groups 
"blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/a/chromium.org/d/msgid/blink-dev/86a9831b-5388-4072-8bd2-e31a61a7c2den%40chromium.org.

Reply via email to