From b60c0efa9d0b30bc09b2d648ab6569d22ae23d9e Mon Sep 17 00:00:00 2001 From: justing Date: Sat, 25 Aug 2007 01:20:33 +0000 Subject: [PATCH] WebCore: Reviewed by Darin. GoogleDocs: A hang occurs when applying list style to selected table * editing/DeleteSelectionCommand.cpp: (WebCore::DeleteSelectionCommand::handleGeneralDelete): If the position that marked the start of the range to delete has been removed from the document, and it was inside the node that holds the position that marks the end of the range to delete, don't remove any children of that node, because we don't know how many to remove. For example, if the end is [a, 5] and the start was in some descendant of a and was removed, don't remove any of the children of a. We will now refuse to remove some content incorrectly, but that's less dangerous than removing content incorrectly. Long term we need to update these positions as we remove content from the document, but that seems like a more risky change. Added a testcase. * editing/InsertListCommand.cpp: (WebCore::InsertListCommand::modifyRange): If the end of the selection to modify is just after a table, and if the start of the selection is inside that table, the last paragraph that we'll want modify is the last one inside the table, not the paragraph that contains the table itself. Adjust startOfLastParagraph here to avoid infinite recursion. LayoutTests: Reviewed by Darin. GoogleDocs: A hang occurs when applying list style to selected table * editing/execCommand/5432254-1.html: Added. * editing/execCommand/5432254-2.html: Added. * platform/mac/editing/execCommand: Added. * platform/mac/editing/execCommand/5432254-1-expected.checksum: Added. * platform/mac/editing/execCommand/5432254-1-expected.png: Added. * platform/mac/editing/execCommand/5432254-1-expected.txt: Added. * platform/mac/editing/execCommand/5432254-2-expected.checksum: Added. * platform/mac/editing/execCommand/5432254-2-expected.png: Added. * platform/mac/editing/execCommand/5432254-2-expected.txt: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@25229 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- LayoutTests/ChangeLog | 16 +++++++++++ .../execCommand/5432254-1-expected.checksum | 1 + .../execCommand/5432254-1-expected.png | Bin 0 -> 12407 bytes .../execCommand/5432254-1-expected.txt | 22 +++++++++++++++ .../execCommand/5432254-2-expected.checksum | 1 + .../execCommand/5432254-2-expected.png | Bin 0 -> 9789 bytes .../execCommand/5432254-2-expected.txt | 25 ++++++++++++++++++ WebCore/ChangeLog | 24 +++++++++++++++++ WebCore/editing/DeleteSelectionCommand.cpp | 11 ++++++-- WebCore/editing/InsertListCommand.cpp | 8 ++++++ 10 files changed, 106 insertions(+), 2 deletions(-) create mode 100644 LayoutTests/platform/mac/editing/execCommand/5432254-1-expected.checksum create mode 100644 LayoutTests/platform/mac/editing/execCommand/5432254-1-expected.png create mode 100644 LayoutTests/platform/mac/editing/execCommand/5432254-1-expected.txt create mode 100644 LayoutTests/platform/mac/editing/execCommand/5432254-2-expected.checksum create mode 100644 LayoutTests/platform/mac/editing/execCommand/5432254-2-expected.png create mode 100644 LayoutTests/platform/mac/editing/execCommand/5432254-2-expected.txt diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index af1b4f4f0ed0..65fb80e0f839 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,19 @@ +2007-08-24 Justin Garcia + + Reviewed by Darin. + + GoogleDocs: A hang occurs when applying list style to selected table + + * editing/execCommand/5432254-1.html: Added. + * editing/execCommand/5432254-2.html: Added. + * platform/mac/editing/execCommand: Added. + * platform/mac/editing/execCommand/5432254-1-expected.checksum: Added. + * platform/mac/editing/execCommand/5432254-1-expected.png: Added. + * platform/mac/editing/execCommand/5432254-1-expected.txt: Added. + * platform/mac/editing/execCommand/5432254-2-expected.checksum: Added. + * platform/mac/editing/execCommand/5432254-2-expected.png: Added. + * platform/mac/editing/execCommand/5432254-2-expected.txt: Added. + 2007-08-24 Anders Carlsson Reviewed by Geoff. diff --git a/LayoutTests/platform/mac/editing/execCommand/5432254-1-expected.checksum b/LayoutTests/platform/mac/editing/execCommand/5432254-1-expected.checksum new file mode 100644 index 000000000000..ce3a6d234fc5 --- /dev/null +++ b/LayoutTests/platform/mac/editing/execCommand/5432254-1-expected.checksum @@ -0,0 +1 @@ +d4c893a03c062eb91ff0a04f0628f65f \ No newline at end of file diff --git a/LayoutTests/platform/mac/editing/execCommand/5432254-1-expected.png b/LayoutTests/platform/mac/editing/execCommand/5432254-1-expected.png new file mode 100644 index 0000000000000000000000000000000000000000..87079ceb05c829514e68e46ff7b29cd2ef003b77 GIT binary patch literal 12407 zcmeHtd03NY)_xqPbw;a}x`3<}tB42`WnZ0&P*GsmK?tctM7AIV2m%4e)`~2lwk*n8 z(GUUzWDR?&0#OhsTUbJZ5?K;RSR@ek@4WPyncp(={jT42&G%pV$N1(=-sd^bIrq8m z`{e##Z7lchmfej)q4r+<+T0$6+IbX(`h)AAK87n9;dgGLP)AW0&Hv&UktO6rW%YY! z@0!zm`L^Kp&o94=I8Sazm1q1g@TUKb_Tx7%zEo@JZ|O_Vv`7!6Cy4U93u|i8&jPB_ zUbJ7ICg1$a+*hCb^=LFaJy_LorsR(PFQ2@5QxPi}YqP+MgRC(~@ehAOp?*k0{Q-r#cI-A>8T!*v6zZJrzqxE8 zdrnqXcC1AjGZV5hT;8(ZcRxZp;&YXRwGG z>{gtWV|>D>NHaYH8yWe=VsZ1ILFmLg1of#ZkEJu#z550REOSkXUXra z*=T6GwbF%L9qY~AT->)&QD|Sf98*;^d<1W<)iUwkYVDVD@Ak20FZcN`d)Rumhdal# z*#DW56X_SZxiYyYnJ`LR4ux0JikR39v2SbQ5mj=E1xfx<)26tT;Ks_(@$Wg?W$fVh z6Wcc+;PQuwjv`5ziJisy^XCPlj95Qk-;1i`#Ujjx-#tP10gd{Z^3a9XD(O|CumN=X z_xlvCu<8`p1@+7#kMsBTS@%+GXR8)2xz&aG%6|FHxjKG+=CH}uSb}E$xBE@?(ZMZ; z4yC$WbSLCv*V1KegT6>z_@UTN_=nmk^6c>0lsy0zGkxQcYLz(Y_Y zo@mIN9_e!rvr;9es=4I9dwGxY`T6gkR{0N9yXz8H7Z+PJW6IpcgLV)aapXc|?yoj(TcIuShxl*5-LGLR;`Pi1xW>S^Tp`_&DBMI z?|5BRRn>eoy^&V&Y2UbiHI5^T_H}7^+7&3nG=PB z<7RrNqglA29lPW|#cZt(U||Wu&7ICxwSk;Rox=>uFohUk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literal 0 HcmV?d00001 diff --git a/LayoutTests/platform/mac/editing/execCommand/5432254-2-expected.txt b/LayoutTests/platform/mac/editing/execCommand/5432254-2-expected.txt new file mode 100644 index 000000000000..0641428c92e1 --- /dev/null +++ b/LayoutTests/platform/mac/editing/execCommand/5432254-2-expected.txt @@ -0,0 +1,25 @@ +layer at (0,0) size 800x600 + RenderView at (0,0) size 800x600 +layer at (0,0) size 800x600 + RenderBlock {HTML} at (0,0) size 800x600 + RenderBody {BODY} at (8,8) size 784x584 + RenderBlock {P} at (0,0) size 784x18 + RenderText {#text} at (0,0) size 665x18 + text run at (0,0) width 182: "This tests for a deletion bug. " + text run at (182,0) width 483: "The paragraph inside the table should be in a list, and the test shouldn't hang." + RenderBlock {DIV} at (0,34) size 784x62 + RenderBlock {DIV} at (0,0) size 784x44 + RenderTable {TABLE} at (0,0) size 71x44 [border: (1px outset #808080)] + RenderTableSection {TBODY} at (1,1) size 69x42 + RenderTableRow {TR} at (0,2) size 69x38 + RenderTableCell {TD} at (2,2) size 65x38 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1] + RenderBlock {UL} at (2,2) size 61x18 + RenderListItem {LI} at (40,0) size 21x18 + RenderListMarker at (-17,0) size 7x18: bullet + RenderText {#text} at (0,0) size 21x18 + text run at (0,0) width 21: "foo" + RenderBlock (anonymous) at (2,36) size 61x0 + RenderBlock (anonymous) at (0,44) size 784x18 + RenderBR {BR} at (0,0) size 0x18 +selection start: position 0 of child 0 {TABLE} of child 0 {DIV} of child 2 {DIV} of child 0 {BODY} of child 0 {HTML} of document +selection end: position 1 of child 0 {TABLE} of child 0 {DIV} of child 2 {DIV} of child 0 {BODY} of child 0 {HTML} of document diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog index a2328f681f9a..304a36ba8858 100644 --- a/WebCore/ChangeLog +++ b/WebCore/ChangeLog @@ -1,3 +1,27 @@ +2007-08-23 Justin Garcia + + Reviewed by Darin. + + GoogleDocs: A hang occurs when applying list style to selected table + + * editing/DeleteSelectionCommand.cpp: + (WebCore::DeleteSelectionCommand::handleGeneralDelete): If the position + that marked the start of the range to delete has been removed from the + document, and it was inside the node that holds the position that marks + the end of the range to delete, don't remove any children of that node, + because we don't know how many to remove. For example, if the end is + [a, 5] and the start was in some descendant of a and was removed, don't + remove any of the children of a. We will now refuse to remove some content + incorrectly, but that's less dangerous than removing content incorrectly. + Long term we need to update these positions as we remove content from the + document, but that seems like a more risky change. Added a testcase. + * editing/InsertListCommand.cpp: + (WebCore::InsertListCommand::modifyRange): If the end of the selection to + modify is just after a table, and if the start of the selection is inside + that table, the last paragraph that we'll want modify is the last one inside + the table, not the paragraph that contains the table itself. Adjust + startOfLastParagraph here to avoid infinite recursion. + 2007-08-24 Anders Carlsson Reviewed by Geoff. diff --git a/WebCore/editing/DeleteSelectionCommand.cpp b/WebCore/editing/DeleteSelectionCommand.cpp index a6bf480a17b6..faf8562e3802 100644 --- a/WebCore/editing/DeleteSelectionCommand.cpp +++ b/WebCore/editing/DeleteSelectionCommand.cpp @@ -404,8 +404,9 @@ void DeleteSelectionCommand::handleGeneralDelete() } } else { + bool startNodeWasDescendantOfEndNode = m_upstreamStart.node()->isDescendantOf(m_downstreamEnd.node()); // The selection to delete spans more than one node. - RefPtr node = startNode; + RefPtr node(startNode); if (startOffset > 0) { if (startNode->isTextNode()) { @@ -456,7 +457,13 @@ void DeleteSelectionCommand::handleGeneralDelete() deleteTextFromNode(text, 0, m_downstreamEnd.offset()); m_downstreamEnd = Position(text, 0); } - } else { + // Remove children of m_downstreamEnd.node() that come after m_upstreamStart. + // Don't try to remove children if m_upstreamStart was inside m_downstreamEnd.node() + // and m_upstreamStart has been removed from the document, because then we don't + // know how many children to remove. + // FIXME: Make m_upstreamStart a position we update as we remove content, then we can + // always know which children to remove. + } else if (!(startNodeWasDescendantOfEndNode && !m_upstreamStart.node()->inDocument())) { int offset = 0; if (m_upstreamStart.node()->isDescendantOf(m_downstreamEnd.node())) { Node *n = m_upstreamStart.node(); diff --git a/WebCore/editing/InsertListCommand.cpp b/WebCore/editing/InsertListCommand.cpp index 063580bcd019..093b637fa1fd 100644 --- a/WebCore/editing/InsertListCommand.cpp +++ b/WebCore/editing/InsertListCommand.cpp @@ -65,6 +65,14 @@ bool InsertListCommand::modifyRange() VisiblePosition visibleEnd = endingSelection().visibleEnd(); VisiblePosition startOfLastParagraph = startOfParagraph(visibleEnd); + // If the end of the selection to modify is just after a table, and + // if the start of the selection is inside that table, the last paragraph + // that we'll want modify is the last one inside the table, not the table itself. + // Adjust startOfLastParagraph here to avoid infinite recursion. + if (Node* table = isFirstPositionAfterTable(visibleEnd)) + if (visibleStart.deepEquivalent().node()->isDescendantOf(table)) + startOfLastParagraph = startOfParagraph(visibleEnd.previous(true)); + if (startOfParagraph(visibleStart) == startOfLastParagraph) return false; -- 2.36.0