Bug 141854

Summary: Invalid assert in CompositeEditCommand::insertNodeAfter/insertNodeBefore
Product: WebKit Reporter: zalan <zalan>
Component: HTML EditingAssignee: zalan <zalan>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

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.