mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibWeb: Allow specifying type of nested declarations rule
When parsing declarations within a nested grouping rule, we don't store these directly, but within a "nested declarations rule", in most cases this is `CSSNestedDeclarations`, but this isn't always the case e.g. `@function` rules and others (e.g. @media) within them should instead use `CSSFunctionDeclarations`
This commit is contained in:
Notes:
github-actions[bot]
2026-03-27 11:21:09 +00:00
Author: https://github.com/Calme1709 Commit: https://github.com/LadybirdBrowser/ladybird/commit/cd05e1d0396 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8624 Reviewed-by: https://github.com/AtkinsSJ ✅
@@ -8,12 +8,18 @@
|
||||
#include <LibWeb/Bindings/CSSNestedDeclarationsPrototype.h>
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/CSS/CSSStyleRule.h>
|
||||
#include <LibWeb/CSS/Parser/Parser.h>
|
||||
#include <LibWeb/Dump.h>
|
||||
|
||||
namespace Web::CSS {
|
||||
|
||||
GC_DEFINE_ALLOCATOR(CSSNestedDeclarations);
|
||||
|
||||
GC::Ref<CSSNestedDeclarations> CSSNestedDeclarations::create(JS::Realm& realm, Parser::Parser& parser, Vector<Parser::Declaration> const& declarations)
|
||||
{
|
||||
return realm.create<CSSNestedDeclarations>(realm, parser.convert_to_style_declaration(declarations));
|
||||
}
|
||||
|
||||
GC::Ref<CSSNestedDeclarations> CSSNestedDeclarations::create(JS::Realm& realm, CSSStyleProperties& declaration)
|
||||
{
|
||||
return realm.create<CSSNestedDeclarations>(realm, declaration);
|
||||
|
||||
Reference in New Issue
Block a user