Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(533)

Unified Diff: Source/core/dom/DocumentInit.cpp

Issue 19762002: [HTML Imports] Let script of imported document running. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed a failing test. Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/dom/DocumentInit.cpp
diff --git a/Source/core/dom/DocumentInit.cpp b/Source/core/dom/DocumentInit.cpp
index adf48c24b6932eab4b95cb7beeda5751a70223a3..6e6c584c90a3930b7758b6e627d8a2c7a7dc714e 100644
--- a/Source/core/dom/DocumentInit.cpp
+++ b/Source/core/dom/DocumentInit.cpp
@@ -33,24 +33,30 @@
namespace WebCore {
+bool DocumentInit::hasSecurityContextSource() const
+{
+ return contextSourceFrame();
+}
+
bool DocumentInit::shouldSetURL() const
{
- return (m_frame && m_frame->ownerElement()) || !m_url.isEmpty();
+ Frame* frame = contextSourceFrame();
+ return (frame && frame->ownerElement()) || !m_url.isEmpty();
}
bool DocumentInit::shouldTreatURLAsSrcdocDocument() const
{
- return m_frame->loader()->shouldTreatURLAsSrcdocDocument(m_url);
+ return contextSourceFrame()->loader()->shouldTreatURLAsSrcdocDocument(m_url);
}
SandboxFlags DocumentInit::sandboxFlags() const
{
- return m_frame->loader()->effectiveSandboxFlags();
+ return contextSourceFrame()->loader()->effectiveSandboxFlags();
}
Settings* DocumentInit::settings() const
{
- return m_frame->settings();
+ return contextSourceFrame()->settings();
}
Frame* DocumentInit::ownerFrame() const
@@ -61,5 +67,14 @@ Frame* DocumentInit::ownerFrame() const
return ownerFrame;
}
+inline Frame* DocumentInit::contextSourceFrame() const
abarth-chromium 2013/07/19 07:55:55 Why not just sourceFrame() or just frame() ? I do
+{
+ if (m_frame)
+ return m_frame;
+ if (m_import)
+ return m_import->frame();
+ return 0;
+}
+
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698