Closed Bug 1138359 Opened 10 years ago Closed 9 years ago

Cocoa native theme code needs to consider writing mode for padding of button contents

Categories

(Core :: Widget: Cocoa, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla39
Tracking Status
firefox39 --- fixed

People

(Reporter: jfkthame, Assigned: jfkthame)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

On OS X, a button such as

  <button>Click Me</button>

gets padding at the beginning and end of the text, thanks to margins returned by nsNativeThemeCocoa::GetWidgetBorder.

However, with a vertical writing-mode button

  <button style="writing-mode:vertical-lr">Click Me</button>

the padding gets applied "over" and "under" the text rather than at the start and end, because it is still specified in physical terms as going on the left and right.

To fix this, we need to make the nsNativeThemeCocoa pay attention to the writing mode (not only to LTR/RTL directionality, which it already considers in certain cases) and remap the padding accordingly.
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Note that while this fixes the margins of the button contents (and hence the sizing of the button itself), it doesn't address the fact that vertical writing-mode buttons still don't get the nice rounded corners that we expect on horizontal ones.

That's because we automatically switch to rectangular buttons above a height of 26px (see DO_SQUARE_BUTTON_HEIGHT in nsNativeThemeCocoa.mm), as the rounded buttons look bad at larger heights.
Attachment #8571270 - Flags: review?(smontagu) → review+
https://hg.mozilla.org/mozilla-central/rev/05dc91957f46
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: