diff options
author | Luke Wilde <lukew@serenityos.org> | 2023-02-28 16:54:25 +0000 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-03-07 11:51:12 +0000 |
commit | f7ff1fd9856636c756156a2ed0da90105714b73f (patch) | |
tree | 117ca4499cc73c900fadc6b99d3028bcbabfc544 /Meta/Lagom | |
parent | 54a1ec2f1007e27de126d57e83b9ddc10628474f (diff) | |
download | serenity-f7ff1fd9856636c756156a2ed0da90105714b73f.zip |
LibWeb: Remove CSS::Parser::ParsingContext's default constructor
This relied on pulling the current realm from the main thread VM, which
requires an execution context to be on the VM's stack. This heavily
relied on the dummy execution context that is always on the stack, for
example, when parsing the UA style sheets where no JavaScript is
running.
Diffstat (limited to 'Meta/Lagom')
-rw-r--r-- | Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSPropertyID.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSPropertyID.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSPropertyID.cpp index ce97679e98..9674c37424 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSPropertyID.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSPropertyID.cpp @@ -49,6 +49,7 @@ ErrorOr<void> generate_header_file(JsonObject& properties, Core::File& file) #include <AK/NonnullRefPtr.h> #include <AK/StringView.h> #include <AK/Traits.h> +#include <LibJS/Forward.h> #include <LibWeb/Forward.h> namespace Web::CSS { @@ -106,7 +107,7 @@ PropertyID property_id_from_camel_case_string(StringView); PropertyID property_id_from_string(StringView); StringView string_from_property_id(PropertyID); bool is_inherited_property(PropertyID); -NonnullRefPtr<StyleValue> property_initial_value(PropertyID); +NonnullRefPtr<StyleValue> property_initial_value(JS::Realm&, PropertyID); bool property_accepts_value(PropertyID, StyleValue&); size_t property_maximum_value_count(PropertyID); @@ -308,13 +309,13 @@ bool property_affects_stacking_context(PropertyID property_id) } } -NonnullRefPtr<StyleValue> property_initial_value(PropertyID property_id) +NonnullRefPtr<StyleValue> property_initial_value(JS::Realm& context_realm, PropertyID property_id) { static Array<RefPtr<StyleValue>, to_underlying(last_property_id) + 1> initial_values; static bool initialized = false; if (!initialized) { initialized = true; - Parser::ParsingContext parsing_context; + Parser::ParsingContext parsing_context(context_realm); )~~~"); // NOTE: Parsing a shorthand property requires that its longhands are already available here. |