Coverage Report

Created: 2026-09-26 06:49

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/serenity/Userland/Libraries/LibWeb/CSS/CSSKeyframeRule.h
Line
Count
Source
1
/*
2
 * Copyright (c) 2023, Ali Mohammad Pur <mpfard@serenityos.org>
3
 *
4
 * SPDX-License-Identifier: BSD-2-Clause
5
 */
6
7
#pragma once
8
9
#include <AK/NonnullRefPtr.h>
10
#include <LibWeb/CSS/CSSRule.h>
11
#include <LibWeb/CSS/CSSStyleDeclaration.h>
12
#include <LibWeb/CSS/Percentage.h>
13
#include <LibWeb/Forward.h>
14
#include <LibWeb/WebIDL/ExceptionOr.h>
15
16
namespace Web::CSS {
17
18
// https://drafts.csswg.org/css-animations/#interface-csskeyframerule
19
class CSSKeyframeRule final : public CSSRule {
20
    WEB_PLATFORM_OBJECT(CSSKeyframeRule, CSSRule);
21
    JS_DECLARE_ALLOCATOR(CSSKeyframeRule);
22
23
public:
24
    static JS::NonnullGCPtr<CSSKeyframeRule> create(JS::Realm&, CSS::Percentage key, PropertyOwningCSSStyleDeclaration&);
25
26
    virtual ~CSSKeyframeRule() = default;
27
28
0
    CSS::Percentage key() const { return m_key; }
29
0
    JS::NonnullGCPtr<CSSStyleDeclaration> style() const { return m_declarations; }
30
0
    JS::NonnullGCPtr<PropertyOwningCSSStyleDeclaration> style_as_property_owning_style_declaration() const { return m_declarations; }
31
32
    String key_text() const
33
0
    {
34
0
        return m_key.to_string();
35
0
    }
36
37
    void set_key_text(String const& key_text)
38
0
    {
39
0
        dbgln("FIXME: CSSKeyframeRule::set_key_text is not implemented: {}", key_text);
40
0
    }
41
42
private:
43
    CSSKeyframeRule(JS::Realm&, CSS::Percentage, PropertyOwningCSSStyleDeclaration&);
44
45
    virtual void visit_edges(Visitor&) override;
46
    virtual void initialize(JS::Realm&) override;
47
    virtual String serialized() const override;
48
49
    CSS::Percentage m_key;
50
    JS::NonnullGCPtr<PropertyOwningCSSStyleDeclaration> m_declarations;
51
};
52
53
template<>
54
0
inline bool CSSRule::fast_is<CSSKeyframeRule>() const { return type() == CSSRule::Type::Keyframe; }
55
56
}