1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 12:47:45 +00:00

Ladybird/ConsoleClient: Implement console message styling with %c

This matches the changes made to Serenity in:
7a2da4cabf
This commit is contained in:
Sam Atkins 2022-10-05 12:24:08 +01:00 committed by Andrew Kaster
parent 0bf79b1f3b
commit acec34351f
2 changed files with 20 additions and 9 deletions

View file

@ -1,7 +1,7 @@
/*
* Copyright (c) 2022, Brandon Scott <xeon.productions@gmail.com>
* Copyright (c) 2020, Hunter Salyer <thefalsehonesty@gmail.com>
* Copyright (c) 2021, Sam Atkins <atkinssj@serenityos.org>
* Copyright (c) 2021-2022, Sam Atkins <atkinssj@serenityos.org>
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
@ -32,6 +32,12 @@ private:
virtual void clear() override;
virtual JS::ThrowCompletionOr<JS::Value> printer(JS::Console::LogLevel log_level, PrinterArguments) override;
virtual void add_css_style_to_current_message(StringView style) override
{
m_current_message_style.append(style);
m_current_message_style.append(';');
}
SimpleWebView& m_view;
WeakPtr<JS::Interpreter> m_interpreter;
@ -55,6 +61,8 @@ private:
};
Vector<ConsoleOutput> m_message_log;
StringBuilder m_current_message_style;
WeakPtr<JS::Realm> m_realm;
};