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

Side by Side 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: alexmos comments 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Simon Hausmann <hausmann@kde.org> 5 * 2000 Simon Hausmann <hausmann@kde.org>
6 * 2000 Stefan Schimanski <1Stein@gmx.de> 6 * 2000 Stefan Schimanski <1Stein@gmx.de>
7 * 2001 George Staikos <staikos@kde.org> 7 * 2001 George Staikos <staikos@kde.org>
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
9 * rights reserved. 9 * rights reserved.
10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> 10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com>
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 return LayoutViewItem(ContentLayoutObject()); 584 return LayoutViewItem(ContentLayoutObject());
585 } 585 }
586 586
587 void LocalFrame::DidChangeVisibilityState() { 587 void LocalFrame::DidChangeVisibilityState() {
588 if (GetDocument()) 588 if (GetDocument())
589 GetDocument()->DidChangeVisibilityState(); 589 GetDocument()->DidChangeVisibilityState();
590 590
591 Frame::DidChangeVisibilityState(); 591 Frame::DidChangeVisibilityState();
592 } 592 }
593 593
594 void LocalFrame::SetIsInert(bool inert) {
595 is_inert_ = inert;
596 PropagateInertToChildFrames();
597 }
598
599 void LocalFrame::PropagateInertToChildFrames() {
600 for (Frame* child = Tree().FirstChild(); child;
601 child = child->Tree().NextSibling()) {
602 child->SetIsInert(is_inert_ ||
603 ToHTMLFrameOwnerElement(child->Owner())->IsInert());
604 }
605 }
606
594 LocalFrame& LocalFrame::LocalFrameRoot() const { 607 LocalFrame& LocalFrame::LocalFrameRoot() const {
595 const LocalFrame* cur_frame = this; 608 const LocalFrame* cur_frame = this;
596 while (cur_frame && cur_frame->Tree().Parent() && 609 while (cur_frame && cur_frame->Tree().Parent() &&
597 cur_frame->Tree().Parent()->IsLocalFrame()) 610 cur_frame->Tree().Parent()->IsLocalFrame())
598 cur_frame = ToLocalFrame(cur_frame->Tree().Parent()); 611 cur_frame = ToLocalFrame(cur_frame->Tree().Parent());
599 612
600 return const_cast<LocalFrame&>(*cur_frame); 613 return const_cast<LocalFrame&>(*cur_frame);
601 } 614 }
602 615
603 bool LocalFrame::IsCrossOriginSubframe() const { 616 bool LocalFrame::IsCrossOriginSubframe() const {
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
928 interface_provider_(interface_provider), 941 interface_provider_(interface_provider),
929 interface_registry_(interface_registry) { 942 interface_registry_(interface_registry) {
930 if (FrameResourceCoordinator::IsEnabled()) { 943 if (FrameResourceCoordinator::IsEnabled()) {
931 frame_resource_coordinator_ = 944 frame_resource_coordinator_ =
932 FrameResourceCoordinator::Create(interface_provider); 945 FrameResourceCoordinator::Create(interface_provider);
933 } 946 }
934 if (IsLocalRoot()) { 947 if (IsLocalRoot()) {
935 probe_sink_ = new CoreProbeSink(); 948 probe_sink_ = new CoreProbeSink();
936 performance_monitor_ = new PerformanceMonitor(this); 949 performance_monitor_ = new PerformanceMonitor(this);
937 } else { 950 } else {
951 // Inertness only needs to be updated if this frame might inherit the
952 // inert state from a higher-level frame. If this is an OOPIF local root,
953 // it will be updated later.
954 UpdateInertIfPossible();
938 probe_sink_ = LocalFrameRoot().probe_sink_; 955 probe_sink_ = LocalFrameRoot().probe_sink_;
939 performance_monitor_ = LocalFrameRoot().performance_monitor_; 956 performance_monitor_ = LocalFrameRoot().performance_monitor_;
940 } 957 }
941 } 958 }
942 959
943 WebFrameScheduler* LocalFrame::FrameScheduler() { 960 WebFrameScheduler* LocalFrame::FrameScheduler() {
944 return frame_scheduler_.get(); 961 return frame_scheduler_.get();
945 } 962 }
946 963
947 void LocalFrame::ScheduleVisualUpdateUnlessThrottled() { 964 void LocalFrame::ScheduleVisualUpdateUnlessThrottled() {
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
1234 void LocalFrame::SetViewportIntersectionFromParent( 1251 void LocalFrame::SetViewportIntersectionFromParent(
1235 const IntRect& viewport_intersection) { 1252 const IntRect& viewport_intersection) {
1236 if (remote_viewport_intersection_ != viewport_intersection) { 1253 if (remote_viewport_intersection_ != viewport_intersection) {
1237 remote_viewport_intersection_ = viewport_intersection; 1254 remote_viewport_intersection_ = viewport_intersection;
1238 if (View()) 1255 if (View())
1239 View()->ScheduleAnimation(); 1256 View()->ScheduleAnimation();
1240 } 1257 }
1241 } 1258 }
1242 1259
1243 } // namespace blink 1260 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698