LibWeb: Implement SVGAnimatedNumber
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run

This commit is contained in:
Jelle Raaijmakers 2025-07-10 17:13:52 +02:00 committed by Tim Ledbetter
commit 97fa0be16e
Notes: github-actions[bot] 2025-07-11 10:27:20 +00:00
11 changed files with 235 additions and 47 deletions

View file

@ -21,14 +21,12 @@ class SVGStopElement final : public SVGElement {
public:
virtual ~SVGStopElement() override = default;
virtual void attribute_changed(FlyString const& name, Optional<String> const& old_value, Optional<String> const& value, Optional<FlyString> const& namespace_) override;
GC::Ref<SVGAnimatedNumber> offset() const;
GC::Ref<SVGAnimatedNumber> offset();
virtual bool is_presentational_hint(FlyString const&) const override;
virtual void apply_presentational_hints(GC::Ref<CSS::CascadedProperties>) const override;
NumberPercentage stop_offset() const { return m_offset.value_or(NumberPercentage::create_number(0)); }
float stop_offset() { return offset()->base_val(); }
Gfx::Color stop_color() const;
float stop_opacity() const;
@ -36,8 +34,9 @@ private:
SVGStopElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
virtual void visit_edges(Visitor&) override;
Optional<NumberPercentage> m_offset;
GC::Ptr<SVGAnimatedNumber> m_stop_offset;
};
}