OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights |
3 * reserved. | 3 * reserved. |
4 * | 4 * |
5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
6 * | 6 * |
7 * Other contributors: | 7 * Other contributors: |
8 * Robert O'Callahan <roc+@cs.cmu.edu> | 8 * Robert O'Callahan <roc+@cs.cmu.edu> |
9 * David Baron <dbaron@fas.harvard.edu> | 9 * David Baron <dbaron@fas.harvard.edu> |
10 * Christian Biesinger <cbiesinger@gmail.com> | 10 * Christian Biesinger <cbiesinger@gmail.com> |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 cache->HandleScrollPositionChanged(&Box()); | 464 cache->HandleScrollPositionChanged(&Box()); |
465 Box().View()->ClearHitTestCache(); | 465 Box().View()->ClearHitTestCache(); |
466 | 466 |
467 // Inform the FrameLoader of the new scroll position, so it can be restored | 467 // Inform the FrameLoader of the new scroll position, so it can be restored |
468 // when navigating back. | 468 // when navigating back. |
469 if (Layer()->IsRootLayer()) { | 469 if (Layer()->IsRootLayer()) { |
470 frame_view->GetFrame().Loader().SaveScrollState(); | 470 frame_view->GetFrame().Loader().SaveScrollState(); |
471 frame_view->DidChangeScrollOffset(); | 471 frame_view->DidChangeScrollOffset(); |
472 } | 472 } |
473 | 473 |
474 if (ScrollTypeClearsFragmentAnchor(scroll_type)) | 474 if (IsExplicitScrollType(scroll_type)) { |
475 frame_view->ClearFragmentAnchor(); | 475 frame_view->ClearFragmentAnchor(); |
476 | 476 if (RuntimeEnabledFeatures::scrollAnchoringEnabled()) |
477 // Clear the scroll anchor, unless it is the reason for this scroll. | 477 GetScrollAnchor()->Clear(); |
478 if (RuntimeEnabledFeatures::scrollAnchoringEnabled() && | 478 } |
479 scroll_type != kAnchoringScroll && scroll_type != kClampingScroll) | |
480 GetScrollAnchor()->Clear(); | |
481 } | 479 } |
482 | 480 |
483 IntSize PaintLayerScrollableArea::ScrollOffsetInt() const { | 481 IntSize PaintLayerScrollableArea::ScrollOffsetInt() const { |
484 return FlooredIntSize(scroll_offset_); | 482 return FlooredIntSize(scroll_offset_); |
485 } | 483 } |
486 | 484 |
487 ScrollOffset PaintLayerScrollableArea::GetScrollOffset() const { | 485 ScrollOffset PaintLayerScrollableArea::GetScrollOffset() const { |
488 return scroll_offset_; | 486 return scroll_offset_; |
489 } | 487 } |
490 | 488 |
(...skipping 1633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2124 | 2122 |
2125 void PaintLayerScrollableArea::DelayScrollOffsetClampScope:: | 2123 void PaintLayerScrollableArea::DelayScrollOffsetClampScope:: |
2126 ClampScrollableAreas() { | 2124 ClampScrollableAreas() { |
2127 for (auto& scrollable_area : *needs_clamp_) | 2125 for (auto& scrollable_area : *needs_clamp_) |
2128 scrollable_area->ClampScrollOffsetAfterOverflowChange(); | 2126 scrollable_area->ClampScrollOffsetAfterOverflowChange(); |
2129 delete needs_clamp_; | 2127 delete needs_clamp_; |
2130 needs_clamp_ = nullptr; | 2128 needs_clamp_ = nullptr; |
2131 } | 2129 } |
2132 | 2130 |
2133 } // namespace blink | 2131 } // namespace blink |
OLD | NEW |