Changeset 17386 in webkit
- Timestamp:
- Oct 27, 2006, 1:42:17 PM (19 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r17368 r17386 1 2006-10-26 Justin Garcia <justin.garcia@apple.com> 2 3 Reviewed by harrison 4 5 <http://bugs.webkit.org/show_bug.cgi?id=11423> 6 REGRESSION: First newline missing from textarea's value 7 8 Changes reflect the removal of more brs that were about 9 to collapse: 10 * editing/deleting/delete-4038408-fix-expected.txt: 11 * editing/inserting/insert-3654864-fix-expected.txt: 12 * editing/inserting/insert-3659587-fix-expected.txt: 13 * editing/inserting/insert-3775316-fix-expected.txt: 14 * editing/inserting/insert-at-end-01-expected.txt: 15 * editing/inserting/insert-at-end-02-expected.txt: 16 * editing/inserting/insert-br-001-expected.txt: 17 * editing/inserting/insert-br-005-expected.txt: 18 19 Added to demonstrate fix: 20 * fast/forms/11423-expected.txt: Added. 21 * fast/forms/11423.html: Added. 22 1 23 2006-10-27 Darin Adler <darin@apple.com> 2 24 -
trunk/LayoutTests/editing/deleting/delete-4038408-fix-expected.txt
r16237 r17386 28 28 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 29 29 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification 30 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 31 of #text > DIV > DIV > BODY > HTML > #document to 31 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 31 of #text > DIV > DIV > BODY > HTML > #document to 31 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 30 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 31 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 31 of #text > DIV > DIV > BODY > HTML > #document to 31 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 31 32 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 32 33 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification … … 64 65 RenderText {#text} at (0,0) size 195x18 65 66 text run at (0,0) width 195: "This text should not be quoted." 66 RenderBR {BR} at (195,14) size 0x067 67 caret: position 31 of child 2 {#text} of child 11 {DIV} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document -
trunk/LayoutTests/editing/inserting/insert-3654864-fix-expected.txt
r16237 r17386 8 8 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 9 9 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification 10 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > BODY > HTML > #document to 1 of #text > BODY > HTML > #document toDOMRange:range from 1 of #text > BODY > HTML > #document to 1 of #text > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 10 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 11 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of #text > BODY > HTML > #document to 1 of #text > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 11 12 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 12 13 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification … … 25 26 RenderText {#text} at (14,42) size 36x28 26 27 text run at (14,42) width 36: "xxx" 27 RenderBR {BR} at (50,64) size 0x0 28 RenderText {#text} at (0,0) size 0x0 29 RenderText {#text} at (0,0) size 0x0 30 RenderText {#text} at (0,0) size 0x0 28 31 caret: position 3 of child 1 {#text} of child 1 {BODY} of child 0 {HTML} of document -
trunk/LayoutTests/editing/inserting/insert-3659587-fix-expected.txt
r16237 r17386 30 30 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 31 31 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification 32 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > B > SPAN > DIV > BODY > HTML > #document to 1 of #text > B > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > B > SPAN > DIV > BODY > HTML > #document to 1 of #text > B > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 32 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 33 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of #text > B > SPAN > DIV > BODY > HTML > #document to 1 of #text > B > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 33 34 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 34 35 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification … … 52 53 RenderText {#text} at (14,42) size 36x28 53 54 text run at (14,42) width 36: "xxx" 54 RenderBR {BR} at (50,64) size 0x055 55 caret: position 3 of child 2 {#text} of child 0 {B} of child 1 {SPAN} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document -
trunk/LayoutTests/editing/inserting/insert-3775316-fix-expected.txt
r16237 r17386 6 6 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 7 7 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification 8 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 8 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 9 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 9 10 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 10 11 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification … … 17 18 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification 18 19 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 19 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN> DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE20 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 20 21 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 21 22 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification 22 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 2 of SPAN > DIV > BODY > HTML > #document to 2 of SPAN >DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE23 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document toDOMRange:range from 2 of DIV > BODY > HTML > #document to 2 of DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 23 24 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 24 25 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification 25 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 26 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 27 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 26 28 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 27 29 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification … … 32 34 RenderBody {BODY} at (8,8) size 784x584 33 35 RenderBlock {DIV} at (0,0) size 784x84 [border: (2px solid #FF0000)] 34 RenderInline {SPAN} at (0,0) size 12x56 35 RenderText {#text} at (14,14) size 12x28 36 text run at (14,14) width 12: "x" 37 RenderBR {BR} at (26,36) size 0x0 38 RenderText {#text} at (14,42) size 12x28 39 text run at (14,42) width 12: "x" 40 RenderBR {BR} at (26,64) size 0x0 41 RenderText {#text} at (0,0) size 0x0 42 caret: position 1 of child 2 {#text} of child 0 {SPAN} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document 36 RenderText {#text} at (14,14) size 12x28 37 text run at (14,14) width 12: "x" 38 RenderBR {BR} at (26,36) size 0x0 39 RenderText {#text} at (14,42) size 12x28 40 text run at (14,42) width 12: "x" 41 caret: position 1 of child 2 {#text} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document -
trunk/LayoutTests/editing/inserting/insert-at-end-01-expected.txt
r14768 r17386 4 4 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 5 5 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 6 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 6 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 7 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 7 8 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 8 9 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification … … 30 31 RenderText {#text} at (0,0) size 8x18 31 32 text run at (0,0) width 8: "x" 32 RenderBR {BR} at (8,14) size 0x033 33 caret: position 1 of child 5 {#text} of child 5 {DIV} of child 1 {BODY} of child 0 {HTML} of document -
trunk/LayoutTests/editing/inserting/insert-at-end-02-expected.txt
r14768 r17386 4 4 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 5 5 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 6 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 6 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 7 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 7 8 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 8 9 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification … … 30 31 RenderText {#text} at (0,0) size 8x18 31 32 text run at (0,0) width 8: "x" 32 RenderBR {BR} at (8,14) size 0x033 33 caret: position 1 of child 5 {#text} of child 5 {DIV} of child 1 {BODY} of child 0 {HTML} of document -
trunk/LayoutTests/editing/inserting/insert-br-001-expected.txt
r14768 r17386 8 8 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 9 9 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification 10 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 10 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 11 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 11 12 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 12 13 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification … … 23 24 RenderText {#text} at (14,42) size 12x28 24 25 text run at (14,42) width 12: "x" 25 RenderBR {BR} at (26,64) size 0x026 26 RenderText {#text} at (0,0) size 0x0 27 27 caret: position 1 of child 2 {#text} of child 1 {SPAN} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document -
trunk/LayoutTests/editing/inserting/insert-br-005-expected.txt
r14768 r17386 10 10 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 3 of SPAN > DIV > BODY > HTML > #document to 3 of SPAN > DIV > BODY > HTML > #document toDOMRange:range from 3 of SPAN > DIV > BODY > HTML > #document to 3 of SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 11 11 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification 12 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 12 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 13 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 13 14 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 14 15 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification … … 26 27 RenderText {#text} at (14,70) size 12x28 27 28 text run at (14,70) width 12: "x" 28 RenderBR {BR} at (26,92) size 0x029 29 RenderText {#text} at (0,0) size 0x0 30 30 caret: position 1 of child 3 {#text} of child 1 {SPAN} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document -
trunk/WebCore/ChangeLog
r17378 r17386 1 2006-10-26 Justin Garcia <justin.garcia@apple.com> 2 3 Reviewed by harrison 4 5 <http://bugs.webkit.org/show_bug.cgi?id=11423> 6 REGRESSION: First newline missing from textarea's value 7 8 The regression is that foo, return, bar in a textarea serializes as 'foobar'. 9 10 Before my change in r11423, return (an InsertLineBreak) would insert a '\n' 11 (the line break) then a br to prevent the '\n' from collapsing, since the 12 insertion is being done at the end of a block (the textarea's shadow div). Then, 13 inserting "bar" would displace the br, and "foo\nbar" would serialize as "foo\nbar". 14 After my change in r11423, InsertLineBreak would insert a br then a '\n' (reversed 15 the order). Then inserting "bar" would displace the '\n' and "foo"<br>"bar" would 16 serialize as "foobar" because when serializing RenderTextControl intentionally asks 17 textContent to not convert brs to newlines. It seems to think that the only brs in 18 the shadow div will be placeholders or collapsed. 19 20 We could remove this assumption, but, for consistancy's sake, I changed InsertLineBreak 21 to insert two '\n's when at the end of a block in white-space:pre text. This alone 22 would have fixed the bug, but introduced a new one, because foo, return, bar would 23 produce "foo\nbar\n" which would serialize as "foo\nbar\n" (even though the second 24 '\n' is collapsed, because of 9661). So, then I changed placeholder displacement to 25 displace a '\n' if it's acting as a placeholder. A "placeholder" is now defined as 26 a br or '\n' that will collapse (become superfluous) when content is inserted just 27 before it. 28 29 * editing/CompositeEditCommand.cpp: 30 (WebCore::CompositeEditCommand::removePlaceholderAt): Renamed. Remove 31 a br or '\n' if content inserted just before it will cause it to collapse. 32 * editing/CompositeEditCommand.h: 33 * editing/InsertLineBreakCommand.cpp: 34 (WebCore::InsertLineBreakCommand::doApply): Insert the same type of node 35 to prevent a collapse as was used for the line break. Fixed comments. 36 * editing/InsertTextCommand.cpp: 37 (WebCore::InsertTextCommand::input): Call the renamed function. 38 1 39 2006-10-27 Geoffrey Garen <ggaren@apple.com> 2 40 -
trunk/WebCore/editing/CompositeEditCommand.cpp
r17114 r17386 485 485 } 486 486 487 void CompositeEditCommand::removeBlockPlaceholder(const VisiblePosition& visiblePosition) 487 // Removes '\n's and brs that will collapse when content is inserted just before them. 488 // FIXME: We shouldn't really have to remove placeholders, but removing them is a workaround for 9661. 489 void CompositeEditCommand::removePlaceholderAt(const VisiblePosition& visiblePosition) 488 490 { 489 491 if (visiblePosition.isNull()) … … 491 493 492 494 Position p = visiblePosition.deepEquivalent().downstream(); 493 if (p.node()->hasTagName(brTag) && p.offset() == 0 && isEndOfBlock(visiblePosition) && isStartOfBlock(visiblePosition)) 494 removeNode(p.node()); 495 // If a br or '\n' is at the end of a block and not at the start of a paragraph, 496 // then it is superfluous, so adding content before a br or '\n' that is at 497 // the start of a paragraph will render it superfluous. 498 // FIXME: This doesn't remove placeholders at the end of anonymous blocks. 499 if (isEndOfBlock(visiblePosition) && isStartOfParagraph(visiblePosition)) { 500 if (p.node()->hasTagName(brTag) && p.offset() == 0) 501 removeNode(p.node()); 502 else if (p.node()->renderer()->style()->preserveNewline() && visiblePosition.characterAfter() == '\n') 503 deleteTextFromNode(static_cast<Text*>(p.node()), p.offset(), 1); 504 } 495 505 } 496 506 -
trunk/WebCore/editing/CompositeEditCommand.h
r16026 r17386 88 88 Node *insertBlockPlaceholder(const Position&); 89 89 Node *addBlockPlaceholderIfNeeded(Node*); 90 void remove BlockPlaceholder(const VisiblePosition&);90 void removePlaceholderAt(const VisiblePosition&); 91 91 92 92 void moveParagraphContentsToNewBlockIfNecessary(const Position&); -
trunk/WebCore/editing/InsertLineBreakCommand.cpp
r17223 r17386 111 111 if (canonicalPos.offset() == 0) { 112 112 insertNodeBefore(nodeToInsert.get(), canonicalPos.node()); 113 // Insert an extra br if the just inserted one collapsed.113 // Insert an extra br or '\n' if the just inserted one collapsed. 114 114 if (!isStartOfParagraph(VisiblePosition(Position(nodeToInsert.get(), 0)))) 115 insertNodeBefore( createBreakElement(document()).get(), nodeToInsert.get());115 insertNodeBefore(nodeToInsert->cloneNode(false).get(), nodeToInsert.get()); 116 116 // Leave the selection where it was, just before the table/horizontal rule. 117 117 } else if (canonicalPos.offset() == maxDeepOffset(canonicalPos.node())) { … … 127 127 VisiblePosition endingPosition(endOfBlock(VisiblePosition(pos))); 128 128 129 // Insert an extra br if the inserted one collapsed.129 // Insert an extra br or '\n' if the inserted one collapsed. 130 130 if (!isStartOfParagraph(endingPosition)) 131 insertNodeBefore( createBreakElement(document()).get(), nodeToInsert.get());131 insertNodeBefore(nodeToInsert->cloneNode(false).get(), nodeToInsert.get()); 132 132 133 133 setEndingSelection(Selection(endingPosition)); -
trunk/WebCore/editing/InsertTextCommand.cpp
r16026 r17386 107 107 endPosition = insertTab(startPosition); 108 108 startPosition = endPosition.previous(); 109 remove BlockPlaceholder(VisiblePosition(startPosition));109 removePlaceholderAt(VisiblePosition(startPosition)); 110 110 m_charactersAdded += 1; 111 111 } else { 112 112 // Make sure the document is set up to receive text 113 113 startPosition = prepareForTextInsertion(startPosition); 114 remove BlockPlaceholder(VisiblePosition(startPosition));114 removePlaceholderAt(VisiblePosition(startPosition)); 115 115 Text *textNode = static_cast<Text *>(startPosition.node()); 116 116 int offset = startPosition.offset();
Note:
See TracChangeset
for help on using the changeset viewer.