Bug 207900 - Value sanitization for input[type=text] should not truncate a value at a control character
Summary: Value sanitization for input[type=text] should not truncate a value at a cont...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Carlos Alberto Lopez Perez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-02-18 10:52 PST by Carlos Alberto Lopez Perez
Modified: 2020-02-21 03:23 PST (History)
13 users (show)

See Also:


Attachments
Patch (7.42 MB, patch)
2020-02-18 11:14 PST, Carlos Alberto Lopez Perez
no flags Details | Formatted Diff | Diff
Patch (7.45 MB, patch)
2020-02-19 04:27 PST, Carlos Alberto Lopez Perez
no flags Details | Formatted Diff | Diff
Patch (7.44 MB, patch)
2020-02-19 13:39 PST, Carlos Alberto Lopez Perez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Alberto Lopez Perez 2020-02-18 10:52:09 PST
WebKit its truncating the value for input type text at the first control character that its non a tab.

This behaviour its not defined on the spec, neither match what other browsers do (Firefox, Chrome, etc).

This causes thousands of subtest failures on WPT tests encoding/legacy-mb-japanese/iso-2022-jp/iso2022jp-encode-form* <https://wpt.fyi/results/encoding/legacy-mb-japanese/iso-2022-jp>


Chrome corrected this behaviour years ago. For reference see: https://codereview.chromium.org/189843008
Comment 1 Carlos Alberto Lopez Perez 2020-02-18 11:14:00 PST
Created attachment 391070 [details]
Patch
Comment 2 Carlos Alberto Lopez Perez 2020-02-18 11:18:22 PST
(In reply to Carlos Alberto Lopez Perez from comment #0)
> WebKit its truncating the value for input type text at the first control
> character that its non a tab.
> 
> This behaviour its not defined on the spec, neither match what other
> browsers do (Firefox, Chrome, etc).
> 

Spec: https://html.spec.whatwg.org/multipage/input.html#text-(type=text)-state-and-search-state-(type=search):value-sanitization-algorithm
Comment 3 Carlos Alberto Lopez Perez 2020-02-19 04:27:22 PST
Created attachment 391152 [details]
Patch

Rebaseline also imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/valueMode.html with more PASS lines
Comment 4 Carlos Alberto Lopez Perez 2020-02-19 13:39:26 PST
Created attachment 391196 [details]
Patch

Fix wrong baseline for ios in imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/valueMode.html
Comment 5 Carlos Alberto Lopez Perez 2020-02-20 10:04:20 PST
r? All EWS are green now.
Comment 6 Carlos Alberto Lopez Perez 2020-02-21 03:22:51 PST
Comment on attachment 391196 [details]
Patch

Clearing flags on attachment: 391196

Committed r257132: <https://trac.webkit.org/changeset/257132>
Comment 7 Carlos Alberto Lopez Perez 2020-02-21 03:22:55 PST
All reviewed patches have been landed.  Closing bug.
Comment 8 Radar WebKit Bug Importer 2020-02-21 03:23:21 PST
<rdar://problem/59664131>