| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r
ights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r
ights reserved. |
| 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
| 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
| 9 * Copyright (C) 2013 Google Inc. All rights reserved. | 9 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 10 * | 10 * |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 { | 90 { |
| 91 Frame* frame = frameForSecurityContext(); | 91 Frame* frame = frameForSecurityContext(); |
| 92 return (frame && frame->ownerElement()) || !m_url.isEmpty(); | 92 return (frame && frame->ownerElement()) || !m_url.isEmpty(); |
| 93 } | 93 } |
| 94 | 94 |
| 95 bool DocumentInit::shouldTreatURLAsSrcdocDocument() const | 95 bool DocumentInit::shouldTreatURLAsSrcdocDocument() const |
| 96 { | 96 { |
| 97 return m_parent && m_frame->loader().shouldTreatURLAsSrcdocDocument(m_url); | 97 return m_parent && m_frame->loader().shouldTreatURLAsSrcdocDocument(m_url); |
| 98 } | 98 } |
| 99 | 99 |
| 100 bool DocumentInit::isSeamlessAllowedFor(Document* child) const | |
| 101 { | |
| 102 if (!m_parent) | |
| 103 return false; | |
| 104 if (m_parent->isSandboxed(SandboxSeamlessIframes)) | |
| 105 return false; | |
| 106 if (child->isSrcdocDocument()) | |
| 107 return true; | |
| 108 if (m_parent->securityOrigin()->canAccess(child->securityOrigin())) | |
| 109 return true; | |
| 110 return m_parent->securityOrigin()->canRequest(child->url()); | |
| 111 } | |
| 112 | |
| 113 Frame* DocumentInit::frameForSecurityContext() const | 100 Frame* DocumentInit::frameForSecurityContext() const |
| 114 { | 101 { |
| 115 if (m_frame) | 102 if (m_frame) |
| 116 return m_frame; | 103 return m_frame; |
| 117 if (m_import) | 104 if (m_import) |
| 118 return m_import->frame(); | 105 return m_import->frame(); |
| 119 return 0; | 106 return 0; |
| 120 } | 107 } |
| 121 | 108 |
| 122 SandboxFlags DocumentInit::sandboxFlags() const | 109 SandboxFlags DocumentInit::sandboxFlags() const |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 return m_contextDocument; | 149 return m_contextDocument; |
| 163 } | 150 } |
| 164 | 151 |
| 165 DocumentInit DocumentInit::fromContext(WeakPtr<Document> contextDocument, const
KURL& url) | 152 DocumentInit DocumentInit::fromContext(WeakPtr<Document> contextDocument, const
KURL& url) |
| 166 { | 153 { |
| 167 return DocumentInit(url, 0, contextDocument, 0); | 154 return DocumentInit(url, 0, contextDocument, 0); |
| 168 } | 155 } |
| 169 | 156 |
| 170 } // namespace WebCore | 157 } // namespace WebCore |
| 171 | 158 |
| OLD | NEW |