In a contenteditable document, button element doesn't work as it should.

NEW
Unassigned

Status

()

Core
Editor
P2
normal
10 months ago
9 months ago

People

(Reporter: Tony Duffill, Unassigned)

Tracking

({testcase-wanted})

52 Branch
testcase-wanted
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

10 months ago
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36

Steps to reproduce:

Created a Button element in a contenteditable document.


Actual results:

The Button element is not editable - even enclosing it in a Span with contenteditable="false", and setting the Button itself to contenteditable="true" only made it partially editable - the problem being that images or spans within the Button element weren't correctly detected (event.target always returns Button, even if you click on an image or span).


Expected results:

It should work like in every other modern web browser and be genuinely editable.

Comment 1

10 months ago
Could you provide a testcase, please.
Component: Untriaged → Editor
Flags: needinfo?(email)
Keywords: testcase-wanted
Product: Firefox → Core
(Reporter)

Comment 2

10 months ago
Created attachment 8850100 [details]
formTest.htm

Images in attached file won't work...

But concentrate on the Button element:

It mostly works (but only if contained within a Span with contenteditable="false" - try removing the Span!!)

BUT - even if you click on the span inside the Button, event.target returns 'Button' - images are similarly not recognised, if you can introduce one.

Many thanks

Tony
Flags: needinfo?(email)

Comment 3

10 months ago
Although the behavior is different to Blink, I cannot find spec for correct behavior.

This seems to be event target.  If this should handle editor, you can back to editor.
Component: Editor → DOM: Events
Stone, can you determine where we're going wrong here (if we are)? Thanks!
Flags: needinfo?(sshih)
Looks like we didn't support 'contenteditable' for button element. Did hit test and always got the button element as the event target.
Flags: needinfo?(sshih)
(In reply to Ming-Chou Shih [:stone] from comment #5)
> Looks like we didn't support 'contenteditable' for button element. Did hit
> test and always got the button element as the event target.

Can't find the spec says that button element does not support contenteditable and can't find the spec says the children of button element are anonymous to users neither.

Also tested it on Edge and it behaved the same as Chrome.
(In reply to Ming-Chou Shih [:stone] from comment #6)
> (In reply to Ming-Chou Shih [:stone] from comment #5)
> > Looks like we didn't support 'contenteditable' for button element. Did hit
> > test and always got the button element as the event target.
> 
> Can't find the spec says that button element does not support
> contenteditable and can't find the spec says the children of button element
> are anonymous to users neither.

Maybe Anne can help?
Flags: needinfo?(annevk)

Comment 8

9 months ago
Hit testing is bug 1089326.

For contenteditable I recommend we try to match the other browsers (or at least a majority of them). There's some standardization effort going on, but it's not based on thousands of tests so I'm not convinced it's going to be very useful.
Flags: needinfo?(annevk)
(In reply to Anne (:annevk) from comment #8)
> 
> For contenteditable I recommend we try to match the other browsers

So this is more of a Core::Editor thing?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(annevk)
Priority: -- → P2

Updated

9 months ago
Component: DOM: Events → Editor
Flags: needinfo?(annevk)
You need to log in before you can comment on or make changes to this bug.