| Index: third_party/WebKit/Source/core/frame/RemoteFrameView.cpp
|
| diff --git a/third_party/WebKit/Source/core/frame/RemoteFrameView.cpp b/third_party/WebKit/Source/core/frame/RemoteFrameView.cpp
|
| index daadfd1becc9a7e5bf49e6956e4d4a8d3217fcaa..b2bc577dee70f3ddae7748c33a02e5a006dee058 100644
|
| --- a/third_party/WebKit/Source/core/frame/RemoteFrameView.cpp
|
| +++ b/third_party/WebKit/Source/core/frame/RemoteFrameView.cpp
|
| @@ -22,8 +22,17 @@ RemoteFrameView::RemoteFrameView(RemoteFrame* remote_frame)
|
|
|
| RemoteFrameView::~RemoteFrameView() {}
|
|
|
| -void RemoteFrameView::SetParent(FrameViewBase* parent) {
|
| - FrameViewBase::SetParent(parent);
|
| +void RemoteFrameView::SetParent(FrameViewBase* parent_frame_view_base) {
|
| + FrameView* parent = ToFrameView(parent_frame_view_base);
|
| + if (parent == parent_)
|
| + return;
|
| +
|
| + DCHECK(!parent || !parent_);
|
| + if (!parent || !parent->IsVisible())
|
| + SetParentVisible(false);
|
| + parent_ = parent;
|
| + if (parent && parent->IsVisible())
|
| + SetParentVisible(true);
|
| FrameRectsChanged();
|
| }
|
|
|
| @@ -48,7 +57,7 @@ void RemoteFrameView::UpdateRemoteViewportIntersection() {
|
| // scrollable div. Passing nullptr as an argument to
|
| // mapToVisualRectInAncestorSpace causes it to be clipped to the viewport,
|
| // even if there are RemoteFrame ancestors in the frame tree.
|
| - LayoutRect rect(0, 0, FrameRect().Width(), FrameRect().Height());
|
| + LayoutRect rect(0, 0, frame_rect_.Width(), frame_rect_.Height());
|
| rect.Move(remote_frame_->OwnerLayoutObject()->ContentBoxOffset());
|
| if (!remote_frame_->OwnerLayoutObject()->MapToVisualRectInAncestorSpace(
|
| nullptr, rect))
|
| @@ -74,7 +83,6 @@ void RemoteFrameView::Dispose() {
|
| // RemoteFrameView is disconnected before detachment.
|
| if (owner_element && owner_element->OwnedWidget() == this)
|
| owner_element->SetWidget(nullptr);
|
| - FrameViewBase::Dispose();
|
| }
|
|
|
| void RemoteFrameView::InvalidateRect(const IntRect& rect) {
|
| @@ -88,14 +96,11 @@ void RemoteFrameView::InvalidateRect(const IntRect& rect) {
|
| layout_item.InvalidatePaintRectangle(repaint_rect);
|
| }
|
|
|
| -void RemoteFrameView::SetFrameRect(const IntRect& new_rect) {
|
| - IntRect old_rect = FrameRect();
|
| -
|
| - if (new_rect == old_rect)
|
| +void RemoteFrameView::SetFrameRect(const IntRect& frame_rect) {
|
| + if (frame_rect == frame_rect_)
|
| return;
|
|
|
| - FrameViewBase::SetFrameRect(new_rect);
|
| -
|
| + frame_rect_ = frame_rect;
|
| FrameRectsChanged();
|
| }
|
|
|
| @@ -103,36 +108,33 @@ void RemoteFrameView::FrameRectsChanged() {
|
| // Update the rect to reflect the position of the frame relative to the
|
| // containing local frame root. The position of the local root within
|
| // any remote frames, if any, is accounted for by the embedder.
|
| - IntRect new_rect = FrameRect();
|
| - if (const FrameView* parent = ToFrameView(Parent()))
|
| - new_rect = parent->ConvertToRootFrame(parent->ContentsToFrame(new_rect));
|
| -
|
| + IntRect new_rect = frame_rect_;
|
| + if (parent_)
|
| + new_rect = parent_->ConvertToRootFrame(parent_->ContentsToFrame(new_rect));
|
| remote_frame_->Client()->FrameRectsChanged(new_rect);
|
|
|
| UpdateRemoteViewportIntersection();
|
| }
|
|
|
| void RemoteFrameView::Hide() {
|
| - SetSelfVisible(false);
|
| -
|
| + self_visible_ = false;
|
| remote_frame_->Client()->VisibilityChanged(false);
|
| }
|
|
|
| void RemoteFrameView::Show() {
|
| - SetSelfVisible(true);
|
| -
|
| + self_visible_ = true;
|
| remote_frame_->Client()->VisibilityChanged(true);
|
| }
|
|
|
| void RemoteFrameView::SetParentVisible(bool visible) {
|
| - if (IsParentVisible() == visible)
|
| + if (parent_visible_ == visible)
|
| return;
|
|
|
| - FrameViewBase::SetParentVisible(visible);
|
| - if (!IsSelfVisible())
|
| + parent_visible_ = visible;
|
| + if (!self_visible_)
|
| return;
|
|
|
| - remote_frame_->Client()->VisibilityChanged(IsVisible());
|
| + remote_frame_->Client()->VisibilityChanged(self_visible_ && parent_visible_);
|
| }
|
|
|
| IntRect RemoteFrameView::ConvertFromContainingFrameViewBase(
|
| @@ -149,7 +151,7 @@ IntRect RemoteFrameView::ConvertFromContainingFrameViewBase(
|
|
|
| DEFINE_TRACE(RemoteFrameView) {
|
| visitor->Trace(remote_frame_);
|
| - FrameViewBase::Trace(visitor);
|
| + visitor->Trace(parent_);
|
| }
|
|
|
| } // namespace blink
|
|
|