mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-24 09:52:31 +00:00
LibURL/Pattern: Implement 'compute protocol matches a special scheme'
This commit is contained in:
parent
6b1fa3ecd0
commit
e54504ad93
Notes:
github-actions[bot]
2025-04-06 12:26:59 +00:00
Author: https://github.com/shannonbooth
Commit: e54504ad93
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3847
Reviewed-by: https://github.com/trflynn89
2 changed files with 17 additions and 8 deletions
|
@ -381,7 +381,16 @@ String ConstructorStringParser::make_a_component_string() const
|
|||
// https://urlpattern.spec.whatwg.org/#compute-protocol-matches-a-special-scheme-flag
|
||||
PatternErrorOr<void> ConstructorStringParser::compute_protocol_matches_a_special_scheme_flag()
|
||||
{
|
||||
// FIXME: Implement this.
|
||||
// 1. Let protocol string be the result of running make a component string given parser.
|
||||
auto protocol_string = make_a_component_string();
|
||||
|
||||
// 2. Let protocol component be the result of compiling a component given protocol string, canonicalize a protocol, and default options.
|
||||
auto protocol_component = TRY(Component::compile(protocol_string.code_points(), canonicalize_a_protocol, Options::default_()));
|
||||
|
||||
// 3. If the result of running protocol component matches a special scheme given protocol component is true, then set parser’s protocol matches a special scheme flag to true.
|
||||
if (protocol_component_matches_a_special_scheme(protocol_component))
|
||||
m_protocol_matches_a_special_scheme = true;
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue