mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-23 01:12:45 +00:00
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
71 lines
2.2 KiB
C++
71 lines
2.2 KiB
C++
/*
|
|
* Copyright (c) 2025, Lucien Fiorini <lucienfiorini@gmail.com>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <LibWeb/Bindings/SVGFEGaussianBlurElementPrototype.h>
|
|
#include <LibWeb/CSS/Parser/Parser.h>
|
|
#include <LibWeb/Layout/Node.h>
|
|
#include <LibWeb/SVG/SVGAnimatedEnumeration.h>
|
|
#include <LibWeb/SVG/SVGFEGaussianBlurElement.h>
|
|
|
|
namespace Web::SVG {
|
|
|
|
GC_DEFINE_ALLOCATOR(SVGFEGaussianBlurElement);
|
|
|
|
SVGFEGaussianBlurElement::SVGFEGaussianBlurElement(DOM::Document& document, DOM::QualifiedName qualified_name)
|
|
: SVGElement(document, qualified_name)
|
|
{
|
|
}
|
|
|
|
void SVGFEGaussianBlurElement::initialize(JS::Realm& realm)
|
|
{
|
|
WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGFEGaussianBlurElement);
|
|
Base::initialize(realm);
|
|
}
|
|
|
|
void SVGFEGaussianBlurElement::visit_edges(Cell::Visitor& visitor)
|
|
{
|
|
Base::visit_edges(visitor);
|
|
SVGFilterPrimitiveStandardAttributes::visit_edges(visitor);
|
|
visitor.visit(m_in1);
|
|
visitor.visit(m_std_deviation_x);
|
|
visitor.visit(m_std_deviation_y);
|
|
}
|
|
|
|
GC::Ref<SVGAnimatedString> SVGFEGaussianBlurElement::in1()
|
|
{
|
|
if (!m_in1)
|
|
m_in1 = SVGAnimatedString::create(realm(), *this, AttributeNames::in);
|
|
|
|
return *m_in1;
|
|
}
|
|
|
|
// https://drafts.fxtf.org/filter-effects/#element-attrdef-fegaussianblur-stddeviation
|
|
GC::Ref<SVGAnimatedNumber> SVGFEGaussianBlurElement::std_deviation_x()
|
|
{
|
|
if (!m_std_deviation_x) {
|
|
m_std_deviation_x = SVGAnimatedNumber::create(realm(), *this, AttributeNames::stdDeviation, 0.f,
|
|
SVGAnimatedNumber::SupportsSecondValue::Yes, SVGAnimatedNumber::ValueRepresented::First);
|
|
}
|
|
return *m_std_deviation_x;
|
|
}
|
|
|
|
// https://drafts.fxtf.org/filter-effects/#element-attrdef-fegaussianblur-stddeviation
|
|
GC::Ref<SVGAnimatedNumber> SVGFEGaussianBlurElement::std_deviation_y()
|
|
{
|
|
if (!m_std_deviation_y) {
|
|
m_std_deviation_y = SVGAnimatedNumber::create(realm(), *this, AttributeNames::stdDeviation, 0.f,
|
|
SVGAnimatedNumber::SupportsSecondValue::Yes, SVGAnimatedNumber::ValueRepresented::Second);
|
|
}
|
|
return *m_std_deviation_y;
|
|
}
|
|
|
|
GC::Ref<SVGAnimatedEnumeration> SVGFEGaussianBlurElement::edge_mode() const
|
|
{
|
|
// FIXME: Resolve the actual value from AttributeNames::edgeMode.
|
|
return SVGAnimatedEnumeration::create(realm(), 0);
|
|
}
|
|
|
|
}
|