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

Unified Diff: third_party/WebKit/Source/core/paint/ThemePainterMac.mm

Issue 2224883002: Fix RTL rendering of SELECT on macOS and input[type=color] on all platforms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix RTL rendering of SELECT on macOS and input[type=color] on all platforms. 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
Index: third_party/WebKit/Source/core/paint/ThemePainterMac.mm
diff --git a/third_party/WebKit/Source/core/paint/ThemePainterMac.mm b/third_party/WebKit/Source/core/paint/ThemePainterMac.mm
index 1b35b809756e766f8463d96edeceb2704fd68022..512f084a0892d64a9536541d1dbcccfe2b437973 100644
--- a/third_party/WebKit/Source/core/paint/ThemePainterMac.mm
+++ b/third_party/WebKit/Source/core/paint/ThemePainterMac.mm
@@ -260,10 +260,15 @@ bool ThemePainterMac::paintMenuListButton(const LayoutObject& o, const PaintInfo
float centerY = bounds.y() + bounds.height() / 2.0f;
float arrowHeight = LayoutThemeMac::menuListBaseArrowHeight * fontScale;
float arrowWidth = LayoutThemeMac::menuListBaseArrowWidth * fontScale;
- float leftEdge = bounds.maxX() - LayoutThemeMac::menuListArrowPaddingRight * o.styleRef().effectiveZoom() - arrowWidth;
float spaceBetweenArrows = LayoutThemeMac::menuListBaseSpaceBetweenArrows * fontScale;
-
- if (bounds.width() < arrowWidth + LayoutThemeMac::menuListArrowPaddingLeft * o.styleRef().effectiveZoom())
+ float scaledPaddingEnd = LayoutThemeMac::menuListArrowPaddingEnd * o.styleRef().effectiveZoom();
+ float leftEdge;
+ if (o.styleRef().direction() == LTR) {
+ leftEdge = bounds.maxX() - scaledPaddingEnd - arrowWidth;
+ } else {
+ leftEdge = bounds.x() + scaledPaddingEnd;
+ }
+ if (bounds.width() < arrowWidth + scaledPaddingEnd)
return false;
Color color = o.styleRef().visitedDependentColor(CSSPropertyColor);

Powered by Google App Engine
This is Rietveld 408576698