Open Bug 1526393 Opened 5 years ago Updated 2 years ago

Add a test for <button> in contenteditable

Categories

(Core :: Layout, defect, P3)

65 Branch
defect

Tracking

()

Tracking Status
firefox65 --- wontfix
firefox66 --- unaffected
firefox67 --- unaffected

People

(Reporter: peterkwebb, Unassigned)

References

Details

(Keywords: regression)

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/18.17763

Steps to reproduce:

View this HTML in Firefox (file attached):
<!DOCTYPE html>
<body>
<button contentEditable="true">Edit this</button>
</body>
</html

Actual results:

  1. Move mouse cursor over middle of text and left click.
    Observed: contenteditable text cursor (caret) always appears before first character.

  2. Press keyboard 'Delete' button.
    Observed: no character deletion; text cursor moves by one character to the right.

  3. Move text cursor to just after "Edi" (using cursor key) and press 'Delete' keyboard button.
    Observed: the space character after "Edit" is deleted.

Expected results:

  1. Move mouse cursor over middle of text and left click.
    Expected: contenteditable text cursor should appear close to mouse cursor position.

  2. Press keyboard 'Delete' button.
    Expected: character to right of text cursor to be deleted.

  3. Move text cursor to just after "Edi" (using cursor key) and press 'Delete' keyboard button.
    Expected: character to the right to be deleted (character "t").

Everything works as expected in Chrome.

Hi peterkwebb,

This issue seems to affect only the latest Firefox Release version 65.0.
Could not reproduce on latest Beta nor Nightly. Can you please confirm that too? Here are the download links for that: https://www.mozilla.org/en-US/firefox/channel/desktop/

Status: UNCONFIRMED → NEW
Component: Untriaged → Layout
Ever confirmed: true
Flags: needinfo?(peterkwebb)
Product: Firefox → Core

Hi Timea,
Yes, I confirm bug is fixed in Nightly. I've not tested in Beta. I could not find this bug reported previously so I guess fixing some other bug has also fixed this bug. Thanks for checking it out.

Flags: needinfo?(peterkwebb)

This was fixed by bug 1518339, but I think it's a bit lucky that it did.

The reason it works in a very weird way before that patch is that button has -moz-user-select: none on the user-agent stylesheet. You can set it to -moz-user-select: text and then it should work even on older Firefox versions.

I think the only reason it fixed it is because buttons have an anonymous box that does not get the -moz-user-select: none style. We should add a test for this in this bug.

Depends on: 1518339
Flags: in-testsuite?

Confirmed via mozregression that this was introduced in 65 via bug 1506547.

Blocks: 1506547
Type: defect → task
Priority: -- → P3
Summary: contenteditable with button element is not fully functional → Add a test for <button> in contenteditable
Type: task → defect
Type: defect → task
Type: task → defect
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: