Bug 249923 - REGRESSION (Safari 14-16): Duplicated CR-LF in textarea with wrap="hard"
Summary: REGRESSION (Safari 14-16): Duplicated CR-LF in textarea with wrap="hard"
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: Safari 16
Hardware: All macOS 13
: P2 Normal
Assignee: zalan
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-12-28 04:58 PST by Andrey Pashnin
Modified: 2023-01-12 07:54 PST (History)
15 users (show)

See Also:


Attachments
test case (186 bytes, text/html)
2023-01-04 13:11 PST, Fujii Hironori
no flags Details
Patch (3.75 KB, patch)
2023-01-11 20:20 PST, zalan
no flags Details | Formatted Diff | Diff
Patch (5.30 KB, patch)
2023-01-11 20:23 PST, zalan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Pashnin 2022-12-28 04:58:11 PST
If I submit a form with a textarea containing "A0d0aB" it sends "A0d0a0d0aB".
If I submit a form with a textarea containing "A0d0a0d0aB" it sends "A0d0a0d0a0d0a0d0aB". 
(each CR-LF pair gets duplicated)


It works fine from Chrome and the old Safari, but not the new one. 
I couldn't find how to get the specific version of the WebKit.



OK:
from Safari (Version 14.0.2 (15610.3.7.1.10 15610), detected by httpd as:
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.2 Safari/605.1.15"

DUPLICATED:
from Safari (Version 16.1 (17614.2.9.1.13, 17614), detected by httpd as: 
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15"



It seems to be related to:
https://bugs.webkit.org/show_bug.cgi?id=249916

It seemed to happened at around the time of this change:
https://trac.webkit.org/changeset/293672/webkit/
Comment 1 Andrey Pashnin 2022-12-28 05:02:06 PST
Also OK from Chrome, detected by httpd as:
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"
Comment 2 Andrey Pashnin 2022-12-29 03:41:31 PST
And as I expected, as soon as I upgraded iPadOS to 16.2 my Chrome is detected as AppleWEbKit/605.1.15 now and all the CR-LF pairs get duplicated!
Comment 3 Andrey Pashnin 2022-12-29 04:49:19 PST
I have just reproduced the bug with the latest version for Monterey:
258350@main DECEMBER 29, 2022 AT 03:43 AM GMT+1

downloaded from here:
https://s3-us-west-2.amazonaws.com/minified-archives.webkit.org/mac-monterey-x86_64%20arm64-release/258350@main.zip
Comment 4 Andrey Pashnin 2022-12-30 02:57:38 PST
It only happens if a textarea has [wrap="hard"] attributes! 
If the attribute is removed, there are no more duplications.
Comment 5 Radar WebKit Bug Importer 2023-01-04 04:59:17 PST
<rdar://problem/103870498>
Comment 6 Fujii Hironori 2023-01-04 13:11:25 PST
Created attachment 464336 [details]
test case
Comment 7 Fujii Hironori 2023-01-04 13:12:20 PST
I did bisecting with my WinCairo collection.

r281133 good
r281553 bad
Comment 8 Fujii Hironori 2023-01-04 13:18:37 PST
240773@main (bug#228882) seems to be suspicious.
Comment 9 zalan 2023-01-04 13:37:38 PST
(In reply to Fujii Hironori from comment #8)
> 240773@main (bug#228882) seems to be suspicious.
yeah that's a strong candidate.
Comment 10 zalan 2023-01-11 20:20:42 PST
Created attachment 464463 [details]
Patch
Comment 11 zalan 2023-01-11 20:23:03 PST
Created attachment 464464 [details]
Patch
Comment 12 EWS 2023-01-12 07:54:54 PST
Committed 258830@main (4dde2b983f43): <https://commits.webkit.org/258830@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 464464 [details].