mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibWeb: Remove redundant SVG presentation attribute handling
This commit is contained in:
parent
884b7fcbf5
commit
dab994c4f3
Notes:
github-actions[bot]
2025-10-20 11:39:33 +00:00
Author: https://github.com/tcl3
Commit: dab994c4f3
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6448
Reviewed-by: https://github.com/AtkinsSJ ✅
8 changed files with 0 additions and 117 deletions
|
|
@ -52,27 +52,6 @@ GC::Ptr<Layout::Node> SVGForeignObjectElement::create_layout_node(GC::Ref<CSS::C
|
|||
return heap().allocate<Layout::SVGForeignObjectBox>(document(), *this, move(style));
|
||||
}
|
||||
|
||||
bool SVGForeignObjectElement::is_presentational_hint(FlyString const& name) const
|
||||
{
|
||||
if (Base::is_presentational_hint(name))
|
||||
return true;
|
||||
|
||||
return first_is_one_of(name,
|
||||
SVG::AttributeNames::width,
|
||||
SVG::AttributeNames::height);
|
||||
}
|
||||
|
||||
void SVGForeignObjectElement::apply_presentational_hints(GC::Ref<CSS::CascadedProperties> cascaded_properties) const
|
||||
{
|
||||
Base::apply_presentational_hints(cascaded_properties);
|
||||
auto parsing_context = CSS::Parser::ParsingParams { document(), CSS::Parser::ParsingMode::SVGPresentationAttribute };
|
||||
if (auto width_value = parse_css_value(parsing_context, get_attribute_value(Web::HTML::AttributeNames::width), CSS::PropertyID::Width))
|
||||
cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::Width, width_value.release_nonnull());
|
||||
|
||||
if (auto height_value = parse_css_value(parsing_context, get_attribute_value(Web::HTML::AttributeNames::height), CSS::PropertyID::Height))
|
||||
cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::Height, height_value.release_nonnull());
|
||||
}
|
||||
|
||||
GC::Ref<SVG::SVGAnimatedLength> SVGForeignObjectElement::x()
|
||||
{
|
||||
return *m_x;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue