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

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: 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 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 // Only propagate if there is a change to the child's inert bit. This
586 // prevents redundant recursions through the Frame tree during style
587 // calculation.
588 bool new_value =
589 is_inert_ || ToHTMLFrameOwnerElement(child->Owner())->IsInert();
590 if (new_value != child->IsInert())
591 child->SetIsInert(new_value);
592 }
593 }
594 }
595
575 LocalFrame& LocalFrame::LocalFrameRoot() const { 596 LocalFrame& LocalFrame::LocalFrameRoot() const {
576 const LocalFrame* cur_frame = this; 597 const LocalFrame* cur_frame = this;
577 while (cur_frame && cur_frame->Tree().Parent() && 598 while (cur_frame && cur_frame->Tree().Parent() &&
578 cur_frame->Tree().Parent()->IsLocalFrame()) 599 cur_frame->Tree().Parent()->IsLocalFrame())
579 cur_frame = ToLocalFrame(cur_frame->Tree().Parent()); 600 cur_frame = ToLocalFrame(cur_frame->Tree().Parent());
580 601
581 return const_cast<LocalFrame&>(*cur_frame); 602 return const_cast<LocalFrame&>(*cur_frame);
582 } 603 }
583 604
584 bool LocalFrame::IsCrossOriginSubframe() const { 605 bool LocalFrame::IsCrossOriginSubframe() const {
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 editor_(Editor::Create(*this)), 913 editor_(Editor::Create(*this)),
893 spell_checker_(SpellChecker::Create(*this)), 914 spell_checker_(SpellChecker::Create(*this)),
894 selection_(FrameSelection::Create(*this)), 915 selection_(FrameSelection::Create(*this)),
895 event_handler_(new EventHandler(*this)), 916 event_handler_(new EventHandler(*this)),
896 console_(FrameConsole::Create(*this)), 917 console_(FrameConsole::Create(*this)),
897 input_method_controller_(InputMethodController::Create(*this)), 918 input_method_controller_(InputMethodController::Create(*this)),
898 navigation_disable_count_(0), 919 navigation_disable_count_(0),
899 page_zoom_factor_(ParentPageZoomFactor(this)), 920 page_zoom_factor_(ParentPageZoomFactor(this)),
900 text_zoom_factor_(ParentTextZoomFactor(this)), 921 text_zoom_factor_(ParentTextZoomFactor(this)),
901 in_view_source_mode_(false), 922 in_view_source_mode_(false),
923 is_inert_(false),
902 interface_provider_(interface_provider), 924 interface_provider_(interface_provider),
903 interface_registry_(interface_registry) { 925 interface_registry_(interface_registry) {
904 if (IsLocalRoot()) { 926 if (IsLocalRoot()) {
905 probe_sink_ = new CoreProbeSink(); 927 probe_sink_ = new CoreProbeSink();
906 performance_monitor_ = new PerformanceMonitor(this); 928 performance_monitor_ = new PerformanceMonitor(this);
907 } else { 929 } else {
908 probe_sink_ = LocalFrameRoot().probe_sink_; 930 probe_sink_ = LocalFrameRoot().probe_sink_;
909 performance_monitor_ = LocalFrameRoot().performance_monitor_; 931 performance_monitor_ = LocalFrameRoot().performance_monitor_;
910 } 932 }
911 } 933 }
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
1195 node = GetDocument()->FocusedElement(); 1217 node = GetDocument()->FocusedElement();
1196 } 1218 }
1197 1219
1198 if (node) { 1220 if (node) {
1199 return node->GetWebPluginContainerBase(); 1221 return node->GetWebPluginContainerBase();
1200 } 1222 }
1201 return nullptr; 1223 return nullptr;
1202 } 1224 }
1203 1225
1204 } // namespace blink 1226 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698