We have a WebCore-side experimental feature "WebAPIsInShadowRealms", which is automatically enabled for imported WPT tests. However, we still fail those tests, because ShadowRealm is not exposed on the global object in JSC. Ideally, we'd have a way to enable all JSC experimental flags when WebCore experimental flags are enabled, but since this is (as far as I'm aware) the only case thus far where this is actually needed, it seems simpler to just temporarily come up with an easy way to make this happen and get tests passing.
<rdar://problem/101647673>