0

[Mac] Ellipsize long options rather than wrapping (to hidden) words that don't fit.

This changes the <select> popups on Mac so that they ellipsize
excessively large options that don't fit in the popup.  Prior to this
change the behavior was to attempt to wrap such options; however, the
wrapped text was not displayed.  In the case of an <optgroup> (which
causes indentation) the old behavior could mean that an option that was
a single large unbreakable unit could end up showing nothing at all.

Fixed: 348675991
Change-Id: I41f46048291f228c390f105b851f23055a0833d0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5665600
Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
Commit-Queue: David Baron <dbaron@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1321282}
This commit is contained in:
L. David Baron
2024-06-29 01:18:08 +00:00
committed by Chromium LUCI CQ
parent 3d7a18e835
commit f86cbcada1

@ -92,6 +92,7 @@
? NSWritingDirectionRightToLeft
: NSWritingDirectionLeftToRight;
paragraphStyle.baseWritingDirection = writingDirection;
paragraphStyle.lineBreakMode = NSLineBreakByTruncatingTail;
attrs[NSParagraphStyleAttributeName] = paragraphStyle;
if (item->has_text_direction_override) {