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

Side by Side Diff: Source/core/rendering/RenderLayerScrollableArea.cpp

Issue 588013002: Remove Overlay Scrollbar if not scrollable along the axis (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: added test expectations Created 6 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
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@web.de> 9 * Christian Biesinger <cbiesinger@web.de>
10 * Randall Jesup <rjesup@wgate.com> 10 * Randall Jesup <rjesup@wgate.com>
(...skipping 988 matching lines...) Expand 10 before | Expand all | Expand 10 after
999 m_scrollCorner = nullptr; 999 m_scrollCorner = nullptr;
1000 } 1000 }
1001 } 1001 }
1002 1002
1003 void RenderLayerScrollableArea::paintOverflowControls(GraphicsContext* context, const IntPoint& paintOffset, const IntRect& damageRect, bool paintingOverlayCont rols) 1003 void RenderLayerScrollableArea::paintOverflowControls(GraphicsContext* context, const IntPoint& paintOffset, const IntRect& damageRect, bool paintingOverlayCont rols)
1004 { 1004 {
1005 // Don't do anything if we have no overflow. 1005 // Don't do anything if we have no overflow.
1006 if (!box().hasOverflowClip()) 1006 if (!box().hasOverflowClip())
1007 return; 1007 return;
1008 1008
1009 if (hasOverlayScrollbars()) {
1010 if (!scrollSize(HorizontalScrollbar))
1011 destroyScrollbar(HorizontalScrollbar);
1012 if (!scrollSize(VerticalScrollbar))
1013 destroyScrollbar(VerticalScrollbar);
1014 }
1015
1009 IntPoint adjustedPaintOffset = paintOffset; 1016 IntPoint adjustedPaintOffset = paintOffset;
1010 if (paintingOverlayControls) 1017 if (paintingOverlayControls)
1011 adjustedPaintOffset = m_cachedOverlayScrollbarOffset; 1018 adjustedPaintOffset = m_cachedOverlayScrollbarOffset;
1012 1019
1013 // Move the scrollbar widgets if necessary. We normally move and resize widg ets during layout, 1020 // Move the scrollbar widgets if necessary. We normally move and resize widg ets during layout,
1014 // but sometimes widgets can move without layout occurring (most notably whe n you scroll a 1021 // but sometimes widgets can move without layout occurring (most notably whe n you scroll a
1015 // document that contains fixed positioned elements). 1022 // document that contains fixed positioned elements).
1016 positionOverflowControls(toIntSize(adjustedPaintOffset)); 1023 positionOverflowControls(toIntSize(adjustedPaintOffset));
1017 1024
1018 // Overlay scrollbars paint in a second pass through the layer tree so that they will paint 1025 // Overlay scrollbars paint in a second pass through the layer tree so that they will paint
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
1469 void RenderLayerScrollableArea::setTopmostScrollChild(RenderLayer* scrollChild) 1476 void RenderLayerScrollableArea::setTopmostScrollChild(RenderLayer* scrollChild)
1470 { 1477 {
1471 // We only want to track the topmost scroll child for scrollable areas with 1478 // We only want to track the topmost scroll child for scrollable areas with
1472 // overlay scrollbars. 1479 // overlay scrollbars.
1473 if (!hasOverlayScrollbars()) 1480 if (!hasOverlayScrollbars())
1474 return; 1481 return;
1475 m_nextTopmostScrollChild = scrollChild; 1482 m_nextTopmostScrollChild = scrollChild;
1476 } 1483 }
1477 1484
1478 } // namespace blink 1485 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698