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 6e6ca09fc502cf82686a4eef346e100a1c46d0c3..052a225c0b5083e7891a3571870c03151b03633d 100644 |
--- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp |
+++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp |
@@ -591,6 +591,19 @@ 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()) { |
+ child->SetIsInert(is_inert_ || |
+ ToHTMLFrameOwnerElement(child->Owner())->IsInert()); |
+ } |
+} |
+ |
LocalFrame& LocalFrame::LocalFrameRoot() const { |
const LocalFrame* cur_frame = this; |
while (cur_frame && cur_frame->Tree().Parent() && |
@@ -935,6 +948,10 @@ inline LocalFrame::LocalFrame(LocalFrameClient* client, |
probe_sink_ = new CoreProbeSink(); |
performance_monitor_ = new PerformanceMonitor(this); |
} else { |
+ // Inertness only needs to be updated if this frame might inherit the |
+ // inert state from a higher-level frame. If this is an OOPIF local root, |
+ // it will be updated later. |
+ UpdateInertIfPossible(); |
probe_sink_ = LocalFrameRoot().probe_sink_; |
performance_monitor_ = LocalFrameRoot().performance_monitor_; |
} |