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

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

Issue 2377453004: Scrollbar width is set using thickness to compute correct rect size (Closed)
Patch Set: Resolved merge conflicts for update bots and Updated Layout Test HTML Created 4 years, 2 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/LayoutTests/fast/hidpi/scrollbar-appearance-increase-device-scale-factor-expected.txt ('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) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
5 * 5 *
6 * Other contributors: 6 * Other contributors:
7 * Robert O'Callahan <roc+@cs.cmu.edu> 7 * Robert O'Callahan <roc+@cs.cmu.edu>
8 * David Baron <dbaron@fas.harvard.edu> 8 * David Baron <dbaron@fas.harvard.edu>
9 * Christian Biesinger <cbiesinger@gmail.com> 9 * Christian Biesinger <cbiesinger@gmail.com>
10 * Randall Jesup <rjesup@wgate.com> 10 * Randall Jesup <rjesup@wgate.com>
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after
942 IntRect PaintLayerScrollableArea::rectForHorizontalScrollbar(const IntRect& bord erBoxRect) const 942 IntRect PaintLayerScrollableArea::rectForHorizontalScrollbar(const IntRect& bord erBoxRect) const
943 { 943 {
944 if (!hasHorizontalScrollbar()) 944 if (!hasHorizontalScrollbar())
945 return IntRect(); 945 return IntRect();
946 946
947 const IntRect& scrollCorner = scrollCornerRect(); 947 const IntRect& scrollCorner = scrollCornerRect();
948 948
949 return IntRect(horizontalScrollbarStart(borderBoxRect.x()), 949 return IntRect(horizontalScrollbarStart(borderBoxRect.x()),
950 borderBoxRect.maxY() - box().borderBottom() - horizontalScrollbar()->hei ght(), 950 borderBoxRect.maxY() - box().borderBottom() - horizontalScrollbar()->hei ght(),
951 borderBoxRect.width() - (box().borderLeft() + box().borderRight()) - scr ollCorner.width(), 951 borderBoxRect.width() - (box().borderLeft() + box().borderRight()) - scr ollCorner.width(),
952 horizontalScrollbar()->height()); 952 horizontalScrollbar()->scrollbarThickness());
953 } 953 }
954 954
955 IntRect PaintLayerScrollableArea::rectForVerticalScrollbar(const IntRect& border BoxRect) const 955 IntRect PaintLayerScrollableArea::rectForVerticalScrollbar(const IntRect& border BoxRect) const
956 { 956 {
957 if (!hasVerticalScrollbar()) 957 if (!hasVerticalScrollbar())
958 return IntRect(); 958 return IntRect();
959 959
960 const IntRect& scrollCorner = scrollCornerRect(); 960 const IntRect& scrollCorner = scrollCornerRect();
961 961
962 return IntRect(verticalScrollbarStart(borderBoxRect.x(), borderBoxRect.maxX( )), 962 return IntRect(verticalScrollbarStart(borderBoxRect.x(), borderBoxRect.maxX( )),
963 borderBoxRect.y() + box().borderTop(), 963 borderBoxRect.y() + box().borderTop(),
964 verticalScrollbar()->width(), 964 verticalScrollbar()->scrollbarThickness(),
965 borderBoxRect.height() - (box().borderTop() + box().borderBottom()) - sc rollCorner.height()); 965 borderBoxRect.height() - (box().borderTop() + box().borderBottom()) - sc rollCorner.height());
966 } 966 }
967 967
968 int PaintLayerScrollableArea::verticalScrollbarStart(int minX, int maxX) const 968 int PaintLayerScrollableArea::verticalScrollbarStart(int minX, int maxX) const
969 { 969 {
970 if (box().shouldPlaceBlockDirectionScrollbarOnLogicalLeft()) 970 if (box().shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
971 return minX + box().borderLeft(); 971 return minX + box().borderLeft();
972 return maxX - box().borderRight() - verticalScrollbar()->width(); 972 return maxX - box().borderRight() - verticalScrollbar()->width();
973 } 973 }
974 974
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after
1776 1776
1777 void PaintLayerScrollableArea::DelayScrollPositionClampScope::clampScrollableAre as() 1777 void PaintLayerScrollableArea::DelayScrollPositionClampScope::clampScrollableAre as()
1778 { 1778 {
1779 for (auto& scrollableArea : *s_needsClamp) 1779 for (auto& scrollableArea : *s_needsClamp)
1780 scrollableArea->clampScrollPositionsAfterLayout(); 1780 scrollableArea->clampScrollPositionsAfterLayout();
1781 delete s_needsClamp; 1781 delete s_needsClamp;
1782 s_needsClamp = nullptr; 1782 s_needsClamp = nullptr;
1783 } 1783 }
1784 1784
1785 } // namespace blink 1785 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/hidpi/scrollbar-appearance-increase-device-scale-factor-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698