Chromium Code Reviews| 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); |