Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(606)

Unified Diff: Source/core/editing/CompositeEditCommand.cpp

Issue 698113005: The ASSERT in appendNode() should not fire when OBJECTS are cloned. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: no setTimeout Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/editing/execCommand/crash-object-cloning-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/CompositeEditCommand.cpp
diff --git a/Source/core/editing/CompositeEditCommand.cpp b/Source/core/editing/CompositeEditCommand.cpp
index e05df2ca12e94aeec032c1b456f1697eed4e9920..e461eb2ec209c6c5d3e014321a5b6108212ce7af 100644
--- a/Source/core/editing/CompositeEditCommand.cpp
+++ b/Source/core/editing/CompositeEditCommand.cpp
@@ -360,7 +360,12 @@ void CompositeEditCommand::insertNodeAt(PassRefPtrWillBeRawPtr<Node> insertChild
void CompositeEditCommand::appendNode(PassRefPtrWillBeRawPtr<Node> node, PassRefPtrWillBeRawPtr<ContainerNode> parent)
{
- ASSERT(canHaveChildrenForEditing(parent.get()));
+ // When cloneParagraphUnderNewElement() clones the fallback content
+ // of an OBJECT element, the ASSERT below may fire since the return
+ // value of canHaveChildrenForEditing is not reliable until the render
+ // object of the OBJECT is created. Hence we ignore this check for OBJECTs.
+ ASSERT(canHaveChildrenForEditing(parent.get())
+ || (parent->isElementNode() && toElement(parent.get())->tagQName() == objectTag));
applyCommandToComposite(AppendNodeCommand::create(parent, node));
}
« no previous file with comments | « LayoutTests/editing/execCommand/crash-object-cloning-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698