OLD | NEW |
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 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 return LayoutViewItem(ContentLayoutObject()); | 593 return LayoutViewItem(ContentLayoutObject()); |
594 } | 594 } |
595 | 595 |
596 void LocalFrame::DidChangeVisibilityState() { | 596 void LocalFrame::DidChangeVisibilityState() { |
597 if (GetDocument()) | 597 if (GetDocument()) |
598 GetDocument()->DidChangeVisibilityState(); | 598 GetDocument()->DidChangeVisibilityState(); |
599 | 599 |
600 Frame::DidChangeVisibilityState(); | 600 Frame::DidChangeVisibilityState(); |
601 } | 601 } |
602 | 602 |
| 603 void LocalFrame::SetIsInert(bool inert) { |
| 604 is_inert_ = inert; |
| 605 PropagateInertToChildFrames(); |
| 606 } |
| 607 |
| 608 void LocalFrame::PropagateInertToChildFrames() { |
| 609 for (Frame* child = Tree().FirstChild(); child; |
| 610 child = child->Tree().NextSibling()) { |
| 611 // is_inert_ means that this Frame is inert because of a modal dialog or |
| 612 // inert element in an ancestor Frame. Otherwise, decide whether a child |
| 613 // Frame element is inert because of an element in this Frame. |
| 614 child->SetIsInert(is_inert_ || |
| 615 ToHTMLFrameOwnerElement(child->Owner())->IsInert()); |
| 616 } |
| 617 } |
| 618 |
603 LocalFrame& LocalFrame::LocalFrameRoot() const { | 619 LocalFrame& LocalFrame::LocalFrameRoot() const { |
604 const LocalFrame* cur_frame = this; | 620 const LocalFrame* cur_frame = this; |
605 while (cur_frame && cur_frame->Tree().Parent() && | 621 while (cur_frame && cur_frame->Tree().Parent() && |
606 cur_frame->Tree().Parent()->IsLocalFrame()) | 622 cur_frame->Tree().Parent()->IsLocalFrame()) |
607 cur_frame = ToLocalFrame(cur_frame->Tree().Parent()); | 623 cur_frame = ToLocalFrame(cur_frame->Tree().Parent()); |
608 | 624 |
609 return const_cast<LocalFrame&>(*cur_frame); | 625 return const_cast<LocalFrame&>(*cur_frame); |
610 } | 626 } |
611 | 627 |
612 bool LocalFrame::IsCrossOriginSubframe() const { | 628 bool LocalFrame::IsCrossOriginSubframe() const { |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
943 interface_provider_(interface_provider), | 959 interface_provider_(interface_provider), |
944 interface_registry_(interface_registry) { | 960 interface_registry_(interface_registry) { |
945 if (FrameResourceCoordinator::IsEnabled()) { | 961 if (FrameResourceCoordinator::IsEnabled()) { |
946 frame_resource_coordinator_ = | 962 frame_resource_coordinator_ = |
947 FrameResourceCoordinator::Create(interface_provider); | 963 FrameResourceCoordinator::Create(interface_provider); |
948 } | 964 } |
949 if (IsLocalRoot()) { | 965 if (IsLocalRoot()) { |
950 probe_sink_ = new CoreProbeSink(); | 966 probe_sink_ = new CoreProbeSink(); |
951 performance_monitor_ = new PerformanceMonitor(this); | 967 performance_monitor_ = new PerformanceMonitor(this); |
952 } else { | 968 } else { |
| 969 // Inertness only needs to be updated if this frame might inherit the |
| 970 // inert state from a higher-level frame. If this is an OOPIF local root, |
| 971 // it will be updated later. |
| 972 UpdateInertIfPossible(); |
953 probe_sink_ = LocalFrameRoot().probe_sink_; | 973 probe_sink_ = LocalFrameRoot().probe_sink_; |
954 performance_monitor_ = LocalFrameRoot().performance_monitor_; | 974 performance_monitor_ = LocalFrameRoot().performance_monitor_; |
955 } | 975 } |
956 } | 976 } |
957 | 977 |
958 WebFrameScheduler* LocalFrame::FrameScheduler() { | 978 WebFrameScheduler* LocalFrame::FrameScheduler() { |
959 return frame_scheduler_.get(); | 979 return frame_scheduler_.get(); |
960 } | 980 } |
961 | 981 |
962 void LocalFrame::ScheduleVisualUpdateUnlessThrottled() { | 982 void LocalFrame::ScheduleVisualUpdateUnlessThrottled() { |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1249 void LocalFrame::SetViewportIntersectionFromParent( | 1269 void LocalFrame::SetViewportIntersectionFromParent( |
1250 const IntRect& viewport_intersection) { | 1270 const IntRect& viewport_intersection) { |
1251 if (remote_viewport_intersection_ != viewport_intersection) { | 1271 if (remote_viewport_intersection_ != viewport_intersection) { |
1252 remote_viewport_intersection_ = viewport_intersection; | 1272 remote_viewport_intersection_ = viewport_intersection; |
1253 if (View()) | 1273 if (View()) |
1254 View()->ScheduleAnimation(); | 1274 View()->ScheduleAnimation(); |
1255 } | 1275 } |
1256 } | 1276 } |
1257 | 1277 |
1258 } // namespace blink | 1278 } // namespace blink |
OLD | NEW |