1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:37:35 +00:00

Meta+LibHTTP through LibWeb: Make clang-format-10 clean

This commit is contained in:
Ben Wiederhake 2020-09-18 09:49:51 +02:00 committed by Andreas Kling
parent ede5dbd7b3
commit 08f9bc26a6
65 changed files with 297 additions and 273 deletions

View file

@ -34,7 +34,10 @@ namespace AttributeNames {
ENUMERATE_HTML_ATTRIBUTES
#undef __ENUMERATE_HTML_ATTRIBUTE
// clang-format off
// FIXME: clang-format gets confused here. Why?
[[gnu::constructor]] static void initialize()
// clang-format off
{
static bool s_initialized = false;
if (s_initialized)

View file

@ -37,7 +37,8 @@ public:
HTMLFieldSetElement(DOM::Document&, const FlyString& local_name);
virtual ~HTMLFieldSetElement() override;
const String& type() const {
const String& type() const
{
static String fieldset = "fieldset";
return fieldset;
}

View file

@ -27,8 +27,8 @@
#include <AK/StringBuilder.h>
#include <LibWeb/HTML/HTMLFormElement.h>
#include <LibWeb/HTML/HTMLInputElement.h>
#include <LibWeb/Page/Frame.h>
#include <LibWeb/InProcessWebView.h>
#include <LibWeb/Page/Frame.h>
#include <LibWeb/URLEncoder.h>
namespace Web::HTML {

View file

@ -37,7 +37,8 @@ public:
HTMLOutputElement(DOM::Document&, const FlyString& local_name);
virtual ~HTMLOutputElement() override;
const String& type() const {
const String& type() const
{
static String output = "output";
return output;
}

View file

@ -28,8 +28,8 @@
#include <LibJS/Interpreter.h>
#include <LibJS/Parser.h>
#include <LibWeb/DOM/Document.h>
#include <LibWeb/HTML/HTMLScriptElement.h>
#include <LibWeb/DOM/Text.h>
#include <LibWeb/HTML/HTMLScriptElement.h>
#include <LibWeb/Loader/ResourceLoader.h>
namespace Web::HTML {

View file

@ -37,7 +37,8 @@ public:
HTMLTextAreaElement(DOM::Document&, const FlyString& local_name);
virtual ~HTMLTextAreaElement() override;
const String& type() const {
const String& type() const
{
static String textarea = "textarea";
return textarea;
}

View file

@ -87,24 +87,24 @@ namespace Web::HTML {
} while (0)
#define EMIT_CHARACTER_AND_RECONSUME_IN(code_point, new_state) \
do { \
do { \
m_queued_tokens.enqueue(HTMLToken::make_character(code_point)); \
will_reconsume_in(State::new_state); \
m_state = State::new_state; \
goto new_state; \
will_reconsume_in(State::new_state); \
m_state = State::new_state; \
goto new_state; \
} while (0)
#define FLUSH_CODEPOINTS_CONSUMED_AS_A_CHARACTER_REFERENCE \
do { \
for (auto code_point : m_temporary_buffer) { \
if (consumed_as_part_of_an_attribute()) { \
#define FLUSH_CODEPOINTS_CONSUMED_AS_A_CHARACTER_REFERENCE \
do { \
for (auto code_point : m_temporary_buffer) { \
if (consumed_as_part_of_an_attribute()) { \
m_current_token.m_tag.attributes.last().value_builder.append_code_point(code_point); \
} else { \
create_new_token(HTMLToken::Type::Character); \
} else { \
create_new_token(HTMLToken::Type::Character); \
m_current_token.m_comment_or_character.data.append_code_point(code_point); \
m_queued_tokens.enqueue(m_current_token); \
} \
} \
m_queued_tokens.enqueue(m_current_token); \
} \
} \
} while (0)
#define DONT_CONSUME_NEXT_INPUT_CHARACTER \
@ -159,21 +159,21 @@ namespace Web::HTML {
return m_queued_tokens.dequeue(); \
} while (0)
#define EMIT_CHARACTER(code_point) \
do { \
create_new_token(HTMLToken::Type::Character); \
#define EMIT_CHARACTER(code_point) \
do { \
create_new_token(HTMLToken::Type::Character); \
m_current_token.m_comment_or_character.data.append_code_point(code_point); \
m_queued_tokens.enqueue(m_current_token); \
return m_queued_tokens.dequeue(); \
m_queued_tokens.enqueue(m_current_token); \
return m_queued_tokens.dequeue(); \
} while (0)
#define EMIT_CURRENT_CHARACTER \
EMIT_CHARACTER(current_input_character.value());
#define SWITCH_TO_AND_EMIT_CHARACTER(code_point, new_state) \
do { \
will_switch_to(State::new_state); \
m_state = State::new_state; \
do { \
will_switch_to(State::new_state); \
m_state = State::new_state; \
EMIT_CHARACTER(code_point); \
} while (0)