Bug 261936 - REGRESSION (iOS 17): The textarea element URL encodes pasteboard data
Summary: REGRESSION (iOS 17): The textarea element URL encodes pasteboard data
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: Safari 17
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
: 264867 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-09-21 22:42 PDT by Ben Ubois
Modified: 2023-11-15 12:30 PST (History)
6 users (show)

See Also:


Attachments
iOS 16.4 vs iOS 17.0 result (639.37 KB, image/png)
2023-09-25 14:25 PDT, Ben Ubois
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Ubois 2023-09-21 22:42:24 PDT
The textarea element has an unexpected behavior where it URL encodes the data it sends to the pasteboard when a certain pattern is entered.

Any string followed by a colon, will result in the contents getting URL encoded when copied.

Video example: https://www.dropbox.com/scl/fi/scf8jxjyj6egg3r63wnz4/textarea.mov?rlkey=6qc0fcxa41en9xxvv7df3v382&dl=0

Steps:

1. Type the following string into a textarea: Hello:<
2. Copy the contents of the textarea
3. Paste the result somewhere

Expected:

The string Hello:< should be pasted

Actual:

The string hello:%3C is pasted
Comment 1 Alexey Proskuryakov 2023-09-24 15:49:36 PDT
I can reproduce this on iOS, but not on macOS. Quite weird indeed.
Comment 2 Ben Ubois 2023-09-24 16:05:23 PDT
It looks like this does not just affect textarea. Any text that matches this pattern gets URL encoded when copied in iOS Safari 17.
Comment 3 Alexey Proskuryakov 2023-09-25 10:01:08 PDT
Do you happen to know if this is new in iOS 17, and didn't affect earlier version?
Comment 4 Ben Ubois 2023-09-25 14:25:38 PDT
Created attachment 467854 [details]
iOS 16.4 vs iOS 17.0 result

It appears to be new as of iOS 17. I was able to test on 16.4 as well (the most recent of the simulator versions available) and the same issue was not present. 

In the attachment you can see the difference between 16.4 and 17 when copying and pasting from a <p> into a <textarea>. 

It appears that iOS 17 is down casing the pasted string as well.
Comment 5 Radar WebKit Bug Importer 2023-09-26 08:27:18 PDT
<rdar://problem/116056298>
Comment 6 Richard Robinson 2023-10-10 12:35:57 PDT
Pull request: https://github.com/WebKit/WebKit/pull/18902
Comment 7 EWS 2023-10-10 17:44:12 PDT
Committed 269178@main (a2225304ef16): <https://commits.webkit.org/269178@main>

Reviewed commits have been landed. Closing PR #18902 and removing active labels.
Comment 8 Alexey Proskuryakov 2023-11-15 12:28:47 PST
*** Bug 264867 has been marked as a duplicate of this bug. ***
Comment 9 Alexey Proskuryakov 2023-11-15 12:30:08 PST
This should be working correctly in current iOS 17.2 beta. Please comment if it does not.