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 f679b981c5ccc06f252f86652bdf520094a09980..a5a12bb6c5e853ee301455486704641a8d9955b3 100644 |
--- a/third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.cpp |
+++ b/third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.cpp |
@@ -33,6 +33,7 @@ |
#include "public/platform/Platform.h" |
#include "public/platform/WebRect.h" |
#include "public/platform/WebThemeEngine.h" |
+#include "wtf/MathExtras.h" |
#include <algorithm> |
@@ -91,7 +92,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; |
} |