Commit a01198fe authored by skobes@chromium.org's avatar skobes@chromium.org

Tolerate nonexistent scrollbar in LayoutBox::intrinsicScrollbarLogicalWidth.

DeprecatedPaintLayerScrollableArea will not create an overlay scrollbar if there
is no overflow on that axis, even if overflow:scroll is specified.  This is
intentional behavior added in http://crbug.com/415031.

It's correct for intrinsicScrollbarLogicalWidth to return 0 in this case, as it
already does for all overlay scrollbars.

BUG=520662
TEST=WebViewTest.GeolocationAPIEmbedderHasAccessAllow passes on Mac

Review URL: https://codereview.chromium.org/1292003007

git-svn-id: svn://svn.chromium.org/blink/trunk@200911 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 7988aacc
......@@ -699,13 +699,15 @@ int LayoutBox::intrinsicScrollbarLogicalWidth() const
return 0;
if (isHorizontalWritingMode() && style()->overflowY() == OSCROLL) {
ASSERT(layer()->scrollableArea() && layer()->scrollableArea()->hasVerticalScrollbar());
return verticalScrollbarWidth();
ASSERT(layer()->scrollableArea());
// Even with OSCROLL, the scrollbar may not exist (crbug.com/415031).
return layer()->scrollableArea()->hasVerticalScrollbar() ? verticalScrollbarWidth() : 0;
}
if (!isHorizontalWritingMode() && style()->overflowX() == OSCROLL) {
ASSERT(layer()->scrollableArea() && layer()->scrollableArea()->hasHorizontalScrollbar());
return horizontalScrollbarHeight();
ASSERT(layer()->scrollableArea());
// Even with OSCROLL, the scrollbar may not exist (crbug.com/415031).
return layer()->scrollableArea()->hasHorizontalScrollbar() ? horizontalScrollbarHeight() : 0;
}
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment