mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-28 05:52:53 +00:00
LibWeb: Support x
and y
attributes on nested SVGs
This allows positioning a child SVG relative to its parent SVG. Note: These have been implemented as CSS properties as in SVG 2, these are geometry properties that can be used in CSS (see https://www.w3.org/TR/SVG/geometry.html), but there is not much browser support for this. It is nicer to implement than the ad-hoc SVG attribute parsing though, so I feel it may make sense to port the rest of the attributes specified here (which should fix some issues with viewport relative sizes).
This commit is contained in:
parent
556679fedd
commit
b10f58a1fe
Notes:
sideshowbarker
2024-07-17 00:47:29 +09:00
Author: https://github.com/MacDue
Commit: b10f58a1fe
Pull-request: https://github.com/SerenityOS/serenity/pull/22975
Reviewed-by: https://github.com/AtkinsSJ
8 changed files with 91 additions and 2 deletions
|
@ -751,6 +751,10 @@ void NodeWithStyle::apply_style(const CSS::StyleProperties& computed_style)
|
|||
computed_values.set_grid_template_areas(computed_style.grid_template_areas());
|
||||
computed_values.set_grid_auto_flow(computed_style.grid_auto_flow());
|
||||
|
||||
if (auto x_value = computed_style.length_percentage(CSS::PropertyID::X); x_value.has_value())
|
||||
computed_values.set_x(*x_value);
|
||||
if (auto y_value = computed_style.length_percentage(CSS::PropertyID::Y); y_value.has_value())
|
||||
computed_values.set_y(*y_value);
|
||||
auto fill = computed_style.property(CSS::PropertyID::Fill);
|
||||
if (fill->has_color())
|
||||
computed_values.set_fill(fill->to_color(*this));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue