Summary: | REGRESSION: First newline missing from textarea's value | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | mitz | ||||||
Component: | Forms | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | justin.garcia | ||||||
Priority: | P1 | Keywords: | Regression | ||||||
Version: | 420+ | ||||||||
Hardware: | Mac | ||||||||
OS: | OS X 10.4 | ||||||||
Attachments: |
|
Description
mitz
2006-10-26 07:36:48 PDT
Created attachment 11225 [details]
Test case
When you click Test, the words in the alert box should be on seaprate lines. In TOT, the first two words are one the same line with no space between them.
Sounds like this might have been caused by my TextIterator changed. Checking. This regressed between 17205 and 17233. My change in 17223 seems most likely. ...although, it didn't touch serialization. It was definitely my changes in r17223 that caused this. Before, when inserting a line break after the first paragraph, 'foo', we'd insert a '\n' (because the text is white-space:pre, and then we'd insert an extra br so that the '\n' would hold its own line open, and the extra br was inserted after the '\n'. Now the br is inserted before the '\n', and so it is the '\n' that is displaced by 'bar', leaving the br to break the line, whereas before it was the br that was displaced, and '\n' held open the line. Apparently, there is a serialization bug that leaves out brs. The quick fix is to, in InsertLineBreakCommand, use the same type of node that we used for the line break in the case that that break collapsed because it was inserted at the end of a block. Created attachment 11231 [details]
patch
Comment on attachment 11231 [details]
patch
Justin, did you intentionally not set the review flag?
harrison reviewed this and I checked it in in r17386. Comment on attachment 11231 [details] patch >Index: WebCore/ChangeLog >=================================================================== >--- WebCore/ChangeLog (revision 17351) >+++ WebCore/ChangeLog (working copy) >@@ -1,3 +1,40 @@ >+2006-10-26 Justin Garcia <justin.garcia@apple.com> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ <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 '\n' (the >+ line break) then a br to prevent a collapse, 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. Justin, don't you mean "r17223" (per Comment #5) above instead of "r11423"?
> Justin, don't you mean "r17223" (per Comment #5) above instead of "r11423"?
Oops. Fixed. Thanks.
|