Chromium Code Reviews| Index: third_party/WebKit/Source/core/frame/LocalFrame.cpp |
| diff --git a/third_party/WebKit/Source/core/frame/LocalFrame.cpp b/third_party/WebKit/Source/core/frame/LocalFrame.cpp |
| index 6e6ca09fc502cf82686a4eef346e100a1c46d0c3..b085308c2cfc19accecf6c75e3bf9250edb145d4 100644 |
| --- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp |
| +++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp |
| @@ -591,6 +591,21 @@ void LocalFrame::DidChangeVisibilityState() { |
| Frame::DidChangeVisibilityState(); |
| } |
| +void LocalFrame::SetIsInert(bool inert) { |
| + is_inert_ = inert; |
| + 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.
|
| +} |
| + |
| +void LocalFrame::PropagateInertToChildFrames() { |
| + for (Frame* child = Tree().FirstChild(); child; |
| + 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
|
| + 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
|
| + child->SetIsInert(is_inert_ || |
| + 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.
|
| + } |
| + } |
| +} |
| + |
| LocalFrame& LocalFrame::LocalFrameRoot() const { |
| const LocalFrame* cur_frame = this; |
| while (cur_frame && cur_frame->Tree().Parent() && |
| @@ -925,6 +940,7 @@ inline LocalFrame::LocalFrame(LocalFrameClient* client, |
| page_zoom_factor_(ParentPageZoomFactor(this)), |
| text_zoom_factor_(ParentTextZoomFactor(this)), |
| in_view_source_mode_(false), |
| + is_inert_(false), |
| interface_provider_(interface_provider), |
| interface_registry_(interface_registry) { |
| if (FrameResourceCoordinator::IsEnabled()) { |
| @@ -935,6 +951,7 @@ inline LocalFrame::LocalFrame(LocalFrameClient* client, |
| probe_sink_ = new CoreProbeSink(); |
| performance_monitor_ = new PerformanceMonitor(this); |
| } else { |
| + 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.
|
| probe_sink_ = LocalFrameRoot().probe_sink_; |
| performance_monitor_ = LocalFrameRoot().performance_monitor_; |
| } |