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

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

Issue 138543008: Vertical scrollbar width becomes zero in case of overlay scrollbar. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added NeedsRebaseline for Mac Created 6 years, 11 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/platform/linux/fast/forms/select-multiple-rtl-expected.txt ('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 f02547901fe717fe3399b783aa5ff5b85bb0dce2..28a814f841ca5b7ced55de27f53d5be4ec14c97a 100644
--- a/Source/core/rendering/RenderListBox.cpp
+++ b/Source/core/rendering/RenderListBox.cpp
@@ -211,7 +211,7 @@ void RenderListBox::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, L
{
maxLogicalWidth = m_optionsWidth + 2 * optionsSpacingHorizontal;
if (m_vBar)
- maxLogicalWidth += m_vBar->width();
+ maxLogicalWidth += verticalScrollbarWidth();
if (!style()->width().isPercent())
minLogicalWidth = maxLogicalWidth;
}
@@ -284,7 +284,7 @@ int RenderListBox::baselinePosition(FontBaseline baselineType, bool firstLine, L
LayoutRect RenderListBox::itemBoundingBoxRect(const LayoutPoint& additionalOffset, int index)
{
// For RTL, items start after the left-side vertical scrollbar.
- int scrollbarOffset = style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft() ? m_vBar->width() : 0;
+ int scrollbarOffset = style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft() ? verticalScrollbarWidth() : 0;
return LayoutRect(additionalOffset.x() + borderLeft() + paddingLeft() + scrollbarOffset,
additionalOffset.y() + borderTop() + paddingTop() + itemHeight() * (index - m_indexOffset),
contentWidth(), itemHeight());
@@ -365,7 +365,7 @@ int RenderListBox::scrollbarLeft() const
if (style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
scrollbarLeft = borderLeft();
else
- scrollbarLeft = width() - borderRight() - m_vBar->width();
+ scrollbarLeft = width() - borderRight() - verticalScrollbarWidth();
return scrollbarLeft;
}
@@ -374,7 +374,7 @@ void RenderListBox::paintScrollbar(PaintInfo& paintInfo, const LayoutPoint& pain
if (m_vBar) {
IntRect scrollRect = pixelSnappedIntRect(paintOffset.x() + scrollbarLeft(),
paintOffset.y() + borderTop(),
- m_vBar->width(),
+ verticalScrollbarWidth(),
height() - (borderTop() + borderBottom()));
m_vBar->setFrameRect(scrollRect);
m_vBar->paint(paintInfo.context, paintInfo.rect);
@@ -484,7 +484,7 @@ bool RenderListBox::isPointInOverflowControl(HitTestResult& result, const Layout
LayoutRect vertRect(accumulatedOffset.x() + scrollbarLeft(),
accumulatedOffset.y() + borderTop(),
- m_vBar->width(),
+ verticalScrollbarWidth(),
height() - borderTop() - borderBottom());
if (vertRect.contains(locationInContainer)) {
@@ -502,7 +502,7 @@ int RenderListBox::listIndexAtOffset(const LayoutSize& offset)
if (offset.height() < borderTop() + paddingTop() || offset.height() > height() - paddingBottom() - borderBottom())
return -1;
- int scrollbarWidth = m_vBar ? m_vBar->width() : 0;
+ int scrollbarWidth = verticalScrollbarWidth();
int rightScrollbarOffset = style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft() ? scrollbarWidth : 0;
int leftScrollbarOffset = style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft() ? 0 : scrollbarWidth;
if (offset.width() < borderLeft() + paddingLeft() + rightScrollbarOffset
@@ -738,7 +738,7 @@ LayoutRect RenderListBox::controlClipRect(const LayoutPoint& additionalOffset) c
{
LayoutRect clipRect = contentBoxRect();
if (style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
- clipRect.moveBy(additionalOffset + LayoutPoint(m_vBar->width(), 0));
+ clipRect.moveBy(additionalOffset + LayoutPoint(verticalScrollbarWidth(), 0));
else
clipRect.moveBy(additionalOffset);
return clipRect;
« no previous file with comments | « LayoutTests/platform/linux/fast/forms/select-multiple-rtl-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698