Add tentative WPT for checking the handling of `insertParagraph` in elements outside `<body>`
Categories
(Core :: DOM: Editor, enhancement, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox104 | --- | fixed |
People
(Reporter: masayuki, Assigned: masayuki)
References
(Blocks 2 open bugs)
Details
Attachments
(1 file)
Web apps sometimes insert <div>
or something outside <body>
element. Currently, I know it's used for only temporarily, e.g., for a placeholder of pasting content.
On the other hand, we sometimes get bug reports about editing outside <body>
, for example, <title>
and <style>
. Currently, our HTMLEditor
does not support editing outside <body>
for avoiding to delete important elements and to avoiding to create odd DOM tree. However, this is also a potential web-compat risk. So for when we work on supporting it, we need a rough design of how to handle it.
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 1•2 years ago
|
||
There are some cases which may put <div>
elements outside <body>
especially when the document type is XHTML etc. For backward compatibility, I think that we should keep allowing browsers split/join normal elements which are visible in <body>
by default, however, we should not allow to delete <head>
, <body>
, <script>
, <style>
, <meta>
, <title>
, <link>
by users' operation.
Assignee | ||
Comment 2•2 years ago
|
||
I think that these edge cases are not reasonable for any web apps, but browsers
need to take care for avoiding odd result including crash.
I believe that the simplest approach is, elements which are children of <html>
or <head>
should be treated like as <body>
which is never unwrapped nor
joined with the other elements. However, the behavior is incompatible with
browsers, so doing it may break existing web apps.
Therefore, I think that the reasonable approach is, browsers should split
normal elements which is usually visible and appear in <body>
should be
split even if they are outside the <body>
. However, some special elements
such as <style>
and <script>
which may be appear in <head>
but usually
invisible and affects entire the document should not be split.
The following patch adds delete/join cases.
Description
•