Open Bug 1928842 Opened 1 year ago Updated 1 year ago

Content-editable element does not match :read-write if it is newly created and haven’t yet been appended to the DOM tree

Categories

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

Firefox 134
defect

Tracking

()

People

(Reporter: kazz, Unassigned)

Details

(Keywords: parity-chrome)

Attachments

(2 files)

Attached file test.html —

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

Steps to reproduce:

  1. open the attached html file
  2. check the output result

Actual results:

Detached:
div.matches(':read-write'): expected: true, actual: false.

Expected results:

Detached:
div.matches(':read-write'): expected: true, actual: true.

Chrome outputs div.matches(':read-write'): expected: true, actual: true.

The Bugbug bot thinks this bug should belong to the 'Core::DOM: Core & HTML' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → DOM: Core & HTML
Product: Firefox → Core
Component: DOM: Core & HTML → DOM: Editor
Attached file test2.html —

The issue only occurs with newly created elements that haven’t yet been appended to the DOM tree. Once the element is appended to the tree, it continues to work even if it’s later detached.

It looks like this is because the editable state depends on Element::BindToTree to be updated properly.

Severity: -- → S3
Summary: Content-editable element does not match :read-write if the element is detached from the DOM tree. → Content-editable element does not match :read-write if it is newly created and haven’t yet been appended to the DOM tree
Component: DOM: Editor → DOM: Core & HTML
Keywords: parity-chrome
OS: Unspecified → All
Hardware: Unspecified → All
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: