Title: [180464] trunk
Revision
180464
Author
[email protected]
Date
2015-02-20 15:27:39 -0800 (Fri, 20 Feb 2015)

Log Message

Invalid assert in CompositeEditCommand::insertNodeAfter/insertNodeBefore
https://bugs.webkit.org/show_bug.cgi?id=141854

Reviewed by Ryosuke Niwa.

Inserting content before/after the body as the result of editing is a valid operation.
This assert was originally introduced to cover cases where edited content would get moved
out of body. However, asserting such operation properly is not possible atm.

Source/WebCore:

Test: editing/inserting/insert-as-body-sibling.html

* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::insertNodeBefore):
(WebCore::CompositeEditCommand::insertNodeAfter):

LayoutTests:

* editing/inserting/insert-as-body-sibling-expected.txt: Added.
* editing/inserting/insert-as-body-sibling.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (180463 => 180464)


--- trunk/LayoutTests/ChangeLog	2015-02-20 23:13:08 UTC (rev 180463)
+++ trunk/LayoutTests/ChangeLog	2015-02-20 23:27:39 UTC (rev 180464)
@@ -1,3 +1,17 @@
+2015-02-20  Zalan Bujtas  <[email protected]>
+
+        Invalid assert in CompositeEditCommand::insertNodeAfter/insertNodeBefore
+        https://bugs.webkit.org/show_bug.cgi?id=141854
+
+        Reviewed by Ryosuke Niwa.
+
+        Inserting content before/after the body as the result of editing is a valid operation.
+        This assert was originally introduced to cover cases where edited content would get moved
+        out of body. However, asserting such operation properly is not possible atm.
+
+        * editing/inserting/insert-as-body-sibling-expected.txt: Added.
+        * editing/inserting/insert-as-body-sibling.html: Added.
+
 2015-02-20  Alexey Proskuryakov  <[email protected]>
 
         svg/animations/animateMotion-additive-2a.svg and svg/animations/animateMotion-additive-2b.svg

Added: trunk/LayoutTests/editing/inserting/insert-as-body-sibling-expected.txt (0 => 180464)


--- trunk/LayoutTests/editing/inserting/insert-as-body-sibling-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/editing/inserting/insert-as-body-sibling-expected.txt	2015-02-20 23:27:39 UTC (rev 180464)
@@ -0,0 +1,2 @@
+
+Pass if no assert or crash in debug.

Added: trunk/LayoutTests/editing/inserting/insert-as-body-sibling.html (0 => 180464)


--- trunk/LayoutTests/editing/inserting/insert-as-body-sibling.html	                        (rev 0)
+++ trunk/LayoutTests/editing/inserting/insert-as-body-sibling.html	2015-02-20 23:27:39 UTC (rev 180464)
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<head>
+<title>This tests if inserting content as body sibling triggers assertion.</title>
+</head>
+<div>Pass if no assert or crash in debug.</div>
+<script>
+	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);
+</script>

Modified: trunk/Source/WebCore/ChangeLog (180463 => 180464)


--- trunk/Source/WebCore/ChangeLog	2015-02-20 23:13:08 UTC (rev 180463)
+++ trunk/Source/WebCore/ChangeLog	2015-02-20 23:27:39 UTC (rev 180464)
@@ -1,3 +1,20 @@
+2015-02-20  Zalan Bujtas  <[email protected]>
+
+        Invalid assert in CompositeEditCommand::insertNodeAfter/insertNodeBefore
+        https://bugs.webkit.org/show_bug.cgi?id=141854
+
+        Reviewed by Ryosuke Niwa.
+
+        Inserting content before/after the body as the result of editing is a valid operation.
+        This assert was originally introduced to cover cases where edited content would get moved
+        out of body. However, asserting such operation properly is not possible atm.
+
+        Test: editing/inserting/insert-as-body-sibling.html
+
+        * editing/CompositeEditCommand.cpp:
+        (WebCore::CompositeEditCommand::insertNodeBefore):
+        (WebCore::CompositeEditCommand::insertNodeAfter):
+
 2015-02-20  Chris Dumez  <[email protected]>
 
         [WK2] Add more detailed diagnostic logging for measuring network cache efficacy

Modified: trunk/Source/WebCore/editing/CompositeEditCommand.cpp (180463 => 180464)


--- trunk/Source/WebCore/editing/CompositeEditCommand.cpp	2015-02-20 23:13:08 UTC (rev 180463)
+++ trunk/Source/WebCore/editing/CompositeEditCommand.cpp	2015-02-20 23:27:39 UTC (rev 180464)
@@ -322,7 +322,6 @@
 
 void CompositeEditCommand::insertNodeBefore(PassRefPtr<Node> insertChild, PassRefPtr<Node> refChild, ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable)
 {
-    ASSERT(!refChild->hasTagName(bodyTag));
     applyCommandToComposite(InsertNodeBeforeCommand::create(insertChild, refChild, shouldAssumeContentIsAlwaysEditable));
 }
 
@@ -330,7 +329,6 @@
 {
     ASSERT(insertChild);
     ASSERT(refChild);
-    ASSERT(!refChild->hasTagName(bodyTag));
     ContainerNode* parent = refChild->parentNode();
     ASSERT(parent);
     ASSERT(!parent->isShadowRoot());
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to