Closed Bug 1674431 Opened 4 years ago Closed 4 years ago

Spin button appearance makes text entry unreadable, <input type="number"> covered by wide buttons

Categories

(Core :: Widget: Gtk, defect)

x86_64
Linux
defect

Tracking

()

RESOLVED FIXED
86 Branch
Fission Milestone M7
Tracking Status
firefox-esr78 --- unaffected
firefox84 --- wontfix
firefox85 --- wontfix
firefox86 --- fixed

People

(Reporter: gcp, Assigned: emilio)

References

(Regression)

Details

(Keywords: regression)

Attachments

(7 files)

Attached image Non-native theme
No description provided.
Attached image Native theme

This is an example of a webcompat problem from non-native theming: the new theme makes the text unreadable.

The site is runalyze.com, though there's probably no simple STR to get this particular dialog without an account with data etc.

Assignee: nobody → gpascutto

data:text/html,<input type="number" style="width: 4em" value="1234"> might be a reasonable enough test-case.

The original HTML looks roughly like:
<td class="zone-cell-from"><span class="input-with-unit"> <input type="number" id="sport_zones_settings_5_from" name="sport_zones[settings][5][from]" class="small-size" value="354" readonly=""> <label for="sport_zones_settings_5_from" class="input-unit">W</label></span></td>

Emilio, do you have a recommended way of addressing this? Should we widen the control by the extra space required by the spinner buttons? I also couldn't quite figure out how to recreate a control with the "W" on the right of the spinner buttons, although I'm not sure that it will be relevant here.

Flags: needinfo?(emilio)

You can't really do that if the author specifies the width of the control. I think for cases like comment 2 we need to shrink the buttons, at least conditionally. Gian-Carlo, can you inspect the number input and see if they're explicitly specifying width / max-width?

Flags: needinfo?(emilio) → needinfo?(gpascutto)
Attached file devtoolscss.txt

CSS in attachment.

Flags: needinfo?(gpascutto)
Assignee: gpascutto → nobody

Yeah, so they're hardcoding width: 44px, so it's basically comment 2, and we can't really grow the input.

I believe that due to the changes to the sizes of many of our form controls we are bound to run into these kinds of compatibility issues. Is there a good rule of thumb that we can follow to determine when we need revert to the old sizing, and when to simply live with the breakage and expect web authors to address it on their end? As unfortunate as this is, it seems to me that as soon as we were willing to change the sizing of our default form controls, we implicitly agreed to live with some level of breakage.

Flags: needinfo?(emilio)

I guess we can track these off a metabug or something, and see how often we find these. We should also judge the severity of the issue, for example this one seems somewhat serious because it can prevent the text in the input from being readable...

Flags: needinfo?(emilio)

Tracking non-native theming bugs for Fission Beta milestone (M7).

Fission Milestone: --- → M7

I would suggest picking a smaller width for the buttons and sticking with it, for consistency. I would take this bug as evidence that the larger width is not web compatible.

Summary: Spin button appearance makes text entry unreadable → Spin button appearance makes text entry unreadable, <input type="number"> covered by wide buttons

Here's another instance of this problem: https://www.gutekueche.at/spekulatius-rezept-24305

Agreed.

Assignee: nobody → emilio

Use the same width as the select arrow button makes sense to me and
fixes all the reported problems so far.

Also tweak the sizing / painting to take less height since these have a
background, so stuff like:

<input type=number style="height: 100px">

Looks super ugly otherwise.

The new polygon coordinates are the result of scaling by 1.5 and
centering vertically the arrow, which gives the same visual effect for
the regular input without margin / padding, but prevents the issue
described above with too-tall inputs or inputs with lots of padding.

We might want to shrink them a bit more if needed, but I think this is
alright. For reference, Chrome uses 15px, but we remove the inline-end
padding by default so we compensate a bit that way.

If we don't like how this looks when the author specifies padding on the
input (see comment 13 for example), we might want to reconsider the
design so that the spinners look good with padding, but that's a
different task completely.

Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a95d10a2de4d Size the non-native theme number spinner buttons more sensibly. r=spohl
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 86 Branch
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: