From 71ce058b03c8dcedb3a3aae9ace842332a4a4bfc Mon Sep 17 00:00:00 2001 From: Moonchild Date: Thu, 23 Nov 2023 14:44:33 +0100 Subject: [PATCH] [DOM] Check if rootDoc is secure context for web compat --- dom/security/nsMixedContentBlocker.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dom/security/nsMixedContentBlocker.cpp b/dom/security/nsMixedContentBlocker.cpp index 031bc27db7..f980acf018 100644 --- a/dom/security/nsMixedContentBlocker.cpp +++ b/dom/security/nsMixedContentBlocker.cpp @@ -729,10 +729,10 @@ nsMixedContentBlocker::ShouldLoad(bool aHadInsecureImageRedirect, docShell->GetSameTypeRootTreeItem(getter_AddRefs(sameTypeRoot)); NS_ASSERTION(sameTypeRoot, "No root tree item from docshell!"); - // When navigating an iframe, the iframe may be https - // but its parents may not be. Check the parents to see if any of them are https. - // If none of the parents are https, allow the load. - if (aContentType == TYPE_SUBDOCUMENT && !rootHasSecureConnection) { + // When navigating an iframe, the iframe may be https but its parents may not + // be. Check the parents to see if any of them are https. If none of the + // parents are https, allow the load. + if (aContentType == TYPE_SUBDOCUMENT && !rootHasSecureConnection && !parentIsHttps) { bool httpsParentExists = false;