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

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

Issue 2893833004: When moving past a left-hand scrollbar, don't jump way outside the content box. (Closed)
Patch Set: 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 955 matching lines...) Expand 10 before | Expand all | Expand 10 after
966 return GetScrollableArea()->VerticalScrollbarWidth(); 966 return GetScrollableArea()->VerticalScrollbarWidth();
967 } 967 }
968 968
969 int LayoutBox::HorizontalScrollbarHeight() const { 969 int LayoutBox::HorizontalScrollbarHeight() const {
970 if (!HasOverflowClip() || Style()->OverflowX() == EOverflow::kOverlay) 970 if (!HasOverflowClip() || Style()->OverflowX() == EOverflow::kOverlay)
971 return 0; 971 return 0;
972 972
973 return GetScrollableArea()->HorizontalScrollbarHeight(); 973 return GetScrollableArea()->HorizontalScrollbarHeight();
974 } 974 }
975 975
976 LayoutUnit LayoutBox::VerticalScrollbarWidthClampedToContentBox() const {
977 LayoutUnit width(VerticalScrollbarWidth());
978 DCHECK_GE(width, LayoutUnit());
979 if (width) {
980 LayoutUnit minimum_width = LogicalWidth() - BorderAndPaddingLogicalWidth();
981 DCHECK_GE(minimum_width, LayoutUnit());
982 width = std::min(width, minimum_width);
983 }
984 return width;
985 }
986
976 ScrollResult LayoutBox::Scroll(ScrollGranularity granularity, 987 ScrollResult LayoutBox::Scroll(ScrollGranularity granularity,
977 const FloatSize& delta) { 988 const FloatSize& delta) {
978 // Presumably the same issue as in setScrollTop. See crbug.com/343132. 989 // Presumably the same issue as in setScrollTop. See crbug.com/343132.
979 DisableCompositingQueryAsserts disabler; 990 DisableCompositingQueryAsserts disabler;
980 991
981 if (!GetScrollableArea()) 992 if (!GetScrollableArea())
982 return ScrollResult(); 993 return ScrollResult();
983 994
984 return GetScrollableArea()->UserScroll(granularity, delta); 995 return GetScrollableArea()->UserScroll(granularity, delta);
985 } 996 }
(...skipping 4878 matching lines...) Expand 10 before | Expand all | Expand 10 after
5864 void LayoutBox::MutableForPainting:: 5875 void LayoutBox::MutableForPainting::
5865 SavePreviousContentBoxSizeAndLayoutOverflowRect() { 5876 SavePreviousContentBoxSizeAndLayoutOverflowRect() {
5866 auto& rare_data = GetLayoutBox().EnsureRareData(); 5877 auto& rare_data = GetLayoutBox().EnsureRareData();
5867 rare_data.has_previous_content_box_size_and_layout_overflow_rect_ = true; 5878 rare_data.has_previous_content_box_size_and_layout_overflow_rect_ = true;
5868 rare_data.previous_content_box_size_ = GetLayoutBox().ContentBoxRect().Size(); 5879 rare_data.previous_content_box_size_ = GetLayoutBox().ContentBoxRect().Size();
5869 rare_data.previous_layout_overflow_rect_ = 5880 rare_data.previous_layout_overflow_rect_ =
5870 GetLayoutBox().LayoutOverflowRect(); 5881 GetLayoutBox().LayoutOverflowRect();
5871 } 5882 }
5872 5883
5873 } // namespace blink 5884 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698