Index: third_party/WebKit/Source/core/dom/Document.cpp |
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp |
index 0e123a4bd445c26378da5f43e2689b6c21d2a9c0..b8bb6474ab3db3ce89ac6d5e0c8cbe212ba90fe6 100644 |
--- a/third_party/WebKit/Source/core/dom/Document.cpp |
+++ b/third_party/WebKit/Source/core/dom/Document.cpp |
@@ -3355,9 +3355,14 @@ bool Document::isSecureContextImpl(const SecureContextCheck privilegeContextChec |
return true; |
if (privilegeContextCheck == StandardSecureContextCheck) { |
- Frame* parent = m_frame ? m_frame->tree().parent() : nullptr; |
- if (parent && !parent->canHaveSecureChild()) |
- return false; |
+ if (!m_frame) |
+ return true; |
+ Frame* parent = m_frame->tree().parent(); |
+ while (parent) { |
+ if (!parent->securityContext()->getSecurityOrigin()->isPotentiallyTrustworthy()) |
+ return false; |
+ parent = parent->tree().parent(); |
+ } |
} |
return true; |
} |