[webkit-reviews] review requested: [Bug 7579] TinyMCE: Implement execCommand(insertImage, ...) : [Attachment 6911] patch

bugzilla-request-daemon at opendarwin.org bugzilla-request-daemon at opendarwin.org
Tue Mar 7 01:09:12 PST 2006

Justin Garcia <justin.garcia at apple.com> has asked David Harrison
<harrison at apple.com> for review:
Bug 7579: TinyMCE: Implement execCommand(insertImage, ...)

Attachment 6911: patch

------- Additional Comments from Justin Garcia <justin.garcia at apple.com>
Implemented InsertHTML and added a layout test.
ReplaceSelectionCommand wasn't pruning empty non-blockflow containers (like
<span></span>), or empty blockflow containers with non-zero height (like <div
style="border: 1px solid black;"></div>).

-	     QPtrList<NodeImpl> blocks;
-	     NodeImpl *node = beyondEndNode->enclosingInlineElement();
-	     NodeImpl *refNode = m_lastNodeInserted.get();
+	     NodeImpl* node = beyondEndNode->enclosingInlineElement();
+	     NodeImpl* refNode = m_lastNodeInserted.get();
+	     NodeImpl* nodeToPrune = node->parentNode();
	     while (node) {
		 if (node->isBlockFlowOrBlockTable())
		 NodeImpl *next = node->nextSibling();
-		 blocks.append(node->enclosingBlockFlowElement());
		 computeAndStoreNodeDesiredStyle(node, styles);

Using a QPtrList wasn't unnecessary.  We're removing siblings, no more than one
enclosingBlockFlowElement would have survived this removal.
Use parentNode() instead of enclosingBlockFlowElement(), if we only want to
prune blockFlows, that should be part of the pruning rule inside

More information about the webkit-reviews mailing list