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

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: Set Frame's inert bit on style calculation 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 3eefa4fb1b4e989b32a932a7221951863416ce44..af2d790a62a58feef4a6202c0b3a1b1600da890e 100644
--- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp
+++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
@@ -572,6 +572,27 @@ 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());
+ // Only propagate if there is a change to the child's inert bit. This
+ // prevents redundant recursions through the Frame tree during style
+ // calculation.
+ bool new_value =
+ is_inert_ || ToHTMLFrameOwnerElement(child->Owner())->IsInert();
+ if (new_value != child->IsInert())
+ child->SetIsInert(new_value);
+ }
+ }
+}
+
LocalFrame& LocalFrame::LocalFrameRoot() const {
const LocalFrame* cur_frame = this;
while (cur_frame && cur_frame->Tree().Parent() &&
@@ -899,6 +920,7 @@ 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()) {

Powered by Google App Engine
This is Rietveld 408576698