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

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: Added test Created 4 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
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 775 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 return getScrollableArea()->horizontalScrollbarHeight(); 786 return getScrollableArea()->horizontalScrollbarHeight();
787 } 787 }
788 788
789 int LayoutBox::intrinsicScrollbarLogicalWidth() const 789 int LayoutBox::intrinsicScrollbarLogicalWidth() const
790 { 790 {
791 if (!hasOverflowClip()) 791 if (!hasOverflowClip())
792 return 0; 792 return 0;
793 793
794 ASSERT(getScrollableArea()); 794 ASSERT(getScrollableArea());
795 795
796 if (isHorizontalWritingMode() && style()->overflowY() == OverflowScroll) { 796 if (isHorizontalWritingMode() && (style()->overflowY() == OverflowScroll || style()->overflowY() == OverflowAuto)) {
skobes 2016/05/16 20:55:53 I will echo cbiesinger's question on the other thr
797 // Even with OverflowScroll, the scrollbar may not exist (crbug.com/4150 31). 797 // Even with OverflowScroll, the scrollbar may not exist (crbug.com/4150 31).
798 return getScrollableArea()->hasVerticalScrollbar() ? verticalScrollbarWi dth() : 0; 798 return getScrollableArea()->hasVerticalScrollbar() ? verticalScrollbarWi dth() : 0;
799 } 799 }
800 800
801 if (!isHorizontalWritingMode() && style()->overflowX() == OverflowScroll) { 801 if (!isHorizontalWritingMode() && (style()->overflowX() == OverflowScroll || style()->overflowX() == OverflowAuto)) {
802 // Even with OverflowScroll, the scrollbar may not exist (crbug.com/4150 31). 802 // Even with OverflowScroll, the scrollbar may not exist (crbug.com/4150 31).
803 return getScrollableArea()->hasHorizontalScrollbar() ? horizontalScrollb arHeight() : 0; 803 return getScrollableArea()->hasHorizontalScrollbar() ? horizontalScrollb arHeight() : 0;
804 } 804 }
805 805
806 return 0; 806 return 0;
807 } 807 }
808 808
809 ScrollResult LayoutBox::scroll(ScrollGranularity granularity, const FloatSize& d elta) 809 ScrollResult LayoutBox::scroll(ScrollGranularity granularity, const FloatSize& d elta)
810 { 810 {
811 // Presumably the same issue as in setScrollTop. See crbug.com/343132. 811 // Presumably the same issue as in setScrollTop. See crbug.com/343132.
(...skipping 4139 matching lines...) Expand 10 before | Expand all | Expand 10 after
4951 m_rareData->m_snapAreas->remove(&snapArea); 4951 m_rareData->m_snapAreas->remove(&snapArea);
4952 } 4952 }
4953 } 4953 }
4954 4954
4955 SnapAreaSet* LayoutBox::snapAreas() const 4955 SnapAreaSet* LayoutBox::snapAreas() const
4956 { 4956 {
4957 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr; 4957 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr;
4958 } 4958 }
4959 4959
4960 } // namespace blink 4960 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698