LibWeb: Fixed IDL for HTMLInputElement
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run

Use Enumerated for the form{Enctype, Method} attributes
This commit is contained in:
samu698 2024-10-20 18:39:50 +02:00 committed by Andrew Kaster
parent ab04f6d422
commit d08d305399
Notes: github-actions[bot] 2024-10-21 21:41:59 +00:00
5 changed files with 132 additions and 2 deletions

View file

@ -49,3 +49,55 @@ button.formEnctype == 'application/x-www-form-urlencoded'
button.setAttribute('formEnctype', '5%')
button.getAttribute('formEnctype') == '5%'
button.formEnctype == 'application/x-www-form-urlencoded'
input: unset
input.getAttribute('formEnctype') == 'null'
input.formEnctype == ''
input.setAttribute('formEnctype', '')
input.getAttribute('formEnctype') == ''
input.formEnctype == 'application/x-www-form-urlencoded'
input.setAttribute('formEnctype', 'undefined')
input.getAttribute('formEnctype') == 'undefined'
input.formEnctype == 'application/x-www-form-urlencoded'
input.setAttribute('formEnctype', 'null')
input.getAttribute('formEnctype') == 'null'
input.formEnctype == 'application/x-www-form-urlencoded'
input.setAttribute('formEnctype', 'application/x-www-form-urlencoded')
input.getAttribute('formEnctype') == 'application/x-www-form-urlencoded'
input.formEnctype == 'application/x-www-form-urlencoded'
input.setAttribute('formEnctype', 'multipart/form-data')
input.getAttribute('formEnctype') == 'multipart/form-data'
input.formEnctype == 'multipart/form-data'
input.setAttribute('formEnctype', 'text/plain')
input.getAttribute('formEnctype') == 'text/plain'
input.formEnctype == 'text/plain'
input.setAttribute('formEnctype', 'APPLICATION/X-WWW-FORM-URLENCODED')
input.getAttribute('formEnctype') == 'APPLICATION/X-WWW-FORM-URLENCODED'
input.formEnctype == 'application/x-www-form-urlencoded'
input.setAttribute('formEnctype', 'MULTIPART/FORM-DATA')
input.getAttribute('formEnctype') == 'MULTIPART/FORM-DATA'
input.formEnctype == 'multipart/form-data'
input.setAttribute('formEnctype', 'tEXt/PlAIn')
input.getAttribute('formEnctype') == 'tEXt/PlAIn'
input.formEnctype == 'text/plain'
input.setAttribute('formEnctype', 'text/plain ')
input.getAttribute('formEnctype') == 'text/plain '
input.formEnctype == 'application/x-www-form-urlencoded'
input.setAttribute('formEnctype', '7')
input.getAttribute('formEnctype') == '7'
input.formEnctype == 'application/x-www-form-urlencoded'
input.setAttribute('formEnctype', '5%')
input.getAttribute('formEnctype') == '5%'
input.formEnctype == 'application/x-www-form-urlencoded'

View file

@ -49,3 +49,55 @@ button.formMethod == 'get'
button.setAttribute('formMethod', '5%')
button.getAttribute('formMethod') == '5%'
button.formMethod == 'get'
input: unset
input.getAttribute('formMethod') == 'null'
input.formMethod == ''
input.setAttribute('formMethod', '')
input.getAttribute('formMethod') == ''
input.formMethod == 'get'
input.setAttribute('formMethod', 'undefined')
input.getAttribute('formMethod') == 'undefined'
input.formMethod == 'get'
input.setAttribute('formMethod', 'null')
input.getAttribute('formMethod') == 'null'
input.formMethod == 'get'
input.setAttribute('formMethod', 'get')
input.getAttribute('formMethod') == 'get'
input.formMethod == 'get'
input.setAttribute('formMethod', 'post')
input.getAttribute('formMethod') == 'post'
input.formMethod == 'post'
input.setAttribute('formMethod', 'dialog')
input.getAttribute('formMethod') == 'dialog'
input.formMethod == 'dialog'
input.setAttribute('formMethod', 'GeT')
input.getAttribute('formMethod') == 'GeT'
input.formMethod == 'get'
input.setAttribute('formMethod', 'POST')
input.getAttribute('formMethod') == 'POST'
input.formMethod == 'post'
input.setAttribute('formMethod', 'DIAlog')
input.getAttribute('formMethod') == 'DIAlog'
input.formMethod == 'dialog'
input.setAttribute('formMethod', 'foo')
input.getAttribute('formMethod') == 'foo'
input.formMethod == 'get'
input.setAttribute('formMethod', 'xpost')
input.getAttribute('formMethod') == 'xpost'
input.formMethod == 'get'
input.setAttribute('formMethod', '5%')
input.getAttribute('formMethod') == '5%'
input.formMethod == 'get'

View file

@ -2,6 +2,7 @@
<script>
test(() => {
const btn = document.createElement('button');
const input = document.createElement('input');
const values = [
'', undefined, null,
'application/x-www-form-urlencoded',
@ -23,5 +24,17 @@
println(`button.getAttribute('formEnctype') == '${btn.getAttribute('formEnctype')}'`);
println(`button.formEnctype == '${btn.formEnctype}'`);
}
println('');
println('input: unset');
println(`input.getAttribute('formEnctype') == '${input.getAttribute('formEnctype')}'`);
println(`input.formEnctype == '${input.formEnctype}'`);
for (value of values) {
input.setAttribute('formEnctype', value);
println('');
println(`input.setAttribute('formEnctype', '${value}')`);
println(`input.getAttribute('formEnctype') == '${input.getAttribute('formEnctype')}'`);
println(`input.formEnctype == '${input.formEnctype}'`);
}
});
</script>

View file

@ -2,6 +2,7 @@
<script>
test(() => {
const btn = document.createElement('button');
const input = document.createElement('input');
const values = [
'', undefined, null,
'get', 'post', 'dialog',
@ -19,5 +20,17 @@
println(`button.getAttribute('formMethod') == '${btn.getAttribute('formMethod')}'`);
println(`button.formMethod == '${btn.formMethod}'`);
}
println('');
println('input: unset')
println(`input.getAttribute('formMethod') == '${input.getAttribute('formMethod')}'`);
println(`input.formMethod == '${input.formMethod}'`);
for (value of values) {
input.setAttribute('formMethod', value);
println('');
println(`input.setAttribute('formMethod', '${value}')`);
println(`input.getAttribute('formMethod') == '${input.getAttribute('formMethod')}'`);
println(`input.formMethod == '${input.formMethod}'`);
}
});
</script>

View file

@ -18,8 +18,8 @@ interface HTMLInputElement : HTMLElement {
readonly attribute HTMLFormElement? form;
attribute FileList? files;
[CEReactions] attribute USVString formAction;
[FIXME, CEReactions] attribute DOMString formEnctype;
[FIXME, CEReactions] attribute DOMString formMethod;
[CEReactions, Reflect=formenctype, Enumerated=FormEnctypeAttribute] attribute DOMString formEnctype;
[CEReactions, Reflect=formmethod, Enumerated=FormMethodAttribute] attribute DOMString formMethod;
[CEReactions, Reflect=formnovalidate] attribute boolean formNoValidate;
[CEReactions, Reflect=formtarget] attribute DOMString formTarget;
[FIXME, CEReactions] attribute unsigned long height;