Bug 86341 - document.execCommand('Indent') in the direct child of ShadowRoot causes a crash
: document.execCommand('Indent') in the direct child of ShadowRoot causes a crash
Status: RESOLVED FIXED
: WebKit
HTML Editing
: 528+ (Nightly build)
: Unspecified Unspecified
: P2 Normal
Assigned To:
:
:
:
: 82697
  Show dependency treegraph
 
Reported: 2012-05-14 00:06 PST by
Modified: 2012-05-15 01:23 PST (History)


Attachments
Patch (11.86 KB, patch)
2012-05-14 00:50 PST, Shinya Kawanaka
no flags Review Patch | Details | Formatted Diff | Diff
Patch (16.49 KB, patch)
2012-05-14 01:47 PST, Shinya Kawanaka
no flags Review Patch | Details | Formatted Diff | Diff
Patch for landing (16.95 KB, patch)
2012-05-15 00:37 PST, Shinya Kawanaka
no flags Review Patch | Details | Formatted Diff | Diff


Note

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


Description From 2012-05-14 00:06:17 PST
Repro: Select hoge and press Indent.

<div id="container"></div>
<button onclick="document.execCommand("Indent")" value="Indent">

<script>
var container = document.getElementById('container');
var shadowRoot = new WebKitShadowRoot(container);
shadowRoot.innerHTML = "<span contenteditable>hoge</span>";
</script>
------- Comment #1 From 2012-05-14 00:50:02 PST -------
Created an attachment (id=141660) [details]
Patch
------- Comment #2 From 2012-05-14 01:13:55 PST -------
(From update of attachment 141660 [details])
Attachment 141660 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/12680398
------- Comment #3 From 2012-05-14 01:31:18 PST -------
(From update of attachment 141660 [details])
Attachment 141660 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/12679436
------- Comment #4 From 2012-05-14 01:47:43 PST -------
Created an attachment (id=141665) [details]
Patch
------- Comment #5 From 2012-05-14 01:48:16 PST -------
Try to fix build...
------- Comment #6 From 2012-05-14 12:23:21 PST -------
(From update of attachment 141665 [details])
View in context: https://bugs.webkit.org/attachment.cgi?id=141665&action=review

Looks sane to me.

> LayoutTests/editing/shadow/execcommand-indent-in-shadow.html:1
> + <!DOCTYPE html>

Why do we have a space before <!DOCTYPE?
------- Comment #7 From 2012-05-14 12:27:10 PST -------
(From update of attachment 141665 [details])
I’d rather see the type be ContainerNode rather than Node in a case like this.
------- Comment #8 From 2012-05-14 12:30:42 PST -------
(In reply to comment #7)
> (From update of attachment 141665 [details] [details])
> I’d rather see the type be ContainerNode rather than Node in a case like this.

That's a good point. Please address Darin's comment before you land it.
------- Comment #9 From 2012-05-14 18:30:00 PST -------
(In reply to comment #8)
> (In reply to comment #7)
> > (From update of attachment 141665 [details] [details] [details])
> > I’d rather see the type be ContainerNode rather than Node in a case like this.
> 
> That's a good point. Please address Darin's comment before you land it.

Thank you for reviewing!
Yeah, I'll fix them to land it.
------- Comment #10 From 2012-05-15 00:37:30 PST -------
Created an attachment (id=141878) [details]
Patch for landing
------- Comment #11 From 2012-05-15 01:23:41 PST -------
Committed r117041: <http://trac.webkit.org/changeset/117041>