mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 15:49:11 +00:00
LibWeb: Fixed IDL for HTMLInputElement
Use Enumerated for the form{Enctype, Method} attributes
This commit is contained in:
parent
ab04f6d422
commit
d08d305399
Notes:
github-actions[bot]
2024-10-21 21:41:59 +00:00
Author: https://github.com/samu698
Commit: d08d305399
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1884
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/BodilessSleeper
Reviewed-by: https://github.com/stelar7
Reviewed-by: https://github.com/tcl3
5 changed files with 132 additions and 2 deletions
|
@ -49,3 +49,55 @@ button.formEnctype == 'application/x-www-form-urlencoded'
|
||||||
button.setAttribute('formEnctype', '5%')
|
button.setAttribute('formEnctype', '5%')
|
||||||
button.getAttribute('formEnctype') == '5%'
|
button.getAttribute('formEnctype') == '5%'
|
||||||
button.formEnctype == 'application/x-www-form-urlencoded'
|
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'
|
||||||
|
|
|
@ -49,3 +49,55 @@ button.formMethod == 'get'
|
||||||
button.setAttribute('formMethod', '5%')
|
button.setAttribute('formMethod', '5%')
|
||||||
button.getAttribute('formMethod') == '5%'
|
button.getAttribute('formMethod') == '5%'
|
||||||
button.formMethod == 'get'
|
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'
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<script>
|
<script>
|
||||||
test(() => {
|
test(() => {
|
||||||
const btn = document.createElement('button');
|
const btn = document.createElement('button');
|
||||||
|
const input = document.createElement('input');
|
||||||
const values = [
|
const values = [
|
||||||
'', undefined, null,
|
'', undefined, null,
|
||||||
'application/x-www-form-urlencoded',
|
'application/x-www-form-urlencoded',
|
||||||
|
@ -23,5 +24,17 @@
|
||||||
println(`button.getAttribute('formEnctype') == '${btn.getAttribute('formEnctype')}'`);
|
println(`button.getAttribute('formEnctype') == '${btn.getAttribute('formEnctype')}'`);
|
||||||
println(`button.formEnctype == '${btn.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>
|
</script>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<script>
|
<script>
|
||||||
test(() => {
|
test(() => {
|
||||||
const btn = document.createElement('button');
|
const btn = document.createElement('button');
|
||||||
|
const input = document.createElement('input');
|
||||||
const values = [
|
const values = [
|
||||||
'', undefined, null,
|
'', undefined, null,
|
||||||
'get', 'post', 'dialog',
|
'get', 'post', 'dialog',
|
||||||
|
@ -19,5 +20,17 @@
|
||||||
println(`button.getAttribute('formMethod') == '${btn.getAttribute('formMethod')}'`);
|
println(`button.getAttribute('formMethod') == '${btn.getAttribute('formMethod')}'`);
|
||||||
println(`button.formMethod == '${btn.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>
|
</script>
|
||||||
|
|
|
@ -18,8 +18,8 @@ interface HTMLInputElement : HTMLElement {
|
||||||
readonly attribute HTMLFormElement? form;
|
readonly attribute HTMLFormElement? form;
|
||||||
attribute FileList? files;
|
attribute FileList? files;
|
||||||
[CEReactions] attribute USVString formAction;
|
[CEReactions] attribute USVString formAction;
|
||||||
[FIXME, CEReactions] attribute DOMString formEnctype;
|
[CEReactions, Reflect=formenctype, Enumerated=FormEnctypeAttribute] attribute DOMString formEnctype;
|
||||||
[FIXME, CEReactions] attribute DOMString formMethod;
|
[CEReactions, Reflect=formmethod, Enumerated=FormMethodAttribute] attribute DOMString formMethod;
|
||||||
[CEReactions, Reflect=formnovalidate] attribute boolean formNoValidate;
|
[CEReactions, Reflect=formnovalidate] attribute boolean formNoValidate;
|
||||||
[CEReactions, Reflect=formtarget] attribute DOMString formTarget;
|
[CEReactions, Reflect=formtarget] attribute DOMString formTarget;
|
||||||
[FIXME, CEReactions] attribute unsigned long height;
|
[FIXME, CEReactions] attribute unsigned long height;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue