Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
LayoutTests:
Reviewed by harrison <http://bugs.webkit.org/show_bug.cgi?id=11423> REGRESSION: First newline missing from textarea's value Changes reflect the removal of more brs that were about to collapse: * editing/deleting/delete-4038408-fix-expected.txt: * editing/inserting/insert-3654864-fix-expected.txt: * editing/inserting/insert-3659587-fix-expected.txt: * editing/inserting/insert-3775316-fix-expected.txt: * editing/inserting/insert-at-end-01-expected.txt: * editing/inserting/insert-at-end-02-expected.txt: * editing/inserting/insert-br-001-expected.txt: * editing/inserting/insert-br-005-expected.txt: Added to demonstrate fix: * fast/forms/11423-expected.txt: Added. * fast/forms/11423.html: Added. WebCore: Reviewed by harrison <http://bugs.webkit.org/show_bug.cgi?id=11423> REGRESSION: First newline missing from textarea's value The regression is that foo, return, bar in a textarea serializes as 'foobar'. Before my change in r11423, return (an InsertLineBreak) would insert a '\n' (the line break) then a br to prevent the '\n' from collapsing, since the insertion is being done at the end of a block (the textarea's shadow div). Then, inserting "bar" would displace the br, and "foo\nbar" would serialize as "foo\nbar". After my change in r11423, InsertLineBreak would insert a br then a '\n' (reversed the order). Then inserting "bar" would displace the '\n' and "foo"<br>"bar" would serialize as "foobar" because when serializing RenderTextControl intentionally asks textContent to not convert brs to newlines. It seems to think that the only brs in the shadow div will be placeholders or collapsed. We could remove this assumption, but, for consistancy's sake, I changed InsertLineBreak to insert two '\n's when at the end of a block in white-space:pre text. This alone would have fixed the bug, but introduced a new one, because foo, return, bar would produce "foo\nbar\n" which would serialize as "foo\nbar\n" (even though the second '\n' is collapsed, because of 9661). So, then I changed placeholder displacement to displace a '\n' if it's acting as a placeholder. A "placeholder" is now defined as a br or '\n' that will collapse (become superfluous) when content is inserted just before it. * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::removePlaceholderAt): Renamed. Remove a br or '\n' if content inserted just before it will cause it to collapse. * editing/CompositeEditCommand.h: * editing/InsertLineBreakCommand.cpp: (WebCore::InsertLineBreakCommand::doApply): Insert the same type of node to prevent a collapse as was used for the line break. Fixed comments. * editing/InsertTextCommand.cpp: (WebCore::InsertTextCommand::input): Call the renamed function. Canonical link: https://commits.webkit.org/14607@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@17386 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Justin Garcia
committed
Oct 27, 2006
1 parent
1dfaba0
commit f926498
Showing
16 changed files
with
150 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification | ||
EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV to 0 of DIV toDOMRange:range from 3 of #text > DIV to 3 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE | ||
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification | ||
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification | ||
EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 3 of #text > DIV to 3 of #text > DIV toDOMRange:range from 1 of #text > DIV to 1 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE | ||
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification | ||
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification | ||
EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV to 1 of #text > DIV toDOMRange:range from 3 of #text > DIV to 3 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE | ||
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification | ||
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification | ||
This tests to see that a line break inserted in a textarea is serialized as a '\n'. | ||
|
||
|
||
Success | ||
|
Oops, something went wrong.