Index: third_party/WebKit/Source/core/frame/LocalFrame.cpp |
diff --git a/third_party/WebKit/Source/core/frame/LocalFrame.cpp b/third_party/WebKit/Source/core/frame/LocalFrame.cpp |
index 3eefa4fb1b4e989b32a932a7221951863416ce44..52784bbec51c9fbc576bb699638cca218b3fb85a 100644 |
--- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp |
+++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp |
@@ -572,6 +572,22 @@ void LocalFrame::DidChangeVisibilityState() { |
Frame::DidChangeVisibilityState(); |
} |
+void LocalFrame::SetIsInert(bool inert) { |
+ is_inert_ = inert; |
+ PropagateInertToChildFrames(); |
+} |
+ |
+void LocalFrame::PropagateInertToChildFrames() { |
+ for (Frame* child = Tree().FirstChild(); child; |
+ child = child->Tree().NextSibling()) { |
+ if (child->Owner()) { |
+ DCHECK(child->Owner()->IsLocal()); |
+ child->SetIsInert(is_inert_ || |
+ ToHTMLFrameOwnerElement(child->Owner())->IsInert()); |
+ } |
+ } |
+} |
+ |
LocalFrame& LocalFrame::LocalFrameRoot() const { |
const LocalFrame* cur_frame = this; |
while (cur_frame && cur_frame->Tree().Parent() && |
@@ -899,12 +915,16 @@ inline LocalFrame::LocalFrame(LocalFrameClient* client, |
page_zoom_factor_(ParentPageZoomFactor(this)), |
text_zoom_factor_(ParentTextZoomFactor(this)), |
in_view_source_mode_(false), |
+ is_inert_(false), |
interface_provider_(interface_provider), |
interface_registry_(interface_registry) { |
if (IsLocalRoot()) { |
probe_sink_ = new CoreProbeSink(); |
performance_monitor_ = new PerformanceMonitor(this); |
} else { |
+ // Frames that are not local roots always have owners that are DOM nodes. |
+ if (ToHTMLFrameOwnerElement(owner)->IsInert()) |
+ SetIsInert(true); |
probe_sink_ = LocalFrameRoot().probe_sink_; |
performance_monitor_ = LocalFrameRoot().performance_monitor_; |
} |