Open Bug 1697989 Opened 3 years ago Updated 2 years ago

Inserted position of text is always head in a bodyless document

Categories

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

defect

Tracking

()

ASSIGNED

People

(Reporter: m_kato, Assigned: masayuki)

References

(Depends on 1 open bug, Blocks 2 open bugs)

Details

Attachments

(1 file)

Attached file testcase.html

This isn't critical (P3 or P5) and this depends on attached html since this HTML doesn't seem to generate <body> element.

Env

macOS 11

Step

  1. Open attached HTML
  2. Input any text.

Result

Since caret position isn't updated, inserted character is always head. If using arrow key, inserted position is still head.

Notes

Chrome doesn't insert any text instead.

Weird but indeed looks not critical, since a bodyless document is rare enough.

Severity: -- → S4
Summary: Inserted position of text is always head → Inserted position of text is always head in a bodyless document

Currently, HTMLEditor restricts users to edit everything in <body> element for avoiding bugs of deleting important elements in <head>, etc. However, if I completely do this in HTMLEditor::CanHandleHTMLEditSubAction(), I see a lot of crashtests and some chrome mochitests change the behavior or become oranges. However, bug 1677566 added the restriction only for delete handlers and this inconsistency caused hitting other assertions.

Therefore, this is not important for users though, we need to fix this kind of things for the further work. First of all, I'll write WPT for this hell.

Assignee: nobody → masayuki
Blocks: 1699256
Status: NEW → ASSIGNED
OS: Unspecified → All
Priority: -- → P2
Hardware: Unspecified → All
No longer blocks: 1413131
Depends on: 1413131
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: