Bug 141854 - Invalid assert in CompositeEditCommand::insertNodeAfter/insertNodeBefore
Summary: Invalid assert in CompositeEditCommand::insertNodeAfter/insertNodeBefore
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: zalan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-20 14:00 PST by zalan
Modified: 2015-02-20 15:27 PST (History)
1 user (show)

See Also:


Attachments
Patch (3.93 KB, patch)
2015-02-20 14:17 PST, zalan
no flags Details | Formatted Diff | Diff
Patch (4.29 KB, patch)
2015-02-20 14:22 PST, zalan
no flags Details | Formatted Diff | Diff
Patch (4.31 KB, patch)
2015-02-20 14:26 PST, zalan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description zalan 2015-02-20 14:00:29 PST
ASSERT(!refChild->hasTagName(bodyTag)); should be allowed
Comment 1 zalan 2015-02-20 14:17:40 PST
Created attachment 247002 [details]
Patch
Comment 2 Ryosuke Niwa 2015-02-20 14:19:20 PST
Comment on attachment 247002 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=247002&action=review

> Source/WebCore/ChangeLog:8
> +        Inserting content before/after the body as the result of editing is a valid operation.

I think we should elaborate that while we don't want to move nodes out of body element, we can't check that condition with these assertions.

> LayoutTests/editing/inserting/insert-as-body-sibling.html:1
> +<head>

Missing DOCTYPE.

> LayoutTests/editing/inserting/insert-as-body-sibling.html:13
> +  if (window.testRunner)
> +    testRunner.dumpAsText();
> +
> +  var iframe = document.createElement("iframe");
> +  document.head.parentNode.insertBefore(iframe, document.head.nextSibling);
> +  document.execCommand("SelectAll");
> +  document.designMode = "on";
> +  document.execCommand("JustifyCenter", false, null);

Please indent by 4 spaces, not 2 spaces.
Comment 3 zalan 2015-02-20 14:22:40 PST
Created attachment 247003 [details]
Patch
Comment 4 zalan 2015-02-20 14:26:21 PST
Created attachment 247004 [details]
Patch
Comment 5 zalan 2015-02-20 14:26:48 PST
(In reply to comment #2)
> Comment on attachment 247002 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=247002&action=review
> 
> > Source/WebCore/ChangeLog:8
> > +        Inserting content before/after the body as the result of editing is a valid operation.
> 
> I think we should elaborate that while we don't want to move nodes out of
> body element, we can't check that condition with these assertions.
> 
> > LayoutTests/editing/inserting/insert-as-body-sibling.html:1
> > +<head>
> 
> Missing DOCTYPE.
> 
> > LayoutTests/editing/inserting/insert-as-body-sibling.html:13
> > +  if (window.testRunner)
> > +    testRunner.dumpAsText();
> > +
> > +  var iframe = document.createElement("iframe");
> > +  document.head.parentNode.insertBefore(iframe, document.head.nextSibling);
> > +  document.execCommand("SelectAll");
> > +  document.designMode = "on";
> > +  document.execCommand("JustifyCenter", false, null);
> 
> Please indent by 4 spaces, not 2 spaces.

Done. Thanks.
Comment 6 WebKit Commit Bot 2015-02-20 15:27:53 PST
Comment on attachment 247004 [details]
Patch

Clearing flags on attachment: 247004

Committed r180464: <http://trac.webkit.org/changeset/180464>
Comment 7 WebKit Commit Bot 2015-02-20 15:27:58 PST
All reviewed patches have been landed.  Closing bug.