Closed Bug 1637476 Opened 4 years ago Closed 4 years ago

No caret appears in an empty <input> if placeholder is defined

Categories

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

76 Branch
defect

Tracking

()

RESOLVED FIXED
mozilla78
Tracking Status
firefox78 --- fixed

People

(Reporter: leyyyyy, Assigned: MatsPalmgren_bugz)

References

(Blocks 1 open bug)

Details

(Keywords: parity-chrome, testcase)

Attachments

(3 files)

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0

Steps to reproduce:

  1. Open https://desk.bestr.no/welcome
  2. Focus username input (for example mouse click)

Actual results:

There is not caret.

Expected results:

Caret should be there.

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Layout: Form Controls
Product: Firefox → Core

I can reproduce the bug but data:text/html,<input placeholder=Username> works fine so I suspect the root cause is something in the event handlers on that <input>. A minimal testcase would help understanding the problem.

Keywords: testcase-wanted

<style>
input::placeholder {
opacity: 1;
background: #fff;
}
</style>
<input type="text" placeholder="Username...">

Has STR: --- → yes
Keywords: parity-chrome
Blocks: 556145

Thanks for the testcase Alice!

This is what I'm seeing on Linux with 'opacity:0.8'. The problem seems to be that we render the frame for the ::placeholder on top of the frame for the value (which I presume paints the caret). Also, it appears the ::placeholder frame is too large since it affects the border.

I wonder if we could simply swap the order of those two child frames...

That seems to fix it...

Assignee: nobody → mats
Severity: -- → S4
OS: Unspecified → All
Priority: -- → P4
Hardware: Unspecified → All

I spawned off bug 1637804 for the border issue.

Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Blocks: 1639610
Pushed by mpalmgren@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/55bb4c4449cd
Build the ::placeholder's DisplayLists first so that it doesn't obscure the caret.  r=emilio
Backout by nerli@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3ac5aa91c2ea
Backed out changeset 55bb4c4449cd as requested by dev CLOSED TREE
Pushed by mpalmgren@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/276021ad5a8a
Build the ::placeholder's DisplayLists first so that it doesn't obscure the caret.  r=emilio
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla78
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: