mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 19:07:34 +00:00
LibWeb: Implement @supports selector(.foo)
This is defined in https://www.w3.org/TR/css-conditional-4/#at-supports-ext which just became a CR. :^)
This commit is contained in:
parent
c50ea8c1dd
commit
7880718fa8
4 changed files with 93 additions and 9 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Sam Atkins <atkinssj@serenityos.org>
|
||||
* Copyright (c) 2021-2022, Sam Atkins <atkinssj@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -16,16 +16,26 @@
|
|||
|
||||
namespace Web::CSS {
|
||||
|
||||
// https://www.w3.org/TR/css-conditional-3/#at-supports
|
||||
// https://www.w3.org/TR/css-conditional-4/#at-supports
|
||||
class Supports final : public RefCounted<Supports> {
|
||||
friend class Parser;
|
||||
|
||||
public:
|
||||
struct Feature {
|
||||
struct Declaration {
|
||||
String declaration;
|
||||
bool evaluate() const;
|
||||
};
|
||||
|
||||
struct Selector {
|
||||
String selector;
|
||||
bool evaluate() const;
|
||||
};
|
||||
|
||||
struct Feature {
|
||||
Variant<Declaration, Selector> value;
|
||||
bool evaluate() const;
|
||||
};
|
||||
|
||||
struct Condition;
|
||||
struct InParens {
|
||||
Variant<NonnullOwnPtr<Condition>, Feature, GeneralEnclosed> value;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue