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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBox.cpp

Issue 2942673002: Revert of "Find" scrolling should be smoothly animated. (Closed)
Patch Set: Created 3 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc.
7 * All rights reserved. 7 * All rights reserved.
8 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 8 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 } 643 }
644 return false; 644 return false;
645 } 645 }
646 646
647 void LayoutBox::ScrollRectToVisible(const LayoutRect& rect, 647 void LayoutBox::ScrollRectToVisible(const LayoutRect& rect,
648 const ScrollAlignment& align_x, 648 const ScrollAlignment& align_x,
649 const ScrollAlignment& align_y, 649 const ScrollAlignment& align_y,
650 ScrollType scroll_type, 650 ScrollType scroll_type,
651 bool make_visible_in_visual_viewport, 651 bool make_visible_in_visual_viewport,
652 ScrollBehavior scroll_behavior) { 652 ScrollBehavior scroll_behavior) {
653 SmoothScrollSequencer* sequencer =
654 GetFrame()->GetPage()->GetSmoothScrollSequencer();
655 sequencer->AbortAnimations();
656 ScrollRectToVisibleRecursive(rect, align_x, align_y, scroll_type,
657 make_visible_in_visual_viewport,
658 scroll_behavior);
659 if (scroll_behavior == kScrollBehaviorSmooth)
660 sequencer->RunQueuedAnimations();
661 }
662
663 void LayoutBox::ScrollRectToVisibleRecursive(
664 const LayoutRect& rect,
665 const ScrollAlignment& align_x,
666 const ScrollAlignment& align_y,
667 ScrollType scroll_type,
668 bool make_visible_in_visual_viewport,
669 ScrollBehavior scroll_behavior) {
670 DCHECK(scroll_type == kProgrammaticScroll || scroll_type == kUserScroll); 653 DCHECK(scroll_type == kProgrammaticScroll || scroll_type == kUserScroll);
671 // Presumably the same issue as in setScrollTop. See crbug.com/343132. 654 // Presumably the same issue as in setScrollTop. See crbug.com/343132.
672 DisableCompositingQueryAsserts disabler; 655 DisableCompositingQueryAsserts disabler;
673 656
674 LayoutRect rect_to_scroll = rect; 657 LayoutRect rect_to_scroll = rect;
675 if (rect_to_scroll.Width() <= 0) 658 if (rect_to_scroll.Width() <= 0)
676 rect_to_scroll.SetWidth(LayoutUnit(1)); 659 rect_to_scroll.SetWidth(LayoutUnit(1));
677 if (rect_to_scroll.Height() <= 0) 660 if (rect_to_scroll.Height() <= 0)
678 rect_to_scroll.SetHeight(LayoutUnit(1)); 661 rect_to_scroll.SetHeight(LayoutUnit(1));
679 662
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 // scroll the parent. 717 // scroll the parent.
735 if (Style()->GetPosition() == EPosition::kFixed && 718 if (Style()->GetPosition() == EPosition::kFixed &&
736 ContainerForFixedPosition() == View()) { 719 ContainerForFixedPosition() == View()) {
737 return; 720 return;
738 } 721 }
739 722
740 if (GetFrame()->GetPage()->GetAutoscrollController().AutoscrollInProgress()) 723 if (GetFrame()->GetPage()->GetAutoscrollController().AutoscrollInProgress())
741 parent_box = EnclosingScrollableBox(); 724 parent_box = EnclosingScrollableBox();
742 725
743 if (parent_box) { 726 if (parent_box) {
744 parent_box->ScrollRectToVisibleRecursive( 727 parent_box->ScrollRectToVisible(new_rect, align_x, align_y, scroll_type,
745 new_rect, align_x, align_y, scroll_type, 728 make_visible_in_visual_viewport,
746 make_visible_in_visual_viewport, scroll_behavior); 729 scroll_behavior);
747 } 730 }
748 } 731 }
749 732
750 void LayoutBox::AbsoluteRects(Vector<IntRect>& rects, 733 void LayoutBox::AbsoluteRects(Vector<IntRect>& rects,
751 const LayoutPoint& accumulated_offset) const { 734 const LayoutPoint& accumulated_offset) const {
752 rects.push_back(PixelSnappedIntRect(accumulated_offset, Size())); 735 rects.push_back(PixelSnappedIntRect(accumulated_offset, Size()));
753 } 736 }
754 737
755 void LayoutBox::AbsoluteQuads(Vector<FloatQuad>& quads, 738 void LayoutBox::AbsoluteQuads(Vector<FloatQuad>& quads,
756 MapCoordinatesFlags mode) const { 739 MapCoordinatesFlags mode) const {
(...skipping 5203 matching lines...) Expand 10 before | Expand all | Expand 10 after
5960 void LayoutBox::MutableForPainting:: 5943 void LayoutBox::MutableForPainting::
5961 SavePreviousContentBoxSizeAndLayoutOverflowRect() { 5944 SavePreviousContentBoxSizeAndLayoutOverflowRect() {
5962 auto& rare_data = GetLayoutBox().EnsureRareData(); 5945 auto& rare_data = GetLayoutBox().EnsureRareData();
5963 rare_data.has_previous_content_box_size_and_layout_overflow_rect_ = true; 5946 rare_data.has_previous_content_box_size_and_layout_overflow_rect_ = true;
5964 rare_data.previous_content_box_size_ = GetLayoutBox().ContentBoxRect().Size(); 5947 rare_data.previous_content_box_size_ = GetLayoutBox().ContentBoxRect().Size();
5965 rare_data.previous_layout_overflow_rect_ = 5948 rare_data.previous_layout_overflow_rect_ =
5966 GetLayoutBox().LayoutOverflowRect(); 5949 GetLayoutBox().LayoutOverflowRect();
5967 } 5950 }
5968 5951
5969 } // namespace blink 5952 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.h ('k') | third_party/WebKit/Source/web/tests/SmoothScrollTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698