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

Unified Diff: third_party/WebKit/Source/core/paint/ThemePainterDefault.cpp

Issue 2340633002: Modifies logic for computing drop down menu arrow's dimensions and how it is drawn. (Closed)
Patch Set: Modifies logic for computing drop down menu arrow's dimensions and how it is drawn. Created 4 years, 3 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
Index: third_party/WebKit/Source/core/paint/ThemePainterDefault.cpp
diff --git a/third_party/WebKit/Source/core/paint/ThemePainterDefault.cpp b/third_party/WebKit/Source/core/paint/ThemePainterDefault.cpp
index a135ca7abb8d42bd35bb38473458c5b827d1aebd..431455e4168ab6812a065cf43016a1ad3a774da0 100644
--- a/third_party/WebKit/Source/core/paint/ThemePainterDefault.cpp
+++ b/third_party/WebKit/Source/core/paint/ThemePainterDefault.cpp
@@ -262,11 +262,17 @@ void ThemePainterDefault::setupMenuListArrow(const LayoutBox& box, const IntRect
if (useMockTheme()) {
// The size and position of the drop-down button is different between
// the mock theme and the regular aura theme.
- int spacingTop = (box.borderTop() + box.paddingTop()).toInt();
- int spacingBottom = (box.borderBottom() + box.paddingBottom()).toInt();
- int spacingRight = (box.borderRight() + box.paddingRight()).toInt();
- extraParams.menuList.arrowX = (box.styleRef().direction() == RTL) ? rect.x() + 4 + spacingRight: right - 10 - spacingRight;
- extraParams.menuList.arrowSize = rect.height() - spacingBottom - spacingTop;
+ int extraPadding = 3 * box.styleRef().effectiveZoom();
oshima 2016/09/17 01:31:21 define const for 3 and explain what's in CSS pixel
malaykeshav 2016/09/19 18:09:27 Done
+ // The width available for the arrow is based on the padding provided
+ // in the child LayoutBox.
+ int arrowBoxWidth = ((box.styleRef().direction() == RTL) ?
+ box.firstChildBox()->paddingLeft() :
+ box.firstChildBox()->paddingRight()).toInt();
+ int arrowSize = std::min(arrowBoxWidth, rect.height()) - 2 * extraPadding;
oshima 2016/09/17 01:31:21 80 chars
malaykeshav 2016/09/19 18:09:27 This file doesn't follow the 80 char limit. git cl
+ extraParams.menuList.arrowX = (box.styleRef().direction() == RTL) ?
+ rect.x() + extraPadding + (arrowSize / 2):
+ right - (arrowSize / 2) - extraPadding;
+ extraParams.menuList.arrowSize = arrowSize;
} else {
const int arrowSize = 6;
const int arrowPadding = 6;

Powered by Google App Engine
This is Rietveld 408576698