mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-23 00:19:18 +00:00
LibWeb: Use XML parser for SVG-as-image documents
We were already using the XML parser for SVG files when opening at the top level. This patch makes things consistent by using the same code path when parsing SVG-as-image. We also make some tweaks in SVG presentation attribute handling since we can no longer rely on the HTML length attribute parsing quirk when parsing width/height attributes.
This commit is contained in:
parent
b7595013c1
commit
3c808de270
Notes:
github-actions[bot]
2025-08-22 09:36:57 +00:00
Author: https://github.com/awesomekling
Commit: 3c808de270
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5944
4 changed files with 11 additions and 15 deletions
|
@ -65,7 +65,7 @@ bool SVGForeignObjectElement::is_presentational_hint(FlyString const& name) cons
|
|||
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() };
|
||||
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());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue