mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:48:11 +00:00
AK: Number the spec step comments in URL::serialize_path()
This commit is contained in:
parent
f15d46fb8b
commit
f6c52f622d
1 changed files with 4 additions and 4 deletions
|
@ -263,21 +263,21 @@ bool URL::is_special_scheme(StringView scheme)
|
||||||
// https://url.spec.whatwg.org/#url-path-serializer
|
// https://url.spec.whatwg.org/#url-path-serializer
|
||||||
DeprecatedString URL::serialize_path(ApplyPercentDecoding apply_percent_decoding) const
|
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.
|
// FIXME: Reimplement this step once we modernize the URL implementation to meet the spec.
|
||||||
if (cannot_be_a_base_url())
|
if (cannot_be_a_base_url())
|
||||||
return m_paths[0];
|
return m_paths[0];
|
||||||
|
|
||||||
// Let output be the empty string.
|
// 2. Let output be the empty string.
|
||||||
StringBuilder output;
|
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) {
|
for (auto const& segment : m_paths) {
|
||||||
output.append('/');
|
output.append('/');
|
||||||
output.append(apply_percent_decoding == ApplyPercentDecoding::Yes ? percent_decode(segment) : segment);
|
output.append(apply_percent_decoding == ApplyPercentDecoding::Yes ? percent_decode(segment) : segment);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return output.
|
// 4. Return output.
|
||||||
return output.to_deprecated_string();
|
return output.to_deprecated_string();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue