mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-24 00:49:46 +00:00
This is not really a context, but more of a set of parameters for creating a Parser. So, treat it as such: Rename it to ParsingParams, and store its values and methods directly in the Parser instead of keeping the ParsingContext around. This has a nice side-effect of not including DOM/Document.h everywhere that needs a Parser.
33 lines
853 B
C++
33 lines
853 B
C++
/*
|
|
* Copyright (c) 2022, Luke Wilde <lukew@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <LibWeb/Bindings/MainThreadVM.h>
|
|
#include <LibWeb/CSS/Parser/Parser.h>
|
|
#include <LibWeb/Platform/EventLoopPluginSerenity.h>
|
|
|
|
namespace {
|
|
|
|
struct Globals {
|
|
Globals();
|
|
} globals;
|
|
|
|
Globals::Globals()
|
|
{
|
|
Web::Platform::EventLoopPlugin::install(*new Web::Platform::EventLoopPluginSerenity);
|
|
MUST(Web::Bindings::initialize_main_thread_vm(Web::HTML::EventLoop::Type::Window));
|
|
}
|
|
|
|
}
|
|
|
|
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
|
|
{
|
|
AK::set_debug_enabled(false);
|
|
|
|
// FIXME: There's got to be a better way to do this "correctly"
|
|
auto& vm = Web::Bindings::main_thread_vm();
|
|
(void)Web::parse_css_stylesheet(Web::CSS::Parser::ParsingParams(*vm.current_realm()), { data, size });
|
|
return 0;
|
|
}
|