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

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

Issue 1980103002: Include auto vertical scrollbar in intrinsicScrollbarLogicalWidth. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Restore list box height calculation, fix scrollbar width factor Created 4 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. All rights reserv ed. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 } 770 }
771 771
772 int LayoutBox::horizontalScrollbarHeight() const 772 int LayoutBox::horizontalScrollbarHeight() const
773 { 773 {
774 if (!hasOverflowClip() || style()->overflowX() == OverflowOverlay) 774 if (!hasOverflowClip() || style()->overflowX() == OverflowOverlay)
775 return 0; 775 return 0;
776 776
777 return getScrollableArea()->horizontalScrollbarHeight(); 777 return getScrollableArea()->horizontalScrollbarHeight();
778 } 778 }
779 779
780 int LayoutBox::intrinsicScrollbarLogicalWidth() const
781 {
782 if (!hasOverflowClip())
783 return 0;
784
785 ASSERT(getScrollableArea());
786
787 if (isHorizontalWritingMode() && style()->overflowY() == OverflowScroll) {
788 // Even with OverflowScroll, the scrollbar may not exist (crbug.com/4150 31).
789 return getScrollableArea()->hasVerticalScrollbar() ? verticalScrollbarWi dth() : 0;
790 }
791
792 if (!isHorizontalWritingMode() && style()->overflowX() == OverflowScroll) {
793 // Even with OverflowScroll, the scrollbar may not exist (crbug.com/4150 31).
794 return getScrollableArea()->hasHorizontalScrollbar() ? horizontalScrollb arHeight() : 0;
795 }
796
797 return 0;
798 }
799
800 ScrollResult LayoutBox::scroll(ScrollGranularity granularity, const FloatSize& d elta) 780 ScrollResult LayoutBox::scroll(ScrollGranularity granularity, const FloatSize& d elta)
801 { 781 {
802 // Presumably the same issue as in setScrollTop. See crbug.com/343132. 782 // Presumably the same issue as in setScrollTop. See crbug.com/343132.
803 DisableCompositingQueryAsserts disabler; 783 DisableCompositingQueryAsserts disabler;
804 784
805 if (!getScrollableArea()) 785 if (!getScrollableArea())
806 return ScrollResult(); 786 return ScrollResult();
807 787
808 return getScrollableArea()->userScroll(granularity, delta); 788 return getScrollableArea()->userScroll(granularity, delta);
809 } 789 }
(...skipping 4127 matching lines...) Expand 10 before | Expand all | Expand 10 after
4937 m_rareData->m_snapAreas->remove(&snapArea); 4917 m_rareData->m_snapAreas->remove(&snapArea);
4938 } 4918 }
4939 } 4919 }
4940 4920
4941 SnapAreaSet* LayoutBox::snapAreas() const 4921 SnapAreaSet* LayoutBox::snapAreas() const
4942 { 4922 {
4943 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr; 4923 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr;
4944 } 4924 }
4945 4925
4946 } // namespace blink 4926 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698