AK+Everywhere: Replace "protocol" with "scheme" url helpers

URL had properly named replacements for protocol(), set_protocol() and
create_with_file_protocol() already. This patch removes these function
and updates all call sites to use the functions named according to the
specification.

See https://url.spec.whatwg.org/#concept-url-scheme
This commit is contained in:
networkException 2022-09-29 01:30:58 +02:00 committed by Linus Groh
parent 454bf1fde0
commit 4230dbbb21
Notes: sideshowbarker 2024-07-17 06:33:50 +09:00
61 changed files with 113 additions and 116 deletions

View file

@ -96,8 +96,8 @@ void HTMLFormElement::submit_form(JS::GCPtr<HTMLElement> submitter, bool from_su
return;
}
if (url.protocol() == "file") {
if (document().url().protocol() != "file") {
if (url.scheme() == "file") {
if (document().url().scheme() != "file") {
dbgln("Failed to submit form: Security violation: {} may not submit to {}", document().url(), url);
return;
}
@ -105,7 +105,7 @@ void HTMLFormElement::submit_form(JS::GCPtr<HTMLElement> submitter, bool from_su
dbgln("Failed to submit form: Unsupported form method '{}' for URL: {}", method(), url);
return;
}
} else if (url.protocol() != "http" && url.protocol() != "https") {
} else if (url.scheme() != "http" && url.scheme() != "https") {
dbgln("Failed to submit form: Unsupported protocol for URL: {}", url);
return;
}