mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-29 06:02:07 +03:00
AK: Number the spec step comments in URL::serialize_path()
This commit is contained in:
parent
f15d46fb8b
commit
f6c52f622d
Notes:
sideshowbarker
2024-07-17 02:22:23 +09:00
Author: https://github.com/kemzeb Commit: https://github.com/SerenityOS/serenity/commit/f6c52f622d Pull-request: https://github.com/SerenityOS/serenity/pull/21160 Reviewed-by: https://github.com/shannonbooth ✅
@ -263,21 +263,21 @@ bool URL::is_special_scheme(StringView scheme)
|
||||
// https://url.spec.whatwg.org/#url-path-serializer
|
||||
DeprecatedString URL::serialize_path(ApplyPercentDecoding apply_percent_decoding) const
|
||||
{
|
||||
// If url has an opaque path, then return url’s path.
|
||||
// 1. If url has an opaque path, then return url’s path.
|
||||
// FIXME: Reimplement this step once we modernize the URL implementation to meet the spec.
|
||||
if (cannot_be_a_base_url())
|
||||
return m_paths[0];
|
||||
|
||||
// Let output be the empty string.
|
||||
// 2. Let output be the empty string.
|
||||
StringBuilder output;
|
||||
|
||||
// For each segment of url’s path: append U+002F (/) followed by segment to output.
|
||||
// 3. For each segment of url’s path: append U+002F (/) followed by segment to output.
|
||||
for (auto const& segment : m_paths) {
|
||||
output.append('/');
|
||||
output.append(apply_percent_decoding == ApplyPercentDecoding::Yes ? percent_decode(segment) : segment);
|
||||
}
|
||||
|
||||
// Return output.
|
||||
// 4. Return output.
|
||||
return output.to_deprecated_string();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user