Closed Bug 1905743 Opened 3 months ago Closed 3 months ago

<input type="number"> too narrow when using min & max attributes

Categories

(Core :: Layout: Form Controls, defect, P2)

Firefox 128
defect

Tracking

()

VERIFIED FIXED
129 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr128 --- verified
firefox127 --- unaffected
firefox128 + verified
firefox129 + verified

People

(Reporter: gentle.dust4318, Assigned: emilio)

References

(Regression)

Details

(Keywords: regression)

Attachments

(7 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:128.0) Gecko/20100101 Firefox/128.0

Steps to reproduce:

Open an HTML file with a number input with both min and max attributes, such as:

<input type="number" min="1" max="999" value="999">

Observe how the widget is rendered.

Actual results:

The widget's width is too narrow to see all 3 digits of the value.

This regression was introduced by https://bugzilla.mozilla.org/show_bug.cgi?id=1898214 for version 128. Nightly 129.0a1 also has this issue.

Expected results:

The widget's width is wide enough to see all 3 digits of the value.

Safari 18.0 (release 197) and Chrome 128.0.6569.0 both display a widgets wide enough to hold 3 digits. Tested on macOS 14.5.

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Cocoa' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Widget: Cocoa
Product: Firefox → Core
Component: Widget: Cocoa → Layout: Form Controls
Flags: needinfo?(emilio)
Keywords: regression
Regressed by: 1898214
Assignee: nobody → emilio
Attachment #9410721 - Attachment description: WIP: Bug 1905743 - Handle button box in intrinsic text field sizing. → Bug 1905743 - Handle button box in intrinsic text field sizing. r=#layout!
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

[Tracking Requested - why for this release]: cropping content is no fun, let's not let this get to release.

Severity: -- → S2
Flags: needinfo?(emilio)
Priority: -- → P2

Set release status flags based on info from the regressing bug 1898214

Sounds like this is a potential RC respin driver?

Split out from the other patch for readability. This doesn't change
behavior but unifies where we store the buttons of
number/search/password buttons.

This is needed because we want implicit width of number and text
controls be the same, but explicit width be different to account for the
spinners. See:

data:text/html,<input type="number"><br><input type="text"><br><input type="number" min="1" max="9"><br><input type="text" size="1">

For example. This patch on its own shouldn't change behavior.

We can't put it upstream because whether platforms have spinners is not
defined (we only do that on android for example).

Attachment #9410895 - Attachment description: Bug 1905743 - Unify text control button sizes. r=dholbert! → Bug 1905743 - Unify text control button storage. r=dholbert!
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/aa9dfdbbe902 Unify text control button storage. r=dholbert https://hg.mozilla.org/integration/autoland/rev/22870b370ca7 Tweak TextControlElement to be able to tell if column count is explicit or not. r=dholbert https://hg.mozilla.org/integration/autoland/rev/fef6d2c06ec0 Handle button box in intrinsic text field sizing. r=dholbert https://hg.mozilla.org/integration/autoland/rev/d8a6a456d92e Add a mozilla-specific WPT test for this. r=dholbert https://hg.mozilla.org/integration/autoland/rev/b26a356fa191 apply code formatting via Lando
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/46969 for changes under testing/web-platform/tests

Comment on attachment 9410721 [details]
Bug 1905743 - Handle button box in intrinsic text field sizing. r=#layout!

Beta/Release Uplift Approval Request

  • User impact if declined: comment 0
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: comment 0
  • List of other uplifts needed: none
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): There's a bit of refactoring involved but the fix itself is simple and this code has pretty decent test coverage.
  • String changes made/needed: none
  • Is Android affected?: No
Attachment #9410721 - Flags: approval-mozilla-release?
Flags: qe-verify+
Attachment #9410895 - Flags: approval-mozilla-release?
Attachment #9410896 - Flags: approval-mozilla-release?
Attachment #9410897 - Flags: approval-mozilla-release?

The patch landed in nightly and beta is affected.
:emilio, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox128 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(emilio)
Upstream PR merged by moz-wptsync-bot
Flags: needinfo?(emilio)

Comment on attachment 9410721 [details]
Bug 1905743 - Handle button box in intrinsic text field sizing. r=#layout!

Approved for 128.0rc2.

Attachment #9410721 - Flags: approval-mozilla-release? → approval-mozilla-release+
Attachment #9410895 - Flags: approval-mozilla-release? → approval-mozilla-release+
Attachment #9410896 - Flags: approval-mozilla-release? → approval-mozilla-release+
Attachment #9410897 - Flags: approval-mozilla-release? → approval-mozilla-release+
Attachment #9410721 - Flags: approval-mozilla-esr128+
Attachment #9410895 - Flags: approval-mozilla-esr128+
Attachment #9410896 - Flags: approval-mozilla-esr128+
Attachment #9410897 - Flags: approval-mozilla-esr128+
QA Whiteboard: [qa-triaged]

I was able to reproduce the issue on Firefox 128.0b9 and on Firefox Nightly 129.0a1 (2024-07-01) using macOS 14.4, while opening the HTML file from Comment 1.
Verified as fixed on Firefox Nightly 129.0a1 (2024-07-03), using macOS 14.4, Windows 11 and Ubuntu 22.04. The widget’s width is now wide enough to see all 3 digits of the value (attaching a screenshot as well).

Will verify this on the official 128.0-build2 RC and 128.0esr-build 2 when available.

Verified as fixed on Firefox 128.0-build2 RC (build ID 20240704121409) and on Firefox 128esr-build2 (build ID 20240703235920) using macOS 14.4, Windows 11 and Ubuntu 22.04 as well.

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: