Closed Bug 1636516 Opened 5 years ago Closed 5 years ago

Contenteditable cursors hidden, if other contenteditable-element attached to fragment and then connected to the dom

Categories

(Core :: DOM: Core & HTML, defect)

76 Branch
defect

Tracking

()

RESOLVED FIXED
mozilla78
Tracking Status
firefox-esr68 --- wontfix
firefox75 --- wontfix
firefox76 --- wontfix
firefox77 --- wontfix
firefox78 --- fixed

People

(Reporter: tobias.buschor, Assigned: emilio)

References

(Regression)

Details

(Keywords: regression)

Attachments

(3 files)

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

Steps to reproduce:

  • i have some contenteditable-elements on the page
  • create a fragment
  • attache a other contenteditable-element to the fragment
  • connect the element to the dom

See here: https://jsfiddle.net/cyLkmxag/58/

Actual results:

all contenteditable-cursors disappear with the exeption of the newly created one

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

Component: Untriaged → DOM: Editor
Product: Firefox → Core
Status: UNCONFIRMED → NEW
Ever confirmed: true
Has Regression Range: --- → yes

Gah, guess I should've kept my mouth shut! ;)

Thanks a lot Alice :)

Flags: needinfo?(emilio)

A workaround is to add -moz-user-modify: read-write to the previous element, but I still don't know why its state is borked.

This seems to be a more general problem with sharing of mapped attributes when adopting from a template document, somehow.

Component: DOM: Editor → DOM: Core & HTML
Assignee: nobody → emilio

The sheet pointer means a very specific thing: This nsMappedAttributes
is registered on nsHTMLStyleSheet. When adopting a node into another
document, we'd call SetStyleSheet on a clone of the attribute, and clear
the actual interesting entry, which means it'd fail to get a declaration
block.

On the original test-case it was about the -moz-user-modify property
that contenteditable maps, but it reproduces with any mapped attribute
like hidden, so I used that for WPT.

Flags: needinfo?(emilio)
Attachment #9146953 - Attachment description: Bug 1636516 - When cloning an nsMappedAttributes object, don't copy the sheet pointer. r=edgar → Bug 1636516 - When moving an element to another document, don't drop nsMappedAttributes from its sheet. r=edgar
Severity: normal → S3
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7365c2beddab When moving an element to another document, don't drop nsMappedAttributes from its sheet. r=edgar
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/23512 for changes under testing/web-platform/tests
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla78

Good job, thank you!

Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: