Skip to content

width/height values of filter effect in example are misleading #44122

@PoignardAzur

Description

@PoignardAzur

MDN URL

https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Element/feOffset

What specific section or headline is this issue about?

Example

What information was incorrect, unhelpful, or incomplete?

The example gives this code for an offset filter:

<filter id="offset" width="180" height="180">

On first read, this might suggest to users that the resulting filter will be 180px wide. This is not the case; as per the filter-effects spec:

If filterUnits is equal to objectBoundingBox, then x, y, width, height represent fractions or percentages of the bounding box on the referencing element (see object bounding box units).

The initial value for filterUnits is objectBoundingBox.

So basically, the value is interpreted as "18000%", which is visually correct but wildly oversized.

What did you expect to see?

<filter id="offset" width="180" height="180" filterUnits="userSpaceOnUse">

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

No response

MDN metadata

Page report details

Metadata

Metadata

Assignees

No one assigned

    Labels

    Content:SVGSVG docsneeds triageTriage needed by staff and/or partners. Automatically applied when an issue is opened.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions