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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutThemeMac.mm

Issue 2224063003: LayoutTheme: Clean up popupInternalPadding* functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months 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/LayoutThemeMac.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/LayoutThemeMac.mm
diff --git a/third_party/WebKit/Source/core/layout/LayoutThemeMac.mm b/third_party/WebKit/Source/core/layout/LayoutThemeMac.mm
index 2a8ec74ba01314547a714eec6fd18be447281cd8..318293ed309a4c514000cbbf58edc3feefe257f2 100644
--- a/third_party/WebKit/Source/core/layout/LayoutThemeMac.mm
+++ b/third_party/WebKit/Source/core/layout/LayoutThemeMac.mm
@@ -757,31 +757,21 @@ static const int styledPopupPaddingBottom = 2;
// These functions are called with MenuListPart or MenulistButtonPart appearance
// by LayoutMenuList.
-int LayoutThemeMac::popupInternalPaddingLeft(const ComputedStyle& style) const
+int LayoutThemeMac::popupInternalPaddingStart(const ComputedStyle& style) const
{
- bool isRTL = style.direction() == RTL;
if (style.appearance() == MenulistPart)
- return popupButtonPadding(controlSizeForFont(style))[isRTL ? ThemeMac::RightMargin : ThemeMac::LeftMargin] * style.effectiveZoom();
- if (style.appearance() != MenulistButtonPart)
- return 0;
- if (isRTL) {
- float fontScale = style.fontSize() / baseFontSize;
- float arrowWidth = menuListBaseArrowWidth * fontScale;
- return static_cast<int>(ceilf(arrowWidth + (menuListArrowPaddingStart + menuListArrowPaddingEnd) * style.effectiveZoom()));
- }
- return styledPopupPaddingStart * style.effectiveZoom();
+ return popupButtonPadding(controlSizeForFont(style))[ThemeMac::LeftMargin] * style.effectiveZoom();
+ if (style.appearance() == MenulistButtonPart)
+ return styledPopupPaddingStart * style.effectiveZoom();
+ return 0;
}
-int LayoutThemeMac::popupInternalPaddingRight(const ComputedStyle& style) const
+int LayoutThemeMac::popupInternalPaddingEnd(const ComputedStyle& style) const
{
- bool isRTL = style.direction() == RTL;
if (style.appearance() == MenulistPart)
- return popupButtonPadding(controlSizeForFont(style))[isRTL ? ThemeMac::LeftMargin : ThemeMac::RightMargin] * style.effectiveZoom();
+ return popupButtonPadding(controlSizeForFont(style))[ThemeMac::RightMargin] * style.effectiveZoom();
if (style.appearance() != MenulistButtonPart)
return 0;
- if (isRTL) {
- return styledPopupPaddingStart * style.effectiveZoom();
- }
float fontScale = style.fontSize() / baseFontSize;
float arrowWidth = menuListBaseArrowWidth * fontScale;
return static_cast<int>(ceilf(arrowWidth + (menuListArrowPaddingStart + menuListArrowPaddingEnd) * style.effectiveZoom()));
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutThemeMac.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698