diff --git a/Userland/Libraries/LibWeb/SVG/AttributeNames.h b/Userland/Libraries/LibWeb/SVG/AttributeNames.h index f223a8d68a..64af9b9e0d 100644 --- a/Userland/Libraries/LibWeb/SVG/AttributeNames.h +++ b/Userland/Libraries/LibWeb/SVG/AttributeNames.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Andreas Kling + * Copyright (c) 2021-2023, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ @@ -49,6 +49,7 @@ namespace Web::SVG::AttributeNames { E(maskUnits) \ E(numOctaves) \ E(offset) \ + E(opacity) \ E(pathLength) \ E(patternContentUnits) \ E(patternTransform) \ diff --git a/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp index 694819ad13..c5bcd3b447 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp @@ -2,6 +2,7 @@ * Copyright (c) 2020, Matthew Olsson * Copyright (c) 2021-2022, Sam Atkins * Copyright (c) 2023, MacDue + * Copyright (c) 2023, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ @@ -10,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -138,6 +140,9 @@ void SVGGraphicsElement::apply_presentational_hints(CSS::StyleProperties& style) } 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()) 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()); } }); }