1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 23:37:36 +00:00

LibWeb: Flesh out SVGMaskElement a bit

- Add method to resolve the masking area (based on the target element
  size)
- Parse the maskUnits and maskContentUnits attributes
This commit is contained in:
MacDue 2023-09-10 14:00:47 +01:00 committed by Andreas Kling
parent 0af8d81f48
commit 650180811e
5 changed files with 55 additions and 6 deletions

View file

@ -88,11 +88,15 @@ struct PreserveAspectRatio {
MeetOrSlice meet_or_slice { MeetOrSlice::Meet };
};
enum class GradientUnits {
enum class SVGUnits {
ObjectBoundingBox,
UserSpaceOnUse
};
using GradientUnits = SVGUnits;
using MaskUnits = SVGUnits;
using MaskContentUnits = SVGUnits;
enum class SpreadMethod {
Pad,
Repeat,
@ -149,7 +153,7 @@ public:
static Vector<PathInstruction> parse_path_data(StringView input);
static Optional<Vector<Transform>> parse_transform(StringView input);
static Optional<PreserveAspectRatio> parse_preserve_aspect_ratio(StringView input);
static Optional<GradientUnits> parse_gradient_units(StringView input);
static Optional<SVGUnits> parse_units(StringView input);
static Optional<SpreadMethod> parse_spread_method(StringView input);
private: