[WebComponents] Content editable elements don't work when in shadow dom

NEW
Assigned to

Status

()

Core
DOM
3 years ago
a year ago

People

(Reporter: azasypkin, Assigned: smaug)

Tracking

(Blocks: 2 bugs)

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

Created attachment 8488994 [details]
shadow-dom-content-editable.html

It's impossible to put focus inside contenteditable element to actually edit its content. Please, see attached test case.

Tested on the latest Nightly, works in Chrome...
(Reporter)

Updated

3 years ago
Blocks: 1067228
Still happening in latest nightly.

Hey Andrew, this is a really painful issue in web component for us, as we'd like to embed our composer or our recipient panel in a web component, and these components use contenteditable elements.

Is it possible to priorize this ?
Flags: needinfo?(overholt)
*prioritize :)
As a workaround you could use a custom-element without shadow-dom. But agree, this should be fixed. William or Smaug to the rescue :)
William/Olli: what do you think?
Flags: needinfo?(wchen)
Flags: needinfo?(overholt)
Flags: needinfo?(bugs)
(Assignee)

Comment 5

2 years ago
I've been looking at this a bit today. Still having some wrong kind of is-in-(Un)composed check somewhere.
Assignee: nobody → bugs
Flags: needinfo?(wchen)
Flags: needinfo?(bugs)
(Assignee)

Updated

a year ago
Blocks: 1233851
(Assignee)

Comment 6

a year ago
Created attachment 8700187 [details] [diff] [review]
v1

Spellchecker doesn't work with this yet, but it is somewhat different work, so better to do it in a separate bug.


https://treeherder.mozilla.org/#/jobs?repo=try&revision=3baed0a85075
Attachment #8700187 - Flags: review?(wchen)
Comment on attachment 8700187 [details] [diff] [review]
v1

Review of attachment 8700187 [details] [diff] [review]:
-----------------------------------------------------------------

Now that we support editable elements in shadow DOM, we also need to update the editable descendant count when BindToTree recurses for shadow DOM content [1] similar to how it's done for XBL [2].

[1] https://hg.mozilla.org/mozilla-central/file/388bdc46ba51ee31da8b8abe977e0ca38d117434/dom/base/Element.cpp#l1681
[2] https://hg.mozilla.org/mozilla-central/file/388bdc46ba51ee31da8b8abe977e0ca38d117434/dom/base/Element.cpp#l1623
Attachment #8700187 - Flags: review?(wchen)
You need to log in before you can comment on or make changes to this bug.