mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-24 09:52:31 +00:00
LibWeb/SVG: Add FEFloodElement
This commit is contained in:
parent
de271b16fc
commit
d3684a36b0
Notes:
github-actions[bot]
2025-07-09 17:08:44 +00:00
Author: https://github.com/ananas-dev
Commit: d3684a36b0
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5028
Reviewed-by: https://github.com/gmta ✅
22 changed files with 189 additions and 18 deletions
54
Libraries/LibWeb/SVG/SVGFEFloodElement.cpp
Normal file
54
Libraries/LibWeb/SVG/SVGFEFloodElement.cpp
Normal file
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
* Copyright (c) 2025, Lucien Fiorini <lucienfiorini@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWeb/Bindings/SVGFEFloodElementPrototype.h>
|
||||
#include <LibWeb/CSS/ComputedProperties.h>
|
||||
#include <LibWeb/CSS/Parser/Parser.h>
|
||||
#include <LibWeb/Layout/Node.h>
|
||||
#include <LibWeb/Layout/SVGGraphicsBox.h>
|
||||
#include <LibWeb/SVG/SVGFEFloodElement.h>
|
||||
|
||||
namespace Web::SVG {
|
||||
|
||||
GC_DEFINE_ALLOCATOR(SVGFEFloodElement);
|
||||
|
||||
SVGFEFloodElement::SVGFEFloodElement(DOM::Document& document, DOM::QualifiedName qualified_name)
|
||||
: SVGElement(document, qualified_name)
|
||||
{
|
||||
}
|
||||
|
||||
void SVGFEFloodElement::initialize(JS::Realm& realm)
|
||||
{
|
||||
Base::initialize(realm);
|
||||
WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGFEFloodElement);
|
||||
}
|
||||
|
||||
void SVGFEFloodElement::visit_edges(Cell::Visitor& visitor)
|
||||
{
|
||||
Base::visit_edges(visitor);
|
||||
SVGFilterPrimitiveStandardAttributes::visit_edges(visitor);
|
||||
}
|
||||
|
||||
GC::Ptr<Layout::Node> SVGFEFloodElement::create_layout_node(GC::Ref<CSS::ComputedProperties> style)
|
||||
{
|
||||
return heap().allocate<Layout::SVGBox>(document(), *this, move(style));
|
||||
}
|
||||
|
||||
// https://www.w3.org/TR/filter-effects-1/#FloodColorProperty
|
||||
Gfx::Color SVGFEFloodElement::flood_color() const
|
||||
{
|
||||
// FIXME: Find a way to get the Gfx::Color of the flood_color property
|
||||
// without having a layout node.
|
||||
return Color::Black;
|
||||
}
|
||||
|
||||
// https://www.w3.org/TR/filter-effects-1/#FloodOpacityProperty
|
||||
float SVGFEFloodElement::flood_opacity() const
|
||||
{
|
||||
return computed_properties()->flood_opacity();
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue