mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
The definition of syntax in the "css-properties-values-api" spec (which is used for the `@property/syntax` descriptor) is slightly different from the definition of `<syntax>` in the "css-values" spec (which we implement) in that it limits literal idents to exclusively `<custom-ident>`s (i.e. not CSS-wide keywords or "default"). `<custom-ident>`s are also case-sensitive so that behavior is implemented for syntax matching here as well
26 lines
670 B
C++
26 lines
670 B
C++
/*
|
|
* Copyright (c) 2025, Sam Atkins <sam@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/OwnPtr.h>
|
|
#include <AK/Vector.h>
|
|
#include <LibWeb/DOM/AbstractElement.h>
|
|
#include <LibWeb/Export.h>
|
|
#include <LibWeb/Forward.h>
|
|
|
|
namespace Web::CSS::Parser {
|
|
|
|
enum class LimitSingleComponentIdentToCustomIdent : u8 {
|
|
No,
|
|
Yes,
|
|
};
|
|
WEB_API OwnPtr<SyntaxNode> parse_as_syntax(Vector<ComponentValue> const&, LimitSingleComponentIdentToCustomIdent = LimitSingleComponentIdentToCustomIdent::No);
|
|
|
|
NonnullRefPtr<StyleValue const> parse_with_a_syntax(ParsingParams const&, Vector<ComponentValue> const& input, SyntaxNode const& syntax);
|
|
|
|
}
|