Index: Source/core/layout/LayoutBox.cpp |
diff --git a/Source/core/layout/LayoutBox.cpp b/Source/core/layout/LayoutBox.cpp |
index 18f1df9511b843b893c025c52bc90f1cacd0006c..12188d1a68531a28f950c0c8ee7e55dcb4ed43b5 100644 |
--- a/Source/core/layout/LayoutBox.cpp |
+++ b/Source/core/layout/LayoutBox.cpp |
@@ -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; |