Unstable textarea sizing when :focus { background-color } is used
Categories
(Core :: Layout: Form Controls, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr68 | --- | unaffected |
firefox-esr78 | --- | wontfix |
firefox78 | --- | wontfix |
firefox79 | --- | wontfix |
firefox80 | --- | fixed |
People
(Reporter: jfkthame, Assigned: emilio)
References
(Regressed 1 open bug)
Details
(Keywords: regression)
Attachments
(3 files, 1 obsolete file)
See attached testcase. When the onload script has finished, the three textareas end up with identical styling, but at least on macOS, I'm seeing the test (middle) textarea consistently rendering 2px larger (in both dimensions) than the reference areas.
Zooming the page and then resetting the zoom resolves the discrepancy.
(At least two tests under dom/html/reftests/autofocus, textarea-load.html and textarea-create.html, are unstable on macOS because of this issue. Loading the testcases locally, the issue is more likely to show up if the developer tools are open, presumably because this impacts the timing of focus/blur/reflow.)
Reporter | ||
Comment 1•4 years ago
|
||
Reporter | ||
Comment 2•4 years ago
|
||
Not specific to macOS; I see the same issue with the testcase here on Ubuntu.
Reporter | ||
Comment 3•4 years ago
|
||
And on Windows; well, at least it's consistent.
Reporter | ||
Updated•4 years ago
|
Assignee | ||
Comment 4•4 years ago
|
||
I'm pretty sure I've filed a bug on this before, but I can't find it right now. The issue is that when we change background we don't invalidate layout, only paint. But background on widgets can affect layout, because we suppress native styling when background or borders are specified.
For the purposes of making those tests reliable for now we could add -moz-appearance: none
to the textarea.
Reporter | ||
Comment 5•4 years ago
|
||
The size change occurs because having :focus set background-color causes us to switch from native styling for the textarea, and this means we get thicker borders (2px rather than 1px); but we fail to resize the element to account for this.
However, if we instead set -moz-appearance:none, which has the same effect of disabling native styling and resulting in thicker borders, the element does resize as expected.
Reporter | ||
Comment 6•4 years ago
|
||
(In reply to Emilio Cobos Álvarez (:emilio) from comment #4)
I'm pretty sure I've filed a bug on this before, but I can't find it right now. The issue is that when we change background we don't invalidate layout, only paint. But background on widgets can affect layout, because we suppress native styling when background or borders are specified.
For the purposes of making those tests reliable for now we could add
-moz-appearance: none
to the textarea.
Yeah, I posted a patch in bug 1645794 to switch from styling background-color to color, but adding -moz-appearance would be another possible workaround.
Updated•4 years ago
|
Assignee | ||
Comment 8•4 years ago
|
||
As author-specified-background/border changes can change the effective
border and padding of form controls.
Updated•4 years ago
|
Updated•4 years ago
|
Comment 10•4 years ago
|
||
bugherder |
Comment 11•4 years ago
|
||
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.
Assignee | ||
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Description
•