Index: third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.cpp |
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.cpp b/third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.cpp |
index 0e1bfd3670f80d7246edb053f7fc2df2b7a2debd..2a670b145513a54c1c085068e95db7036ab5dece 100644 |
--- a/third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.cpp |
+++ b/third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.cpp |
@@ -34,6 +34,7 @@ |
#include "public/platform/Platform.h" |
#include "public/platform/WebRect.h" |
#include "public/platform/WebThemeEngine.h" |
+#include "wtf/MathExtras.h" |
#include <algorithm> |
@@ -92,7 +93,8 @@ int ScrollbarThemeOverlay::thumbLength(const ScrollbarThemeClient& scrollbar) |
float proportion = static_cast<float>(scrollbar.visibleSize()) / scrollbar.totalSize(); |
int length = round(proportion * trackLen); |
- length = std::min(std::max(length, minimumThumbLength(scrollbar)), trackLen); |
+ int minLen = std::min(minimumThumbLength(scrollbar), trackLen); |
+ length = clampTo(length, minLen, trackLen); |
return length; |
} |