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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp

Issue 2835403002: Call ScrollableArea::ShowOverlayScrollbars for explicit scrolls only. (Closed)
Patch Set: fix VisualViewport Created 3 years, 7 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) 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 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 return (orientation == kHorizontalScrollbar) ? scroll_dimensions.Width() 365 return (orientation == kHorizontalScrollbar) ? scroll_dimensions.Width()
366 : scroll_dimensions.Height(); 366 : scroll_dimensions.Height();
367 } 367 }
368 368
369 void PaintLayerScrollableArea::UpdateScrollOffset( 369 void PaintLayerScrollableArea::UpdateScrollOffset(
370 const ScrollOffset& new_offset, 370 const ScrollOffset& new_offset,
371 ScrollType scroll_type) { 371 ScrollType scroll_type) {
372 if (GetScrollOffset() == new_offset) 372 if (GetScrollOffset() == new_offset)
373 return; 373 return;
374 374
375 ShowOverlayScrollbars();
376 scroll_offset_ = new_offset; 375 scroll_offset_ = new_offset;
377 376
378 LocalFrame* frame = Box().GetFrame(); 377 LocalFrame* frame = Box().GetFrame();
379 DCHECK(frame); 378 DCHECK(frame);
380 379
381 FrameView* frame_view = Box().GetFrameView(); 380 FrameView* frame_view = Box().GetFrameView();
382 381
383 TRACE_EVENT1("devtools.timeline", "ScrollLayer", "data", 382 TRACE_EVENT1("devtools.timeline", "ScrollLayer", "data",
384 InspectorScrollLayerEvent::Data(&Box())); 383 InspectorScrollLayerEvent::Data(&Box()));
385 384
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 Box().View()->ClearHitTestCache(); 464 Box().View()->ClearHitTestCache();
466 465
467 // Inform the FrameLoader of the new scroll position, so it can be restored 466 // Inform the FrameLoader of the new scroll position, so it can be restored
468 // when navigating back. 467 // when navigating back.
469 if (Layer()->IsRootLayer()) { 468 if (Layer()->IsRootLayer()) {
470 frame_view->GetFrame().Loader().SaveScrollState(); 469 frame_view->GetFrame().Loader().SaveScrollState();
471 frame_view->DidChangeScrollOffset(); 470 frame_view->DidChangeScrollOffset();
472 } 471 }
473 472
474 if (IsExplicitScrollType(scroll_type)) { 473 if (IsExplicitScrollType(scroll_type)) {
474 if (scroll_type != kCompositorScroll)
475 ShowOverlayScrollbars();
475 frame_view->ClearFragmentAnchor(); 476 frame_view->ClearFragmentAnchor();
476 if (RuntimeEnabledFeatures::scrollAnchoringEnabled()) 477 if (RuntimeEnabledFeatures::scrollAnchoringEnabled())
477 GetScrollAnchor()->Clear(); 478 GetScrollAnchor()->Clear();
478 } 479 }
479 } 480 }
480 481
481 IntSize PaintLayerScrollableArea::ScrollOffsetInt() const { 482 IntSize PaintLayerScrollableArea::ScrollOffsetInt() const {
482 return FlooredIntSize(scroll_offset_); 483 return FlooredIntSize(scroll_offset_);
483 } 484 }
484 485
(...skipping 1637 matching lines...) Expand 10 before | Expand all | Expand 10 after
2122 2123
2123 void PaintLayerScrollableArea::DelayScrollOffsetClampScope:: 2124 void PaintLayerScrollableArea::DelayScrollOffsetClampScope::
2124 ClampScrollableAreas() { 2125 ClampScrollableAreas() {
2125 for (auto& scrollable_area : *needs_clamp_) 2126 for (auto& scrollable_area : *needs_clamp_)
2126 scrollable_area->ClampScrollOffsetAfterOverflowChange(); 2127 scrollable_area->ClampScrollOffsetAfterOverflowChange();
2127 delete needs_clamp_; 2128 delete needs_clamp_;
2128 needs_clamp_ = nullptr; 2129 needs_clamp_ = nullptr;
2129 } 2130 }
2130 2131
2131 } // namespace blink 2132 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698