Bug 89054
Summary: | document.execCommand('Indent') removes Shadow DOM. | ||
---|---|---|---|
Product: | WebKit | Reporter: | Shinya Kawanaka <shinyak> |
Component: | HTML Editing | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED WONTFIX | ||
Severity: | Normal | CC: | dglazkov, dominicc, enrica, hayato, morrita, rniwa, tasak |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Bug Depends on: | |||
Bug Blocks: | 82697 |
Shinya Kawanaka
Repro:
<div contenteditable>
BEFORE HOST
<div id="host">HOST</div>
AFTER HOST
</div>
Shadow DOM for host
<span>BEFORE SHADOW<shadow></shadow>AFTER SHADOW</span>
When performing document.execCommand('Indent') in BEFORE HOST, the Shadow DOM for host disappears.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Shinya Kawanaka
This is because node->cloneNode() does not clone Shadow DOM.
However, if we clone Shadow DOM always, it might be harmful for existing elements e.g. <input> etc. We should think this more.
Shinya Kawanaka
See also: CompositeEditCommand::moveParagraphWithClones()
Shinya Kawanaka
We should discuss how do we clone Shadow DOM (or do not clone Shadow DOM) before fixing this problem.
Hayato Ito
I think editing command should treat pure DOM structures in general.
That means if we clone some nodes in editing, it is okay that everything that can not be serialized into text is not cloned. like event listeners or attached Shadow DOM created by user.
So I vote for WONTFIX for now.
(In reply to comment #3)
> We should discuss how do we clone Shadow DOM (or do not clone Shadow DOM) before fixing this problem.
Shinya Kawanaka
(In reply to comment #4)
> I think editing command should treat pure DOM structures in general.
> That means if we clone some nodes in editing, it is okay that everything that can not be serialized into text is not cloned. like event listeners or attached Shadow DOM created by user.
>
> So I vote for WONTFIX for now.
>
> (In reply to comment #3)
> > We should discuss how do we clone Shadow DOM (or do not clone Shadow DOM) before fixing this problem.
Yeah, I agree with you.
Something weid things like disappearing Shadow DOM or Event Listeners etc. cannot be evitable for now. We should discuss this more, but we have higher priority things than this.
I vote for closing as LATER.
Ryosuke Niwa
This is same thing as shadow DOM being lost in copy & paste. Won't fix.