Index: Source/core/dom/DocumentInit.cpp |
diff --git a/Source/core/dom/DocumentInit.cpp b/Source/core/dom/DocumentInit.cpp |
index adf48c24b6932eab4b95cb7beeda5751a70223a3..016e9f082df5bc1548846e68dff4dedc817dd67e 100644 |
--- a/Source/core/dom/DocumentInit.cpp |
+++ b/Source/core/dom/DocumentInit.cpp |
@@ -43,18 +43,30 @@ bool DocumentInit::shouldTreatURLAsSrcdocDocument() const |
return m_frame->loader()->shouldTreatURLAsSrcdocDocument(m_url); |
} |
+Frame* DocumentInit::frameForSecurityContext() const |
+{ |
+ if (m_frame) |
+ return m_frame; |
+ if (m_import) |
+ return m_import->frame(); |
+ return 0; |
+} |
+ |
SandboxFlags DocumentInit::sandboxFlags() const |
{ |
- return m_frame->loader()->effectiveSandboxFlags(); |
+ return frameForSecurityContext()->loader()->effectiveSandboxFlags(); |
Mike West
2013/07/22 14:39:42
It looks like this can now be null?
|
} |
Settings* DocumentInit::settings() const |
{ |
- return m_frame->settings(); |
+ return frameForSecurityContext()->settings(); |
Mike West
2013/07/22 14:39:42
Ditto.
|
} |
Frame* DocumentInit::ownerFrame() const |
{ |
+ if (!m_frame) |
+ return 0; |
+ |
Frame* ownerFrame = m_frame->tree()->parent(); |
if (!ownerFrame) |
ownerFrame = m_frame->loader()->opener(); |