| 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 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 3846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3857 } | 3857 } |
| 3858 | 3858 |
| 3859 IntPoint FrameView::convertFromContainingWidgetToScrollbar(const Scrollbar& scro
llbar, const IntPoint& parentPoint) const | 3859 IntPoint FrameView::convertFromContainingWidgetToScrollbar(const Scrollbar& scro
llbar, const IntPoint& parentPoint) const |
| 3860 { | 3860 { |
| 3861 IntPoint newPoint = parentPoint; | 3861 IntPoint newPoint = parentPoint; |
| 3862 // Scrollbars won't be transformed within us | 3862 // Scrollbars won't be transformed within us |
| 3863 newPoint.moveBy(-scrollbar.location()); | 3863 newPoint.moveBy(-scrollbar.location()); |
| 3864 return newPoint; | 3864 return newPoint; |
| 3865 } | 3865 } |
| 3866 | 3866 |
| 3867 static void setNeedsCompositingUpdate(LayoutViewItem layoutViewItem, Compositing
UpdateType updateType) |
| 3868 { |
| 3869 if (PaintLayerCompositor* compositor = !layoutViewItem.isNull() ? layoutView
Item.compositor() : nullptr) |
| 3870 compositor->setNeedsCompositingUpdate(updateType); |
| 3871 } |
| 3872 |
| 3867 void FrameView::setParentVisible(bool visible) | 3873 void FrameView::setParentVisible(bool visible) |
| 3868 { | 3874 { |
| 3869 if (isParentVisible() == visible) | 3875 if (isParentVisible() == visible) |
| 3870 return; | 3876 return; |
| 3871 | 3877 |
| 3872 // As parent visibility changes, we may need to recomposite this frame view
and potentially child frame views. | 3878 // As parent visibility changes, we may need to recomposite this frame view
and potentially child frame views. |
| 3873 if (PaintLayerCompositor* compositor = !layoutViewItem().isNull() ? layoutVi
ewItem().compositor() : nullptr) | 3879 setNeedsCompositingUpdate(layoutViewItem(), CompositingUpdateRebuildTree); |
| 3874 compositor->setNeedsCompositingUpdate(CompositingUpdateRebuildTree); | |
| 3875 | 3880 |
| 3876 Widget::setParentVisible(visible); | 3881 Widget::setParentVisible(visible); |
| 3877 | 3882 |
| 3878 if (!isSelfVisible()) | 3883 if (!isSelfVisible()) |
| 3879 return; | 3884 return; |
| 3880 | 3885 |
| 3881 for (const auto& child : m_children) | 3886 for (const auto& child : m_children) |
| 3882 child->setParentVisible(visible); | 3887 child->setParentVisible(visible); |
| 3883 } | 3888 } |
| 3884 | 3889 |
| 3885 void FrameView::show() | 3890 void FrameView::show() |
| 3886 { | 3891 { |
| 3887 if (!isSelfVisible()) { | 3892 if (!isSelfVisible()) { |
| 3888 setSelfVisible(true); | 3893 setSelfVisible(true); |
| 3894 setNeedsCompositingUpdate(layoutViewItem(), CompositingUpdateRebuildTree
); |
| 3889 updateScrollableAreaSet(); | 3895 updateScrollableAreaSet(); |
| 3890 if (isParentVisible()) { | 3896 if (isParentVisible()) { |
| 3891 for (const auto& child : m_children) | 3897 for (const auto& child : m_children) |
| 3892 child->setParentVisible(true); | 3898 child->setParentVisible(true); |
| 3893 } | 3899 } |
| 3894 } | 3900 } |
| 3895 | 3901 |
| 3896 Widget::show(); | 3902 Widget::show(); |
| 3897 } | 3903 } |
| 3898 | 3904 |
| 3899 void FrameView::hide() | 3905 void FrameView::hide() |
| 3900 { | 3906 { |
| 3901 if (isSelfVisible()) { | 3907 if (isSelfVisible()) { |
| 3902 if (isParentVisible()) { | 3908 if (isParentVisible()) { |
| 3903 for (const auto& child : m_children) | 3909 for (const auto& child : m_children) |
| 3904 child->setParentVisible(false); | 3910 child->setParentVisible(false); |
| 3905 } | 3911 } |
| 3906 setSelfVisible(false); | 3912 setSelfVisible(false); |
| 3913 setNeedsCompositingUpdate(layoutViewItem(), CompositingUpdateRebuildTree
); |
| 3907 updateScrollableAreaSet(); | 3914 updateScrollableAreaSet(); |
| 3908 } | 3915 } |
| 3909 | 3916 |
| 3910 Widget::hide(); | 3917 Widget::hide(); |
| 3911 } | 3918 } |
| 3912 | 3919 |
| 3913 int FrameView::viewportWidth() const | 3920 int FrameView::viewportWidth() const |
| 3914 { | 3921 { |
| 3915 int viewportWidth = layoutSize(IncludeScrollbars).width(); | 3922 int viewportWidth = layoutSize(IncludeScrollbars).width(); |
| 3916 return adjustForAbsoluteZoom(viewportWidth, layoutView()); | 3923 return adjustForAbsoluteZoom(viewportWidth, layoutView()); |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4115 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot
tling); | 4122 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot
tling); |
| 4116 } | 4123 } |
| 4117 | 4124 |
| 4118 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const | 4125 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const |
| 4119 { | 4126 { |
| 4120 ASSERT(!layoutViewItem().isNull()); | 4127 ASSERT(!layoutViewItem().isNull()); |
| 4121 return *layoutView(); | 4128 return *layoutView(); |
| 4122 } | 4129 } |
| 4123 | 4130 |
| 4124 } // namespace blink | 4131 } // namespace blink |
| OLD | NEW |