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

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: Account for Inert attribute 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 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 return LayoutViewItem(ContentLayoutObject()); 565 return LayoutViewItem(ContentLayoutObject());
566 } 566 }
567 567
568 void LocalFrame::DidChangeVisibilityState() { 568 void LocalFrame::DidChangeVisibilityState() {
569 if (GetDocument()) 569 if (GetDocument())
570 GetDocument()->DidChangeVisibilityState(); 570 GetDocument()->DidChangeVisibilityState();
571 571
572 Frame::DidChangeVisibilityState(); 572 Frame::DidChangeVisibilityState();
573 } 573 }
574 574
575 void LocalFrame::SetIsInert(bool inert) {
576 is_inert_ = inert;
577 PropagateInertToChildFrames();
578 }
579
580 void LocalFrame::PropagateInertToChildFrames() {
581 for (Frame* child = Tree().FirstChild(); child;
582 child = child->Tree().NextSibling()) {
583 if (child->Owner()) {
584 DCHECK(child->Owner()->IsLocal());
585 child->SetIsInert(is_inert_ ||
586 ToHTMLFrameOwnerElement(child->Owner())->IsInert());
587 }
588 }
589 }
590
575 LocalFrame& LocalFrame::LocalFrameRoot() const { 591 LocalFrame& LocalFrame::LocalFrameRoot() const {
576 const LocalFrame* cur_frame = this; 592 const LocalFrame* cur_frame = this;
577 while (cur_frame && cur_frame->Tree().Parent() && 593 while (cur_frame && cur_frame->Tree().Parent() &&
578 cur_frame->Tree().Parent()->IsLocalFrame()) 594 cur_frame->Tree().Parent()->IsLocalFrame())
579 cur_frame = ToLocalFrame(cur_frame->Tree().Parent()); 595 cur_frame = ToLocalFrame(cur_frame->Tree().Parent());
580 596
581 return const_cast<LocalFrame&>(*cur_frame); 597 return const_cast<LocalFrame&>(*cur_frame);
582 } 598 }
583 599
584 bool LocalFrame::IsCrossOriginSubframe() const { 600 bool LocalFrame::IsCrossOriginSubframe() const {
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 editor_(Editor::Create(*this)), 908 editor_(Editor::Create(*this)),
893 spell_checker_(SpellChecker::Create(*this)), 909 spell_checker_(SpellChecker::Create(*this)),
894 selection_(FrameSelection::Create(*this)), 910 selection_(FrameSelection::Create(*this)),
895 event_handler_(new EventHandler(*this)), 911 event_handler_(new EventHandler(*this)),
896 console_(FrameConsole::Create(*this)), 912 console_(FrameConsole::Create(*this)),
897 input_method_controller_(InputMethodController::Create(*this)), 913 input_method_controller_(InputMethodController::Create(*this)),
898 navigation_disable_count_(0), 914 navigation_disable_count_(0),
899 page_zoom_factor_(ParentPageZoomFactor(this)), 915 page_zoom_factor_(ParentPageZoomFactor(this)),
900 text_zoom_factor_(ParentTextZoomFactor(this)), 916 text_zoom_factor_(ParentTextZoomFactor(this)),
901 in_view_source_mode_(false), 917 in_view_source_mode_(false),
918 is_inert_(false),
902 interface_provider_(interface_provider), 919 interface_provider_(interface_provider),
903 interface_registry_(interface_registry) { 920 interface_registry_(interface_registry) {
904 if (IsLocalRoot()) { 921 if (IsLocalRoot()) {
905 probe_sink_ = new CoreProbeSink(); 922 probe_sink_ = new CoreProbeSink();
906 performance_monitor_ = new PerformanceMonitor(this); 923 performance_monitor_ = new PerformanceMonitor(this);
907 } else { 924 } else {
925 // Frames that are not local roots always have owners that are DOM nodes.
926 if (ToHTMLFrameOwnerElement(owner)->IsInert())
927 SetIsInert(true);
908 probe_sink_ = LocalFrameRoot().probe_sink_; 928 probe_sink_ = LocalFrameRoot().probe_sink_;
909 performance_monitor_ = LocalFrameRoot().performance_monitor_; 929 performance_monitor_ = LocalFrameRoot().performance_monitor_;
910 } 930 }
911 } 931 }
912 932
913 WebFrameScheduler* LocalFrame::FrameScheduler() { 933 WebFrameScheduler* LocalFrame::FrameScheduler() {
914 return frame_scheduler_.get(); 934 return frame_scheduler_.get();
915 } 935 }
916 936
917 void LocalFrame::ScheduleVisualUpdateUnlessThrottled() { 937 void LocalFrame::ScheduleVisualUpdateUnlessThrottled() {
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
1195 node = GetDocument()->FocusedElement(); 1215 node = GetDocument()->FocusedElement();
1196 } 1216 }
1197 1217
1198 if (node) { 1218 if (node) {
1199 return node->GetWebPluginContainerBase(); 1219 return node->GetWebPluginContainerBase();
1200 } 1220 }
1201 return nullptr; 1221 return nullptr;
1202 } 1222 }
1203 1223
1204 } // namespace blink 1224 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698