[webkit-reviews] review granted: [Bug 20461] Collapse multiline values in inputs : [Attachment 23306] Possible fix to bug 20461

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Sep 16 10:26:43 PDT 2008


Darin Adler <darin at apple.com> has granted Glenn Wilson <gwilson at google.com>'s
request for review:
Bug 20461: Collapse multiline values in inputs
https://bugs.webkit.org/show_bug.cgi?id=20461

Attachment 23306: Possible fix to bug 20461
https://bugs.webkit.org/attachment.cgi?id=23306&action=edit

------- Additional Comments from Darin Adler <darin at apple.com>
Truncating strings at the first newline was an intentional design decision in
the original Safari development cycle. The original check-in for this was:

    http://trac.webkit.org/changeset/7408

> IE/Firefox/Opera all collapse the multiline value to avoid this problem.
> -IE and Opera strip the newline.
> -Firefox replaces it with a space.

At the change of change 7408 that was not true of IE. Presumably IE changed
their behavior at some point. We decided to match IE rather than Gecko back
then.

+	 string.replace(static_cast<WebCore::String>("\r\n"),
static_cast<WebCore::String>(" "));

You should be able to just write:

    string.replace("\r\n", " ");

Those typecasts are unnecessary, and in fact they prevent us from later
overloading String::replace to create a more efficient version that doesn't
create intermediate String objects.

The patch looks fine otherwise. I'd prefer that someone remove the redundant
static_cast calls.

r=me


More information about the webkit-reviews mailing list