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

Unified Diff: Source/core/rendering/RenderListBox.cpp

Issue 337323002: Fix for RenderListBox not showing vertical scrollbar with overlay-scrollbar enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix compilation error Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/forms/select/listbox-overlay-scrollbar-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderListBox.cpp
diff --git a/Source/core/rendering/RenderListBox.cpp b/Source/core/rendering/RenderListBox.cpp
index c2d226076b2c2fd3d8101ddd11dbec7d2ebe8c15..44147b0df08a94a11ae1bd62c97b70283c551d4a 100644
--- a/Source/core/rendering/RenderListBox.cpp
+++ b/Source/core/rendering/RenderListBox.cpp
@@ -227,9 +227,7 @@ void RenderListBox::scrollToRevealSelection()
void RenderListBox::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const
{
- maxLogicalWidth = m_optionsWidth + 2 * optionsSpacingHorizontal;
- if (m_vBar)
- maxLogicalWidth += verticalScrollbarWidth();
+ maxLogicalWidth = m_optionsWidth + 2 * optionsSpacingHorizontal + verticalScrollbarWidth();
if (!style()->width().isPercent())
minLogicalWidth = maxLogicalWidth;
}
@@ -389,7 +387,7 @@ int RenderListBox::scrollbarLeft() const
if (style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
scrollbarLeft = borderLeft();
else
- scrollbarLeft = width() - borderRight() - verticalScrollbarWidth();
+ scrollbarLeft = width() - borderRight() - (m_vBar ? m_vBar->width() : 0);
tkent 2014/06/18 04:52:22 Why isn't this verticalScrollbarWidth()?
pals 2014/06/18 05:11:44 As we see, in case of overlayscrollbars, verticalS
tkent 2014/06/18 05:14:42 Ah, I see. This function calculates the position o
return scrollbarLeft;
}
@@ -398,7 +396,7 @@ void RenderListBox::paintScrollbar(PaintInfo& paintInfo, const LayoutPoint& pain
if (m_vBar) {
IntRect scrollRect = pixelSnappedIntRect(paintOffset.x() + scrollbarLeft(),
paintOffset.y() + borderTop(),
- verticalScrollbarWidth(),
+ m_vBar->width(),
height() - (borderTop() + borderBottom()));
m_vBar->setFrameRect(scrollRect);
m_vBar->paint(paintInfo.context, paintInfo.rect);
« no previous file with comments | « LayoutTests/fast/forms/select/listbox-overlay-scrollbar-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698