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

Unified Diff: third_party/WebKit/Source/core/frame/LocalFrame.cpp

Issue 2883033003: Propagate inert state to OOPIFs when a modal dialog is active (Closed)
Patch Set: nit addressed Created 3 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
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 f64499cace3090cb8a1f0c2b51782436600182e2..1235b4eef95c9e6388cc2b78d93d9ea5fd415a15 100644
--- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp
+++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
@@ -600,6 +600,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()) {
+ // is_inert_ means that this Frame is inert because of a modal dialog or
+ // inert element in an ancestor Frame. Otherwise, decide whether a child
+ // Frame element is inert because of an element in this Frame.
+ child->SetIsInert(is_inert_ ||
+ ToHTMLFrameOwnerElement(child->Owner())->IsInert());
+ }
+}
+
LocalFrame& LocalFrame::LocalFrameRoot() const {
const LocalFrame* cur_frame = this;
while (cur_frame && cur_frame->Tree().Parent() &&
@@ -950,6 +966,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_;
}
« no previous file with comments | « third_party/WebKit/Source/core/frame/LocalFrame.h ('k') | third_party/WebKit/Source/core/frame/RemoteFrame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698