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

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

Issue 1474233002: Don't set internal paddings for menulist SELECT with -webkit-appearance:none. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/LayoutTests/platform/linux/fast/forms/select/popup-menu-appearance-rtl-expected.png ('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 9b978a748b13a0bc518ca504844a7f9e3f462687..3240ae9ab98bda612ee3d26c2a879beb1a308476 100644
--- a/third_party/WebKit/Source/core/layout/LayoutThemeDefault.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutThemeDefault.cpp
@@ -395,6 +395,8 @@ int LayoutThemeDefault::menuListArrowPadding() const
int LayoutThemeDefault::menuListInternalPadding(const ComputedStyle& style, int paddingType) const
{
+ if (style.appearance() == NoControlPart)
+ return 0;
// This internal padding is in addition to the user-supplied padding.
// Matches the FF behavior.
int padding = styledMenuListInternalPadding[paddingType];
@@ -402,10 +404,8 @@ int LayoutThemeDefault::menuListInternalPadding(const ComputedStyle& style, int
// Reserve the space for right arrow here. The rest of the padding is
// set by adjustMenuListStyle, since PopMenuWin.cpp uses the padding from
// LayoutMenuList to lay out the individual items in the popup.
- // If the MenuList actually has appearance "NoAppearance", then that means
- // we don't draw a button, so don't reserve space for it.
const int barType = style.direction() == LTR ? RightPadding : LeftPadding;
- if (paddingType == barType && style.appearance() != NoControlPart)
+ if (paddingType == barType)
padding += menuListArrowPadding();
return padding * style.effectiveZoom();
« no previous file with comments | « third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/popup-menu-appearance-rtl-expected.png ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698