Closed Bug 1698606 Opened 3 years ago Closed 3 years ago

Text for date format in input type=date is misplaced

Categories

(Core :: Layout: Form Controls, defect)

Firefox 88
defect

Tracking

()

RESOLVED FIXED
89 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox86 --- unaffected
firefox87 --- wontfix
firefox88 --- wontfix
firefox89 --- fixed

People

(Reporter: calixte, Assigned: emilio)

References

(Regression)

Details

(Keywords: regression)

Attachments

(7 files)

Attached image image.png

With the following code

<div style="position: absolute; top:0px; left:0px; transform: matrix(4, 0, 0, 4, 0, 0);">
  <div style="position:absolute; top:10px; left:10px; font-family: Times New Roman;font-size: 8px; width:81.1px; height:14.17px;">
    <input style="font: inherit; width:100%; height:100%" type="date" />
  </div>
</div>

in firefox nighty 20210312215843, the text for mm/dd/yyyy is too low.

Emilio, is this an expected outcome?

Flags: needinfo?(emilio)
Regressed by: 1689603
Has Regression Range: --- → yes
Attached image What emilio sees.

What am I missing? Was this fixed elsewhere? I still think there are some improvements to be made here (baseline is a bit off) but it looks fine here to me.

Flags: needinfo?(emilio) → needinfo?(cdenizet)

Mostly a cosmetic change but this makes the layout more consistent with
other form controls.

This is the only thing that I think could cause something like comment 0
is describing, though I couldn't reproduce. But I think it's an
improvement regardless.

Assignee: nobody → emilio
Status: NEW → ASSIGNED

Interesting.
The issue is reproducable for me in removing <!DOCTYPE html> which is an error of course so you can consider that the test case is wrong and so the bug isn't a bug.
I met the bug irl in implementing some form stuff in pdf.js and the nodes are created with document.createElement.
I'll try to make a better test case.

Flags: needinfo?(cdenizet)
Attached file Quirks mode test-case.

Ah, I wasn't expecting quirks mode to have an effect here :-(

Yeah, so the quirks vs. no-quirks difference is just box-sizing. This is a bit broken indeed.

And I've some box-sizing: border-box in the css so it explains why I hit this bug.

Attachment #9212142 - Attachment mime type: text/plain → text/html

My updated patch addresses it.

Ideally nsDateTimeControlFrame should / could inherit from
nsTextControlFrame, but this should do for now.

Test also covers the previous patch.

Keywords: leave-open
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1adc903a5a23
Prevent datetime reset button from growing the wrapper (and thus moving the editor). r=jwatt
Flags: needinfo?(emilio)
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8babc4eddd52
Prevent datetime reset button from growing the wrapper (and thus moving the editor). r=jwatt
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/65ea7d9ad2bf
Ensure baseline for text and date controls matches. r=jwatt
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Flags: in-testsuite+
Target Milestone: --- → 89 Branch

The patch landed in nightly and beta is affected.
:emilio, is this bug important enough to require an uplift?
If not please set status_beta to wontfix.

For more information, please visit auto_nag documentation.

Flags: needinfo?(emilio)

Probably not.

Flags: needinfo?(emilio)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: