mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-17 07:50:04 +00:00
LibWeb: Implement matches attribute on CSSSupportsRule and CSSMediaRule
Gains us 4 WPT tests.
This commit is contained in:
parent
fc395f9824
commit
1a0d4487a8
Notes:
github-actions[bot]
2025-07-11 08:58:53 +00:00
Author: https://github.com/Calme1709
Commit: 1a0d4487a8
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5395
Reviewed-by: https://github.com/gmta ✅
7 changed files with 132 additions and 0 deletions
|
@ -24,6 +24,8 @@ public:
|
|||
virtual ~CSSMediaRule() = default;
|
||||
|
||||
virtual String condition_text() const override;
|
||||
bool matches() const { return condition_matches(); }
|
||||
|
||||
virtual bool condition_matches() const override { return m_media->matches(); }
|
||||
|
||||
MediaList* media() const { return m_media; }
|
||||
|
|
|
@ -5,4 +5,5 @@
|
|||
[Exposed=Window]
|
||||
interface CSSMediaRule : CSSConditionRule {
|
||||
[SameObject, PutForwards=mediaText] readonly attribute MediaList media;
|
||||
readonly attribute boolean matches;
|
||||
};
|
||||
|
|
|
@ -25,6 +25,8 @@ public:
|
|||
virtual ~CSSSupportsRule() = default;
|
||||
|
||||
String condition_text() const override;
|
||||
bool matches() const { return condition_matches(); }
|
||||
|
||||
virtual bool condition_matches() const override { return m_supports->matches(); }
|
||||
|
||||
Supports const& supports() const { return m_supports; }
|
||||
|
|
|
@ -3,4 +3,5 @@
|
|||
// https://drafts.csswg.org/css-conditional-3/#the-csssupportsrule-interface
|
||||
[Exposed=Window]
|
||||
interface CSSSupportsRule : CSSConditionRule {
|
||||
readonly attribute boolean matches;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue