2022-05-29 19:55:49 -03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2022, Luke Wilde <lukew@serenityos.org>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
2022-09-30 22:01:42 -03:00
|
|
|
#include <LibWeb/Bindings/MainThreadVM.h>
|
2022-05-29 19:55:49 -03:00
|
|
|
#include <LibWeb/CSS/Parser/Parser.h>
|
2026-02-28 06:30:49 -03:00
|
|
|
#include <LibWeb/Platform/EventLoopPlugin.h>
|
2022-09-30 22:01:42 -03:00
|
|
|
|
|
|
|
|
namespace {
|
2023-03-17 13:54:27 -03:00
|
|
|
|
2022-09-30 22:01:42 -03:00
|
|
|
struct Globals {
|
|
|
|
|
Globals();
|
|
|
|
|
} globals;
|
2022-05-29 19:55:49 -03:00
|
|
|
|
2023-03-17 13:54:27 -03:00
|
|
|
Globals::Globals()
|
2022-05-29 19:55:49 -03:00
|
|
|
{
|
2026-02-28 06:30:49 -03:00
|
|
|
Web::Platform::EventLoopPlugin::install(*new Web::Platform::EventLoopPlugin);
|
2025-04-24 00:22:25 -03:00
|
|
|
Web::Bindings::initialize_main_thread_vm(Web::Bindings::AgentType::SimilarOriginWindow);
|
2023-03-17 13:54:27 -03:00
|
|
|
}
|
2023-03-17 13:46:09 -03:00
|
|
|
|
2023-03-17 13:54:27 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
|
|
|
|
|
{
|
2023-11-03 14:49:54 -03:00
|
|
|
AK::set_debug_enabled(false);
|
|
|
|
|
|
2022-09-30 22:01:42 -03:00
|
|
|
// FIXME: There's got to be a better way to do this "correctly"
|
|
|
|
|
auto& vm = Web::Bindings::main_thread_vm();
|
2025-02-05 09:08:27 -03:00
|
|
|
(void)Web::parse_css_stylesheet(Web::CSS::Parser::ParsingParams(*vm.current_realm()), { data, size });
|
2022-05-29 19:55:49 -03:00
|
|
|
return 0;
|
|
|
|
|
}
|