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

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 2010963003: Restart any animations when we allocate a composited layer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Working on test. Created 4 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 Dirk Mueller <mueller@kde.org> 5 * 2000 Dirk Mueller <mueller@kde.org>
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * Copyright (C) 2009 Google Inc. All rights reserved. 9 * Copyright (C) 2009 Google Inc. All rights reserved.
10 * 10 *
(...skipping 3839 matching lines...) Expand 10 before | Expand all | Expand 10 after
3850 } 3850 }
3851 3851
3852 IntPoint FrameView::convertFromContainingWidgetToScrollbar(const Scrollbar& scro llbar, const IntPoint& parentPoint) const 3852 IntPoint FrameView::convertFromContainingWidgetToScrollbar(const Scrollbar& scro llbar, const IntPoint& parentPoint) const
3853 { 3853 {
3854 IntPoint newPoint = parentPoint; 3854 IntPoint newPoint = parentPoint;
3855 // Scrollbars won't be transformed within us 3855 // Scrollbars won't be transformed within us
3856 newPoint.moveBy(-scrollbar.location()); 3856 newPoint.moveBy(-scrollbar.location());
3857 return newPoint; 3857 return newPoint;
3858 } 3858 }
3859 3859
3860 static void setNeedsCompositingUpdate(LayoutViewItem layoutViewItem, Compositing UpdateType updateType)
3861 {
3862 if (PaintLayerCompositor* compositor = !layoutViewItem.isNull() ? layoutView Item.compositor() : nullptr)
3863 compositor->setNeedsCompositingUpdate(updateType);
3864 }
3865
3860 void FrameView::setParentVisible(bool visible) 3866 void FrameView::setParentVisible(bool visible)
3861 { 3867 {
3862 if (isParentVisible() == visible) 3868 if (isParentVisible() == visible)
3863 return; 3869 return;
3864 3870
3865 // As parent visibility changes, we may need to recomposite this frame view and potentially child frame views. 3871 // As parent visibility changes, we may need to recomposite this frame view and potentially child frame views.
3866 if (PaintLayerCompositor* compositor = !layoutViewItem().isNull() ? layoutVi ewItem().compositor() : nullptr) 3872 setNeedsCompositingUpdate(layoutViewItem(), CompositingUpdateRebuildTree);
3867 compositor->setNeedsCompositingUpdate(CompositingUpdateRebuildTree);
3868 3873
3869 Widget::setParentVisible(visible); 3874 Widget::setParentVisible(visible);
3870 3875
3871 if (!isSelfVisible()) 3876 if (!isSelfVisible())
3872 return; 3877 return;
3873 3878
3874 for (const auto& child : m_children) 3879 for (const auto& child : m_children)
3875 child->setParentVisible(visible); 3880 child->setParentVisible(visible);
3876 } 3881 }
3877 3882
3878 void FrameView::show() 3883 void FrameView::show()
3879 { 3884 {
3880 if (!isSelfVisible()) { 3885 if (!isSelfVisible()) {
3881 setSelfVisible(true); 3886 setSelfVisible(true);
3887 setNeedsCompositingUpdate(layoutViewItem(), CompositingUpdateRebuildTree );
wkorman 2016/05/28 00:59:44 As an alternative to adding this here and in line
3882 updateScrollableAreaSet(); 3888 updateScrollableAreaSet();
3883 if (isParentVisible()) { 3889 if (isParentVisible()) {
3884 for (const auto& child : m_children) 3890 for (const auto& child : m_children)
3885 child->setParentVisible(true); 3891 child->setParentVisible(true);
3886 } 3892 }
3887 } 3893 }
3888 3894
3889 Widget::show(); 3895 Widget::show();
3890 } 3896 }
3891 3897
3892 void FrameView::hide() 3898 void FrameView::hide()
3893 { 3899 {
3894 if (isSelfVisible()) { 3900 if (isSelfVisible()) {
3895 if (isParentVisible()) { 3901 if (isParentVisible()) {
3896 for (const auto& child : m_children) 3902 for (const auto& child : m_children)
3897 child->setParentVisible(false); 3903 child->setParentVisible(false);
3898 } 3904 }
3899 setSelfVisible(false); 3905 setSelfVisible(false);
3906 setNeedsCompositingUpdate(layoutViewItem(), CompositingUpdateRebuildTree );
wkorman 2016/05/28 00:59:44 This is not needed to fix the bug, but it maintain
3900 updateScrollableAreaSet(); 3907 updateScrollableAreaSet();
3901 } 3908 }
3902 3909
3903 Widget::hide(); 3910 Widget::hide();
3904 } 3911 }
3905 3912
3906 int FrameView::viewportWidth() const 3913 int FrameView::viewportWidth() const
3907 { 3914 {
3908 int viewportWidth = layoutSize(IncludeScrollbars).width(); 3915 int viewportWidth = layoutSize(IncludeScrollbars).width();
3909 return adjustForAbsoluteZoom(viewportWidth, layoutView()); 3916 return adjustForAbsoluteZoom(viewportWidth, layoutView());
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
4107 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling); 4114 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling);
4108 } 4115 }
4109 4116
4110 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const 4117 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const
4111 { 4118 {
4112 ASSERT(layoutView()); 4119 ASSERT(layoutView());
4113 return *layoutView(); 4120 return *layoutView();
4114 } 4121 }
4115 4122
4116 } // namespace blink 4123 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698