| Index: Source/core/dom/Document.cpp
|
| diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
|
| index 3a90c178a88d041444bf57a4addda7cce0883608..0daf4ed02694f228742f2bde7dd9826c7d61ac2a 100644
|
| --- a/Source/core/dom/Document.cpp
|
| +++ b/Source/core/dom/Document.cpp
|
| @@ -3228,7 +3228,7 @@ String Document::outgoingReferrer()
|
| if (LocalFrame* frame = m_frame) {
|
| while (frame->document()->isSrcdocDocument()) {
|
| // Srcdoc documents must be local within the containing frame.
|
| - frame = frame->tree().parent();
|
| + frame = toLocalFrame(frame->tree().parent());
|
| // Srcdoc documents cannot be top-level documents, by definition,
|
| // because they need to be contained in iframes with the srcdoc.
|
| ASSERT(frame);
|
| @@ -4448,8 +4448,13 @@ void Document::setTransformSource(PassOwnPtr<TransformSource> source)
|
| void Document::setDesignMode(InheritedBool value)
|
| {
|
| m_designMode = value;
|
| - for (LocalFrame* frame = m_frame; frame && frame->document(); frame = frame->tree().traverseNext(m_frame))
|
| - frame->document()->setNeedsStyleRecalc(SubtreeStyleChange);
|
| + for (Frame* frame = m_frame; frame; frame = frame->tree().traverseNext(m_frame)) {
|
| + if (!frame->isLocalFrame())
|
| + continue;
|
| + if (!toLocalFrame(frame)->document())
|
| + break;
|
| + toLocalFrame(frame)->document()->setNeedsStyleRecalc(SubtreeStyleChange);
|
| + }
|
| }
|
|
|
| Document::InheritedBool Document::getDesignMode() const
|
| @@ -4487,10 +4492,10 @@ Document* Document::parentDocument() const
|
| {
|
| if (!m_frame)
|
| return 0;
|
| - LocalFrame* parent = m_frame->tree().parent();
|
| - if (!parent)
|
| + Frame* parent = m_frame->tree().parent();
|
| + if (!parent || !parent->isLocalFrame())
|
| return 0;
|
| - return parent->document();
|
| + return toLocalFrame(parent)->document();
|
| }
|
|
|
| Document& Document::topDocument() const
|
| @@ -4852,7 +4857,7 @@ void Document::initSecurityContext(const DocumentInit& initializer)
|
| void Document::initContentSecurityPolicy(const ContentSecurityPolicyResponseHeaders& headers)
|
| {
|
| if (m_frame && m_frame->tree().parent() && m_frame->tree().parent()->isLocalFrame() && (shouldInheritSecurityOriginFromOwner(m_url) || isPluginDocument()))
|
| - contentSecurityPolicy()->copyStateFrom(m_frame->tree().parent()->document()->contentSecurityPolicy());
|
| + contentSecurityPolicy()->copyStateFrom(toLocalFrame(m_frame->tree().parent())->document()->contentSecurityPolicy());
|
| contentSecurityPolicy()->didReceiveHeaders(headers);
|
| }
|
|
|
|
|