mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-06 17:11:51 +00:00
LibWeb/HTML: Fix parsing of protocol in Location.protocol setter
This never worked properly when implemented as it would always throw an error for an invalid scheme on URL parsing. Fixes at least some tests in: https://wpt.live/html/browsers/history/the-location-interface/location-protocol-setter-non-broken.html And all tests in: https://wpt.live/html/browsers/history/the-location-interface/location-protocol-setter-non-broken-weird.html And maybe tests in some other places too, but these are not imported as the tests are written with delays that makes them take a long time to run, and some of them rely on HTTP(s).
This commit is contained in:
parent
3bb36d9379
commit
8ac096c0e2
Notes:
github-actions[bot]
2025-04-25 11:21:56 +00:00
Author: https://github.com/shannonbooth
Commit: 8ac096c0e2
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4468
1 changed files with 1 additions and 1 deletions
|
@ -195,7 +195,7 @@ WebIDL::ExceptionOr<void> Location::set_protocol(String const& value)
|
|||
auto copy_url = this->url();
|
||||
|
||||
// 4. Let possibleFailure be the result of basic URL parsing the given value, followed by ":", with copyURL as url and scheme start state as state override.
|
||||
auto possible_failure = URL::Parser::basic_parse(value, {}, ©_url, URL::Parser::State::SchemeStart);
|
||||
auto possible_failure = URL::Parser::basic_parse(MUST(String::formatted("{}:", value)), {}, ©_url, URL::Parser::State::SchemeStart);
|
||||
|
||||
// 5. If possibleFailure is failure, then throw a "SyntaxError" DOMException.
|
||||
if (!possible_failure.has_value())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue