Chromium Code Reviews| 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 146 , m_horizontalScrollbarLock(false) | 146 , m_horizontalScrollbarLock(false) |
| 147 , m_verticalScrollbarLock(false) | 147 , m_verticalScrollbarLock(false) |
| 148 , m_scrollbarsAvoidingResizer(0) | 148 , m_scrollbarsAvoidingResizer(0) |
| 149 , m_scrollbarsSuppressed(false) | 149 , m_scrollbarsSuppressed(false) |
| 150 , m_inUpdateScrollbars(false) | 150 , m_inUpdateScrollbars(false) |
| 151 , m_frameTimingRequestsDirty(true) | 151 , m_frameTimingRequestsDirty(true) |
| 152 , m_viewportIntersectionValid(false) | 152 , m_viewportIntersectionValid(false) |
| 153 , m_hiddenForThrottling(false) | 153 , m_hiddenForThrottling(false) |
| 154 , m_crossOriginForThrottling(false) | 154 , m_crossOriginForThrottling(false) |
| 155 , m_isUpdatingAllLifecyclePhases(false) | 155 , m_isUpdatingAllLifecyclePhases(false) |
| 156 , m_scrollAnchor(this) | |
| 156 { | 157 { |
| 157 ASSERT(m_frame); | 158 ASSERT(m_frame); |
| 158 init(); | 159 init(); |
| 159 } | 160 } |
| 160 | 161 |
| 161 PassRefPtrWillBeRawPtr<FrameView> FrameView::create(LocalFrame* frame) | 162 PassRefPtrWillBeRawPtr<FrameView> FrameView::create(LocalFrame* frame) |
| 162 { | 163 { |
| 163 RefPtrWillBeRawPtr<FrameView> view = adoptRefWillBeNoop(new FrameView(frame) ); | 164 RefPtrWillBeRawPtr<FrameView> view = adoptRefWillBeNoop(new FrameView(frame) ); |
| 164 view->show(); | 165 view->show(); |
| 165 return view.release(); | 166 return view.release(); |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 190 #if ENABLE(OILPAN) | 191 #if ENABLE(OILPAN) |
| 191 visitor->trace(m_frame); | 192 visitor->trace(m_frame); |
| 192 visitor->trace(m_fragmentAnchor); | 193 visitor->trace(m_fragmentAnchor); |
| 193 visitor->trace(m_scrollableAreas); | 194 visitor->trace(m_scrollableAreas); |
| 194 visitor->trace(m_animatingScrollableAreas); | 195 visitor->trace(m_animatingScrollableAreas); |
| 195 visitor->trace(m_autoSizeInfo); | 196 visitor->trace(m_autoSizeInfo); |
| 196 visitor->trace(m_horizontalScrollbar); | 197 visitor->trace(m_horizontalScrollbar); |
| 197 visitor->trace(m_verticalScrollbar); | 198 visitor->trace(m_verticalScrollbar); |
| 198 visitor->trace(m_children); | 199 visitor->trace(m_children); |
| 199 visitor->trace(m_viewportScrollableArea); | 200 visitor->trace(m_viewportScrollableArea); |
| 201 visitor->trace(m_scrollAnchor); | |
| 200 #endif | 202 #endif |
| 201 Widget::trace(visitor); | 203 Widget::trace(visitor); |
| 202 ScrollableArea::trace(visitor); | 204 ScrollableArea::trace(visitor); |
| 203 } | 205 } |
| 204 | 206 |
| 205 void FrameView::reset() | 207 void FrameView::reset() |
| 206 { | 208 { |
| 207 m_hasPendingLayout = false; | 209 m_hasPendingLayout = false; |
| 208 m_doFullPaintInvalidation = false; | 210 m_doFullPaintInvalidation = false; |
| 209 m_layoutSchedulingEnabled = true; | 211 m_layoutSchedulingEnabled = true; |
| (...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 787 | 789 |
| 788 document->updateLayoutTreeIfNeeded(); | 790 document->updateLayoutTreeIfNeeded(); |
| 789 lifecycle().advanceTo(DocumentLifecycle::StyleClean); | 791 lifecycle().advanceTo(DocumentLifecycle::StyleClean); |
| 790 | 792 |
| 791 if (m_frame->isMainFrame() && !m_viewportScrollableArea) { | 793 if (m_frame->isMainFrame() && !m_viewportScrollableArea) { |
| 792 ScrollableArea& visualViewport = m_frame->host()->visualViewport(); | 794 ScrollableArea& visualViewport = m_frame->host()->visualViewport(); |
| 793 ScrollableArea* layoutViewport = layoutViewportScrollableArea(); | 795 ScrollableArea* layoutViewport = layoutViewportScrollableArea(); |
| 794 ASSERT(layoutViewport); | 796 ASSERT(layoutViewport); |
| 795 m_viewportScrollableArea = RootFrameViewport::create(visualViewport, *la youtViewport); | 797 m_viewportScrollableArea = RootFrameViewport::create(visualViewport, *la youtViewport); |
| 796 } | 798 } |
| 799 | |
| 800 if (scrollAnchoringEnabled()) | |
| 801 m_scrollAnchor.save(); | |
| 797 } | 802 } |
| 798 | 803 |
| 799 static inline void layoutFromRootObject(LayoutObject& root) | 804 static inline void layoutFromRootObject(LayoutObject& root) |
| 800 { | 805 { |
| 801 LayoutState layoutState(root); | 806 LayoutState layoutState(root); |
| 802 root.layout(); | 807 root.layout(); |
| 803 } | 808 } |
| 804 | 809 |
| 805 void FrameView::prepareLayoutAnalyzer() | 810 void FrameView::prepareLayoutAnalyzer() |
| 806 { | 811 { |
| (...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1523 void FrameView::setScrollPosition(const DoublePoint& scrollPoint, ScrollType scr ollType, ScrollBehavior scrollBehavior) | 1528 void FrameView::setScrollPosition(const DoublePoint& scrollPoint, ScrollType scr ollType, ScrollBehavior scrollBehavior) |
| 1524 { | 1529 { |
| 1525 DoublePoint newScrollPosition = clampScrollPosition(scrollPoint); | 1530 DoublePoint newScrollPosition = clampScrollPosition(scrollPoint); |
| 1526 if (newScrollPosition == scrollPositionDouble()) | 1531 if (newScrollPosition == scrollPositionDouble()) |
| 1527 return; | 1532 return; |
| 1528 | 1533 |
| 1529 if (scrollBehavior == ScrollBehaviorAuto) | 1534 if (scrollBehavior == ScrollBehaviorAuto) |
| 1530 scrollBehavior = scrollBehaviorStyle(); | 1535 scrollBehavior = scrollBehaviorStyle(); |
| 1531 | 1536 |
| 1532 ScrollableArea::setScrollPosition(newScrollPosition, scrollType, scrollBehav ior); | 1537 ScrollableArea::setScrollPosition(newScrollPosition, scrollType, scrollBehav ior); |
| 1538 | |
| 1539 if (scrollAnchoringEnabled() && scrollType != AnchoringScroll) | |
| 1540 m_scrollAnchor.clear(); | |
| 1533 } | 1541 } |
| 1534 | 1542 |
| 1535 void FrameView::didUpdateElasticOverscroll() | 1543 void FrameView::didUpdateElasticOverscroll() |
| 1536 { | 1544 { |
| 1537 Page* page = frame().page(); | 1545 Page* page = frame().page(); |
| 1538 if (!page) | 1546 if (!page) |
| 1539 return; | 1547 return; |
| 1540 FloatSize elasticOverscroll = page->chromeClient().elasticOverscroll(); | 1548 FloatSize elasticOverscroll = page->chromeClient().elasticOverscroll(); |
| 1541 if (m_horizontalScrollbar) { | 1549 if (m_horizontalScrollbar) { |
| 1542 float delta = elasticOverscroll.width() - m_horizontalScrollbar->elastic Overscroll(); | 1550 float delta = elasticOverscroll.width() - m_horizontalScrollbar->elastic Overscroll(); |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2003 | 2011 |
| 2004 // Plugins could have torn down the page inside updateWidgetGeometries(). | 2012 // Plugins could have torn down the page inside updateWidgetGeometries(). |
| 2005 if (!layoutView()) | 2013 if (!layoutView()) |
| 2006 return; | 2014 return; |
| 2007 | 2015 |
| 2008 scheduleUpdateWidgetsIfNecessary(); | 2016 scheduleUpdateWidgetsIfNecessary(); |
| 2009 | 2017 |
| 2010 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator( )) | 2018 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator( )) |
| 2011 scrollingCoordinator->notifyGeometryChanged(); | 2019 scrollingCoordinator->notifyGeometryChanged(); |
| 2012 | 2020 |
| 2013 scrollToFragmentAnchor(); | 2021 scrollToFragmentAnchor(); |
|
ojan
2016/02/02 06:51:01
We'll need to think of what the right behavior is
skobes
2016/02/02 22:39:10
Added TODO. I think the right behavior is for the
ojan
2016/02/03 01:23:43
I agree.
| |
| 2022 if (scrollAnchoringEnabled()) | |
| 2023 m_scrollAnchor.restore(); | |
| 2014 | 2024 |
| 2015 sendResizeEventIfNeeded(); | 2025 sendResizeEventIfNeeded(); |
| 2016 } | 2026 } |
| 2017 | 2027 |
| 2018 bool FrameView::wasViewportResized() | 2028 bool FrameView::wasViewportResized() |
| 2019 { | 2029 { |
| 2020 ASSERT(m_frame); | 2030 ASSERT(m_frame); |
| 2021 LayoutView* layoutView = this->layoutView(); | 2031 LayoutView* layoutView = this->layoutView(); |
| 2022 if (!layoutView) | 2032 if (!layoutView) |
| 2023 return false; | 2033 return false; |
| (...skipping 2025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4049 return false; | 4059 return false; |
| 4050 return m_hiddenForThrottling && m_crossOriginForThrottling; | 4060 return m_hiddenForThrottling && m_crossOriginForThrottling; |
| 4051 } | 4061 } |
| 4052 | 4062 |
| 4053 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const | 4063 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const |
| 4054 { | 4064 { |
| 4055 ASSERT(layoutView()); | 4065 ASSERT(layoutView()); |
| 4056 return *layoutView(); | 4066 return *layoutView(); |
| 4057 } | 4067 } |
| 4058 | 4068 |
| 4069 bool FrameView::scrollAnchoringEnabled() const | |
| 4070 { | |
| 4071 if (Settings* settings = frame().settings()) | |
| 4072 return settings->scrollAnchoringEnabled(); | |
| 4073 return false; | |
| 4074 } | |
| 4075 | |
| 4059 } // namespace blink | 4076 } // namespace blink |
| OLD | NEW |