File tree 1 file changed +32
-0
lines changed
html/semantics/forms/form-submission-0
1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < head >
3
+ < meta charset ="utf-8 ">
4
+ < link rel ="help " href ="https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#constructing-the-form-data-set ">
5
+ < link ref ="help " href ="https://xhr.spec.whatwg.org/#dom-formdata ">
6
+ < link rel ="help " href ="https://fetch.spec.whatwg.org/#concept-bodyinit-extract ">
7
+ < script src ="/resources/testharness.js "> </ script >
8
+ < script src ="/resources/testharnessreport.js "> </ script >
9
+ </ head >
10
+ < body >
11
+
12
+ < iframe name ="frame1 "> </ iframe >
13
+ < form accept-charset ="iso-8859-1 " target ="frame1 " action ="/common/blank.html ">
14
+ < input type ="hidden " name ="_charset_ ">
15
+ </ form >
16
+
17
+ < script >
18
+ test ( ( ) => {
19
+ let formData = new FormData ( document . querySelector ( 'form' ) ) ;
20
+ assert_equals ( formData . get ( '_charset_' ) , 'UTF-8' ) ;
21
+ } , 'FormData constructor always produces UTF-8 _charset_ value.' ) ;
22
+
23
+ let t = async_test ( '_charset_ control sets the expected encoding name.' ) ;
24
+ t . step ( ( ) => {
25
+ let iframe = document . querySelector ( 'iframe' ) ;
26
+ iframe . onload = t . step_func_done ( ( ) => {
27
+ assert_not_equals ( iframe . contentDocument . URL . indexOf ( '_charset_=windows-1252' ) , - 1 ) ;
28
+ } ) ;
29
+ document . querySelector ( 'form' ) . submit ( ) ;
30
+ } ) ;
31
+ </ script >
32
+ </ body >
You can’t perform that action at this time.
0 commit comments