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

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: Restore earlier approach + UpdateDistribution() 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();
alexmos 2017/06/16 02:17:57 Should this also only be done if |is_inert_| was d
kenrb 2017/06/19 19:26:23 No, because sometimes the propagation to child fra
alexmos 2017/06/20 18:46:10 Acknowledged.
597 }
598
599 void LocalFrame::PropagateInertToChildFrames() {
600 for (Frame* child = Tree().FirstChild(); child;
601 child = child->Tree().NextSibling()) {
alexmos 2017/06/16 02:17:57 How does this walk work for nested RemoteFrames?
kenrb 2017/06/19 19:26:23 From within Blink, we don't know if nested OOPIFs
alexmos 2017/06/20 18:46:10 I was thinking that if we just send the IPC to all
kenrb 2017/06/22 15:33:35 There is another problem here. Think about a(b(c))
alexmos 2017/06/22 17:09:27 Acknowledged - I agree that's a good reason to kee
602 if (child->Owner()) {
alexmos 2017/06/16 02:17:57 Is there any case where this could be null, given
kenrb 2017/06/19 19:26:23 Maybe not. I've removed it and layout tests seem t
603 child->SetIsInert(is_inert_ ||
604 ToHTMLFrameOwnerElement(child->Owner())->IsInert());
alexmos 2017/06/16 02:17:57 When would is_inert_ be different from ToHTMLFrame
kenrb 2017/06/19 19:26:23 If child->Owner()->IsInert() returns true, it mean
alexmos 2017/06/20 18:46:10 Thanks for clearing up my confusion. :) It might
kenrb 2017/06/22 15:33:35 Done.
605 }
606 }
607 }
608
594 LocalFrame& LocalFrame::LocalFrameRoot() const { 609 LocalFrame& LocalFrame::LocalFrameRoot() const {
595 const LocalFrame* cur_frame = this; 610 const LocalFrame* cur_frame = this;
596 while (cur_frame && cur_frame->Tree().Parent() && 611 while (cur_frame && cur_frame->Tree().Parent() &&
597 cur_frame->Tree().Parent()->IsLocalFrame()) 612 cur_frame->Tree().Parent()->IsLocalFrame())
598 cur_frame = ToLocalFrame(cur_frame->Tree().Parent()); 613 cur_frame = ToLocalFrame(cur_frame->Tree().Parent());
599 614
600 return const_cast<LocalFrame&>(*cur_frame); 615 return const_cast<LocalFrame&>(*cur_frame);
601 } 616 }
602 617
603 bool LocalFrame::IsCrossOriginSubframe() const { 618 bool LocalFrame::IsCrossOriginSubframe() const {
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
918 editor_(Editor::Create(*this)), 933 editor_(Editor::Create(*this)),
919 spell_checker_(SpellChecker::Create(*this)), 934 spell_checker_(SpellChecker::Create(*this)),
920 selection_(FrameSelection::Create(*this)), 935 selection_(FrameSelection::Create(*this)),
921 event_handler_(new EventHandler(*this)), 936 event_handler_(new EventHandler(*this)),
922 console_(FrameConsole::Create(*this)), 937 console_(FrameConsole::Create(*this)),
923 input_method_controller_(InputMethodController::Create(*this)), 938 input_method_controller_(InputMethodController::Create(*this)),
924 navigation_disable_count_(0), 939 navigation_disable_count_(0),
925 page_zoom_factor_(ParentPageZoomFactor(this)), 940 page_zoom_factor_(ParentPageZoomFactor(this)),
926 text_zoom_factor_(ParentTextZoomFactor(this)), 941 text_zoom_factor_(ParentTextZoomFactor(this)),
927 in_view_source_mode_(false), 942 in_view_source_mode_(false),
943 is_inert_(false),
928 interface_provider_(interface_provider), 944 interface_provider_(interface_provider),
929 interface_registry_(interface_registry) { 945 interface_registry_(interface_registry) {
930 if (FrameResourceCoordinator::IsEnabled()) { 946 if (FrameResourceCoordinator::IsEnabled()) {
931 frame_resource_coordinator_ = 947 frame_resource_coordinator_ =
932 FrameResourceCoordinator::Create(interface_provider); 948 FrameResourceCoordinator::Create(interface_provider);
933 } 949 }
934 if (IsLocalRoot()) { 950 if (IsLocalRoot()) {
935 probe_sink_ = new CoreProbeSink(); 951 probe_sink_ = new CoreProbeSink();
936 performance_monitor_ = new PerformanceMonitor(this); 952 performance_monitor_ = new PerformanceMonitor(this);
937 } else { 953 } else {
954 UpdateInertIfPossible();
alexmos 2017/06/16 02:17:57 Perhaps a comment about why this is not needed for
kenrb 2017/06/19 19:26:23 Done.
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