mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 16:47:42 +00:00
LibWeb: Move Fetch::collect_an_http_quoted_string() into HTTP.{cpp,h}
The Fetch spec is too big to have a generic AbstractOperations.{cpp,h} file, so let's keep AOs in their section-specific files.
This commit is contained in:
parent
e3798886ed
commit
fad69fcacd
6 changed files with 11 additions and 25 deletions
|
@ -117,7 +117,7 @@ set(SOURCES
|
||||||
Dump.cpp
|
Dump.cpp
|
||||||
Encoding/TextDecoder.cpp
|
Encoding/TextDecoder.cpp
|
||||||
Encoding/TextEncoder.cpp
|
Encoding/TextEncoder.cpp
|
||||||
Fetch/AbstractOperations.cpp
|
Fetch/Infrastructure/HTTP.cpp
|
||||||
Fetch/Infrastructure/URL.cpp
|
Fetch/Infrastructure/URL.cpp
|
||||||
FontCache.cpp
|
FontCache.cpp
|
||||||
Geometry/DOMRectList.cpp
|
Geometry/DOMRectList.cpp
|
||||||
|
|
|
@ -1,20 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2022, Luke Wilde <lukew@serenityos.org>
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <AK/Forward.h>
|
|
||||||
|
|
||||||
namespace Web::Fetch {
|
|
||||||
|
|
||||||
enum class HttpQuotedStringExtractValue {
|
|
||||||
No,
|
|
||||||
Yes,
|
|
||||||
};
|
|
||||||
|
|
||||||
String collect_an_http_quoted_string(GenericLexer& lexer, HttpQuotedStringExtractValue extract_value);
|
|
||||||
|
|
||||||
}
|
|
|
@ -7,7 +7,7 @@
|
||||||
#include <AK/GenericLexer.h>
|
#include <AK/GenericLexer.h>
|
||||||
#include <AK/String.h>
|
#include <AK/String.h>
|
||||||
#include <AK/StringBuilder.h>
|
#include <AK/StringBuilder.h>
|
||||||
#include <LibWeb/Fetch/AbstractOperations.h>
|
#include <LibWeb/Fetch/Infrastructure/HTTP.h>
|
||||||
|
|
||||||
namespace Web::Fetch {
|
namespace Web::Fetch {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2022, Linus Groh <linusg@serenityos.org>
|
* Copyright (c) 2022, Linus Groh <linusg@serenityos.org>
|
||||||
|
* Copyright (c) 2022, Luke Wilde <lukew@serenityos.org>
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
*/
|
*/
|
||||||
|
@ -19,4 +20,11 @@ inline constexpr StringView HTTP_TAB_OR_SPACE = "\t "sv;
|
||||||
// HTTP whitespace is U+000A LF, U+000D CR, or an HTTP tab or space.
|
// HTTP whitespace is U+000A LF, U+000D CR, or an HTTP tab or space.
|
||||||
inline constexpr StringView HTTP_WHITESPACE = "\n\r\t "sv;
|
inline constexpr StringView HTTP_WHITESPACE = "\n\r\t "sv;
|
||||||
|
|
||||||
|
enum class HttpQuotedStringExtractValue {
|
||||||
|
No,
|
||||||
|
Yes,
|
||||||
|
};
|
||||||
|
|
||||||
|
String collect_an_http_quoted_string(GenericLexer& lexer, HttpQuotedStringExtractValue extract_value);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
#include <AK/CharacterTypes.h>
|
#include <AK/CharacterTypes.h>
|
||||||
#include <AK/GenericLexer.h>
|
#include <AK/GenericLexer.h>
|
||||||
#include <AK/StringBuilder.h>
|
#include <AK/StringBuilder.h>
|
||||||
#include <LibWeb/Fetch/AbstractOperations.h>
|
|
||||||
#include <LibWeb/Fetch/Infrastructure/HTTP.h>
|
#include <LibWeb/Fetch/Infrastructure/HTTP.h>
|
||||||
#include <LibWeb/MimeSniff/MimeType.h>
|
#include <LibWeb/MimeSniff/MimeType.h>
|
||||||
|
|
||||||
|
@ -125,7 +124,7 @@ Optional<MimeType> MimeType::from_string(StringView string)
|
||||||
// 8. If the code point at position within input is U+0022 ("), then:
|
// 8. If the code point at position within input is U+0022 ("), then:
|
||||||
if (lexer.peek() == '"') {
|
if (lexer.peek() == '"') {
|
||||||
// 1. Set parameterValue to the result of collecting an HTTP quoted string from input, given position and the extract-value flag.
|
// 1. Set parameterValue to the result of collecting an HTTP quoted string from input, given position and the extract-value flag.
|
||||||
parameter_value = collect_an_http_quoted_string(lexer, Fetch::HttpQuotedStringExtractValue::Yes);
|
parameter_value = Fetch::collect_an_http_quoted_string(lexer, Fetch::HttpQuotedStringExtractValue::Yes);
|
||||||
|
|
||||||
// 2. Collect a sequence of code points that are not U+003B (;) from input, given position.
|
// 2. Collect a sequence of code points that are not U+003B (;) from input, given position.
|
||||||
// NOTE: This uses the predicate version as the ignore_until(char) version will also ignore the ';'.
|
// NOTE: This uses the predicate version as the ignore_until(char) version will also ignore the ';'.
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
#include <LibWeb/DOM/EventDispatcher.h>
|
#include <LibWeb/DOM/EventDispatcher.h>
|
||||||
#include <LibWeb/DOM/ExceptionOr.h>
|
#include <LibWeb/DOM/ExceptionOr.h>
|
||||||
#include <LibWeb/DOM/IDLEventListener.h>
|
#include <LibWeb/DOM/IDLEventListener.h>
|
||||||
#include <LibWeb/Fetch/AbstractOperations.h>
|
|
||||||
#include <LibWeb/Fetch/Infrastructure/HTTP.h>
|
#include <LibWeb/Fetch/Infrastructure/HTTP.h>
|
||||||
#include <LibWeb/HTML/EventHandler.h>
|
#include <LibWeb/HTML/EventHandler.h>
|
||||||
#include <LibWeb/HTML/EventNames.h>
|
#include <LibWeb/HTML/EventNames.h>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue