mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:17:36 +00:00
LibWeb: Fix parsing bug for SVG attributes
This doesn't seem to actually have fixed any bugs, as having FillOpacity instead of StrokeOpacity in the call to parse_css_value doesn't seem to have actually been causing bugs. But, I still think it's worthwhile correcting. The reason that it wasn't causing bugs is that having FillOpacity instead of StrokeOpacity in the call to parse_css_value means that when parsing the value is compared to the acceptable values for that property (for example the value can only be a percentage, or a number, etc.). In this case both FillOpacity and StrokeOpacity seem to accept the same values.
This commit is contained in:
parent
f2047a5c32
commit
70919dbed7
3 changed files with 30 additions and 3 deletions
|
@ -141,11 +141,11 @@ void SVGGraphicsElement::apply_presentational_hints(CSS::StyleProperties& style)
|
|||
if (auto fill_opacity_value = parse_css_value(parsing_context, value, CSS::PropertyID::FillOpacity).release_value_but_fixme_should_propagate_errors())
|
||||
style.set_property(CSS::PropertyID::FillOpacity, fill_opacity_value.release_nonnull());
|
||||
} else if (name.equals_ignoring_ascii_case("stroke-opacity"sv)) {
|
||||
if (auto stroke_opacity_value = parse_css_value(parsing_context, value, CSS::PropertyID::FillOpacity).release_value_but_fixme_should_propagate_errors())
|
||||
if (auto stroke_opacity_value = parse_css_value(parsing_context, value, CSS::PropertyID::StrokeOpacity).release_value_but_fixme_should_propagate_errors())
|
||||
style.set_property(CSS::PropertyID::StrokeOpacity, stroke_opacity_value.release_nonnull());
|
||||
} else if (name.equals_ignoring_ascii_case(SVG::AttributeNames::opacity)) {
|
||||
if (auto stroke_opacity_value = parse_css_value(parsing_context, value, CSS::PropertyID::Opacity).release_value_but_fixme_should_propagate_errors())
|
||||
style.set_property(CSS::PropertyID::Opacity, stroke_opacity_value.release_nonnull());
|
||||
if (auto opacity_value = parse_css_value(parsing_context, value, CSS::PropertyID::Opacity).release_value_but_fixme_should_propagate_errors())
|
||||
style.set_property(CSS::PropertyID::Opacity, opacity_value.release_nonnull());
|
||||
} else if (name.equals_ignoring_ascii_case("text-anchor"sv)) {
|
||||
if (auto text_anchor_value = parse_css_value(parsing_context, value, CSS::PropertyID::TextAnchor).release_value_but_fixme_should_propagate_errors())
|
||||
style.set_property(CSS::PropertyID::TextAnchor, text_anchor_value.release_nonnull());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue