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

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

Issue 2918053002: Move middle-click autoscroll to synthetic fling. (Closed)
Patch Set: Delete redundant cursor shape print 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 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 } 630 }
631 631
632 // Returns true iff we are attempting an autoscroll inside an iframe with 632 // Returns true iff we are attempting an autoscroll inside an iframe with
633 // scrolling="no". 633 // scrolling="no".
634 static bool IsDisallowedAutoscroll(HTMLFrameOwnerElement* owner_element, 634 static bool IsDisallowedAutoscroll(HTMLFrameOwnerElement* owner_element,
635 LocalFrameView* frame_view) { 635 LocalFrameView* frame_view) {
636 if (owner_element && IsHTMLFrameElementBase(*owner_element)) { 636 if (owner_element && IsHTMLFrameElementBase(*owner_element)) {
637 HTMLFrameElementBase* frame_element_base = 637 HTMLFrameElementBase* frame_element_base =
638 ToHTMLFrameElementBase(owner_element); 638 ToHTMLFrameElementBase(owner_element);
639 if (Page* page = frame_view->GetFrame().GetPage()) { 639 if (Page* page = frame_view->GetFrame().GetPage()) {
640 return page->GetAutoscrollController().AutoscrollInProgress() && 640 return page->GetAutoscrollController().SelectionAutoscrollInProgress() &&
641 frame_element_base->ScrollingMode() == kScrollbarAlwaysOff; 641 frame_element_base->ScrollingMode() == kScrollbarAlwaysOff;
642 } 642 }
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,
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
730 } 730 }
731 } 731 }
732 732
733 // If we are fixed-position and stick to the viewport, it is useless to 733 // If we are fixed-position and stick to the viewport, it is useless to
734 // scroll the parent. 734 // scroll the parent.
735 if (Style()->GetPosition() == EPosition::kFixed && 735 if (Style()->GetPosition() == EPosition::kFixed &&
736 ContainerForFixedPosition() == View()) { 736 ContainerForFixedPosition() == View()) {
737 return; 737 return;
738 } 738 }
739 739
740 if (GetFrame()->GetPage()->GetAutoscrollController().AutoscrollInProgress()) 740 if (GetFrame()
741 ->GetPage()
742 ->GetAutoscrollController()
743 .SelectionAutoscrollInProgress())
741 parent_box = EnclosingScrollableBox(); 744 parent_box = EnclosingScrollableBox();
742 745
743 if (parent_box) { 746 if (parent_box) {
744 parent_box->ScrollRectToVisibleRecursive( 747 parent_box->ScrollRectToVisibleRecursive(
745 new_rect, align_x, align_y, scroll_type, 748 new_rect, align_x, align_y, scroll_type,
746 make_visible_in_visual_viewport, scroll_behavior); 749 make_visible_in_visual_viewport, scroll_behavior);
747 } 750 }
748 } 751 }
749 752
750 void LayoutBox::AbsoluteRects(Vector<IntRect>& rects, 753 void LayoutBox::AbsoluteRects(Vector<IntRect>& rects,
(...skipping 5209 matching lines...) Expand 10 before | Expand all | Expand 10 after
5960 void LayoutBox::MutableForPainting:: 5963 void LayoutBox::MutableForPainting::
5961 SavePreviousContentBoxSizeAndLayoutOverflowRect() { 5964 SavePreviousContentBoxSizeAndLayoutOverflowRect() {
5962 auto& rare_data = GetLayoutBox().EnsureRareData(); 5965 auto& rare_data = GetLayoutBox().EnsureRareData();
5963 rare_data.has_previous_content_box_size_and_layout_overflow_rect_ = true; 5966 rare_data.has_previous_content_box_size_and_layout_overflow_rect_ = true;
5964 rare_data.previous_content_box_size_ = GetLayoutBox().ContentBoxRect().Size(); 5967 rare_data.previous_content_box_size_ = GetLayoutBox().ContentBoxRect().Size();
5965 rare_data.previous_layout_overflow_rect_ = 5968 rare_data.previous_layout_overflow_rect_ =
5966 GetLayoutBox().LayoutOverflowRect(); 5969 GetLayoutBox().LayoutOverflowRect();
5967 } 5970 }
5968 5971
5969 } // namespace blink 5972 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/input/ScrollManager.cpp ('k') | third_party/WebKit/Source/core/page/AutoscrollController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698