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

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

Issue 317493002: Change FrameTree to return Frames instead of LocalFrames. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: dcheng's comment addressed Created 6 years, 6 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
« no previous file with comments | « Source/bindings/v8/custom/V8WindowCustom.cpp ('k') | Source/core/dom/DocumentInit.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 80516f7ebdf0216048199be1008093e544af6a04..d3ff7e416ef064d37ab0cf9a617667826fd9bde1 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -3229,7 +3229,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);
@@ -4449,8 +4449,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
@@ -4488,10 +4493,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
@@ -4853,7 +4858,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);
}
« no previous file with comments | « Source/bindings/v8/custom/V8WindowCustom.cpp ('k') | Source/core/dom/DocumentInit.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698