mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 04:39:06 +00:00
LibWeb: Return document URL if formAction attribute is missing or empty
This change also ensures that relative URLs are resolved relative to the document's base URL.
This commit is contained in:
parent
f83d082980
commit
c25dda767e
Notes:
github-actions[bot]
2024-09-08 07:48:53 +00:00
Author: https://github.com/tcl3
Commit: c25dda767e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1321
5 changed files with 47 additions and 1 deletions
19
Tests/LibWeb/Text/input/HTML/formAction-attribute.html
Normal file
19
Tests/LibWeb/Text/input/HTML/formAction-attribute.html
Normal file
|
@ -0,0 +1,19 @@
|
|||
<!DOCTYPE html>
|
||||
<script src="../include.js"></script>
|
||||
<button formaction="http://www.example.com/"></button>
|
||||
<script>
|
||||
test(() => {
|
||||
const elementNames = [
|
||||
"button",
|
||||
];
|
||||
for (const elementName of elementNames) {
|
||||
const element = document.querySelector(elementName);
|
||||
println(`${elementName}.formAction initial value: ${element.formAction}`);
|
||||
element.formAction = "";
|
||||
println(`Final segment of ${elementName}.formAction after setting to the empty string: ${element.formAction.split('/').pop()}`);
|
||||
element.formAction = "../test.html";
|
||||
println(`Final segment of ${elementName}.formAction after setting to "../test.html": ${element.formAction.split('/').pop()}`);
|
||||
element.remove();
|
||||
}
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue