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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutThemeDefault.cpp

Issue 2576563003: Cache scrollbar thickness in LayoutThemeDefault. (Closed)
Patch Set: _ Created 4 years 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 | « third_party/WebKit/Source/core/layout/LayoutThemeDefault.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutThemeDefault.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutThemeDefault.cpp b/third_party/WebKit/Source/core/layout/LayoutThemeDefault.cpp
index e0d778f384951b8d32008ea19ac60b2d97978c20..39e0c091e08542627ef03e4bab07aeab36fa7192 100644
--- a/third_party/WebKit/Source/core/layout/LayoutThemeDefault.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutThemeDefault.cpp
@@ -335,19 +335,21 @@ int LayoutThemeDefault::popupInternalPaddingBottom(
return menuListInternalPadding(style, 1);
}
-// static
-int LayoutThemeDefault::scrollbarThicknessInDIP() {
+int LayoutThemeDefault::scrollbarThicknessInDIP() const {
+ if (m_scrollbarThicknessInDIP > 0)
keishi 2016/12/14 08:23:08 nit: Maybe initial value should be a negative valu
tkent 2016/12/14 08:49:40 AFAIK, getSize(WebThemeEngine::PartScrollbarUpArro
+ return m_scrollbarThicknessInDIP;
int width = Platform::current()
->themeEngine()
->getSize(WebThemeEngine::PartScrollbarUpArrow)
.width;
- return width > 0 ? width : 15;
+ const_cast<LayoutThemeDefault*>(this)->m_scrollbarThicknessInDIP =
+ width > 0 ? width : 15;
+ return m_scrollbarThicknessInDIP;
}
-// static
float LayoutThemeDefault::clampedMenuListArrowPaddingSize(
const HostWindow* host,
- const ComputedStyle& style) {
+ const ComputedStyle& style) const {
int originalSize = scrollbarThicknessInDIP();
int scaledSize =
host ? host->windowToViewportScalar(originalSize) : originalSize;
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutThemeDefault.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698