Title: [145641] branches/safari-536.30-branch/Source/WebCore

Diff

Modified: branches/safari-536.30-branch/Source/WebCore/ChangeLog (145640 => 145641)


--- branches/safari-536.30-branch/Source/WebCore/ChangeLog	2013-03-13 00:47:49 UTC (rev 145640)
+++ branches/safari-536.30-branch/Source/WebCore/ChangeLog	2013-03-13 00:50:02 UTC (rev 145641)
@@ -1,5 +1,28 @@
 2013-03-12  Lucas Forschler  <[email protected]>
 
+        Merge r138657
+
+    2013-01-02  Abhishek Arya  <[email protected]>
+
+            Crash in WebCore::Element::cloneElementWithoutChildren.
+            https://bugs.webkit.org/show_bug.cgi?id=105949
+
+            Reviewed by Ryosuke Niwa.
+
+            RefPtr |ancestors| vector since its elements can be destroyed from mutation events
+            fired in CompositeEditCommand::appendNode. 
+
+            No new tests. The testcase relies on recursive DOM mutations and does not minimize.
+
+            * editing/InsertParagraphSeparatorCommand.cpp:
+            (WebCore::InsertParagraphSeparatorCommand::getAncestorsInsideBlock):
+            (WebCore::InsertParagraphSeparatorCommand::cloneHierarchyUnderNewBlock):
+            (WebCore::InsertParagraphSeparatorCommand::doApply):
+            * editing/InsertParagraphSeparatorCommand.h:
+            (InsertParagraphSeparatorCommand):
+
+2013-03-12  Lucas Forschler  <[email protected]>
+
         Merge r138316
 
     2012-12-20  Stephen Chenney  <[email protected]>

Modified: branches/safari-536.30-branch/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp (145640 => 145641)


--- branches/safari-536.30-branch/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp	2013-03-13 00:47:49 UTC (rev 145640)
+++ branches/safari-536.30-branch/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp	2013-03-13 00:50:02 UTC (rev 145641)
@@ -119,7 +119,7 @@
            enclosingBlock->hasTagName(h5Tag);
 }
 
-void InsertParagraphSeparatorCommand::getAncestorsInsideBlock(const Node* insertionNode, Element* outerBlock, Vector<Element*>& ancestors)
+void InsertParagraphSeparatorCommand::getAncestorsInsideBlock(const Node* insertionNode, Element* outerBlock, Vector<RefPtr<Element> >& ancestors)
 {
     ancestors.clear();
     
@@ -130,7 +130,7 @@
     }
 }
 
-PassRefPtr<Element> InsertParagraphSeparatorCommand::cloneHierarchyUnderNewBlock(const Vector<Element*>& ancestors, PassRefPtr<Element> blockToInsert)
+PassRefPtr<Element> InsertParagraphSeparatorCommand::cloneHierarchyUnderNewBlock(const Vector<RefPtr<Element> >& ancestors, PassRefPtr<Element> blockToInsert)
 {
     // Make clones of ancestors in between the start node and the start block.
     RefPtr<Element> parent = blockToInsert;
@@ -240,7 +240,7 @@
 
         // Recreate the same structure in the new paragraph.
         
-        Vector<Element*> ancestors;
+        Vector<RefPtr<Element> > ancestors;
         getAncestorsInsideBlock(positionOutsideTabSpan(insertionPosition).deprecatedNode(), startBlock.get(), ancestors);      
         RefPtr<Element> parent = cloneHierarchyUnderNewBlock(ancestors, blockToInsert);
         
@@ -279,7 +279,7 @@
 
         // Recreate the same structure in the new paragraph.
 
-        Vector<Element*> ancestors;
+        Vector<RefPtr<Element> > ancestors;
         getAncestorsInsideBlock(positionAvoidingSpecialElementBoundary(positionOutsideTabSpan(insertionPosition)).deprecatedNode(), startBlock.get(), ancestors);
         
         appendBlockPlaceholder(cloneHierarchyUnderNewBlock(ancestors, blockToInsert));

Modified: branches/safari-536.30-branch/Source/WebCore/editing/InsertParagraphSeparatorCommand.h (145640 => 145641)


--- branches/safari-536.30-branch/Source/WebCore/editing/InsertParagraphSeparatorCommand.h	2013-03-13 00:47:49 UTC (rev 145640)
+++ branches/safari-536.30-branch/Source/WebCore/editing/InsertParagraphSeparatorCommand.h	2013-03-13 00:50:02 UTC (rev 145641)
@@ -46,8 +46,8 @@
 
     void calculateStyleBeforeInsertion(const Position&);
     void applyStyleAfterInsertion(Node* originalEnclosingBlock);
-    void getAncestorsInsideBlock(const Node* insertionNode, Element* outerBlock, Vector<Element*>& ancestors);
-    PassRefPtr<Element> cloneHierarchyUnderNewBlock(const Vector<Element*>& ancestors, PassRefPtr<Element> blockToInsert);
+    void getAncestorsInsideBlock(const Node* insertionNode, Element* outerBlock, Vector<RefPtr<Element> >& ancestors);
+    PassRefPtr<Element> cloneHierarchyUnderNewBlock(const Vector<RefPtr<Element> >& ancestors, PassRefPtr<Element> blockToInsert);
 
     bool shouldUseDefaultParagraphElement(Node*) const;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to