Open Bug 1454885 Opened 7 years ago Updated 2 years ago

Pressing Enter in <p contenteditable="false"><span contenteditable>foo</span></p> causes splitting non-editable <p> too

Categories

(Core :: DOM: Editor, defect, P3)

defect

Tracking

()

Tracking Status
firefox61 --- affected

People

(Reporter: masayuki, Unassigned)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [h2review-noted])

STR: 1. Go to https://d-toybox.com/studio/lib/input_event_viewer.html 2. Set <textarea> value in "Choose editor type" section to |<p contentediable="false"><span contenteditable>editable span element</span></p>|. 3. Click |<div contenteditable>| 4. Move focus to middle of "editable span element" in the below editor. 5. Press Enter key. Then, Firefox's result is, for example: <p contenteditable="false"><span contenteditable="">editable sp</span></p><p contenteditable="false"><span contenteditable="">an element</span></p> Perhaps, just inserting <br> element is expected behavior since elements whose contenteditable is false shouldn't be split by user operation. FYI: Edge and Chromium's behavior are also odd.
Priority: -- → P3
Whiteboard: [h2review-noted]
Severity: normal → S3

Is this still a bug? I tried the STR in https://software.hixie.ch/utilities/js/live-dom-viewer/saved/11652 and I see a <br> being inserted.

(In reply to James Graham [:jgraham] from comment #1)

Is this still a bug? I tried the STR in https://software.hixie.ch/utilities/js/live-dom-viewer/saved/11652 and I see a <br> being inserted.

No, the test case above is, the DOM is like this:

<div contenteditable="">
  <p contenteditable="false">
    <span contenteditable="">
      #text

Currently, HTMLEditor handles insertParagraph without checking parent contenteditable="false" at caret. Therefore, it's treated as an insertParagraph in a <div> rather than the inner <span contenteditable="">.

You need to log in before you can comment on or make changes to this bug.