Closed Bug 381639 Opened 17 years ago Closed 17 years ago

[Mac] Aqua <button> text should not move when button is :active

Categories

(Core :: Widget: Cocoa, defect, P4)

x86
macOS
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: jruderman, Assigned: jaas)

References

()

Details

(Keywords: testcase)

Attachments

(4 files, 1 obsolete file)

Steps to reproduce:
1. Load data:text/html,<button>foo</button>
2. Hold the mouse down on the button.

Result: "foo" moves right a pixel.

Expected: "foo" should not move, for consistency with Aqua widgets in other Mac apps.
I think this is closely related to bug 375436
Attached image unmodified forms.css
Attached image modified forms.css
This can actually be fixed by modifying the forms.css file. I was going to post this in a new bug but this can be fixed at the same time so may as well piggyback here.

The padding for buttons in forms.css is set to 0px 6px 0px 6px for the normal state and 0px 5px 0px 7px for the clicked (active:hover) state. The difference is why it's shifting a pixel.

It's also set too large (which was going to be the bug I filed), IMO. If you set it to 0px 2px 0px 2px then it more closely matches the output you get with Safari (though the button shape is a bit different and Firefox adds the focus thing which is cut off, but whatever) which fixes the case where the buttons are too large and they spill over onto a new line in a form.

I'll attach some screenshots that show the unpatched, patched and Safari views.
Is the css change in comment 5 the correct way to fix this bug, or should it really be fixed in widget/native theme code?
It should be fixed in native theme code -- buttons should override the padding in GetWidgetPadding.  Unthemed buttons are supposed to move when clicked.
Flags: blocking1.9?
Flags: blocking1.9? → blocking1.9+
Target Milestone: --- → mozilla1.9 M11
Priority: -- → P4
Target Milestone: mozilla1.9 M11 → ---
Attached patch possible fix v1.0 (obsolete) — Splinter Review
We probably want something like this, but I haven't messed with it enough to fully endorse this and request review.
Attached patch fix v1.1Splinter Review
Attachment #288445 - Attachment is obsolete: true
Attachment #288959 - Flags: review?(cbarrett)
Comment on attachment 288959 [details] [diff] [review]
fix v1.1

Update the comment in GetWidgetBorder and add one in GetWidgetPadding explaining why we're doing the override.

r=cbarrett with that.
Attachment #288959 - Flags: review?(cbarrett) → review+
Attachment #288959 - Flags: superreview?(roc)
Attachment #288959 - Flags: superreview?(roc) → superreview+
landed on trunk
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
This fixed reftest failure, bug 381835.
Blocks: 381835
Depends on: 844948
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: