Skip to content

fix(svg): clarify feOffset filter units example#44148

Merged
chrisdavidmills merged 1 commit into
mdn:mainfrom
danyalahmed1995:fix/issue-44122-feoffset-filterunits
May 18, 2026
Merged

fix(svg): clarify feOffset filter units example#44148
chrisdavidmills merged 1 commit into
mdn:mainfrom
danyalahmed1995:fix/issue-44122-feoffset-filterunits

Conversation

@danyalahmed1995
Copy link
Copy Markdown
Contributor

Summary

Adds filterUnits="userSpaceOnUse" to the <feOffset> example filter so the width and height values are interpreted as user-space units.

Details

The current example uses:

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

Without an explicit filterUnits, the default is objectBoundingBox, so width and height are interpreted relative to the bounding box rather than as user-space dimensions.

This update makes the example match the apparent intent and avoids teaching readers that bare numeric filter dimensions behave like pixel/user-space values by default.

Fixes #44122.

@danyalahmed1995 danyalahmed1995 requested a review from a team as a code owner May 17, 2026 22:51
@danyalahmed1995 danyalahmed1995 requested review from chrisdavidmills and removed request for a team May 17, 2026 22:51
@github-actions github-actions Bot added Content:SVG SVG docs size/xs [PR only] 0-5 LoC changed labels May 17, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Preview URLs (1 page)

Copy link
Copy Markdown
Contributor

@chrisdavidmills chrisdavidmills left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, that seems to make more sense conceptually, although it doesn't seem to make any difference to the rendering whatsoever. Thanks, @danyalahmed1995

@chrisdavidmills chrisdavidmills merged commit 0cc1adc into mdn:main May 18, 2026
8 checks passed
@danyalahmed1995
Copy link
Copy Markdown
Contributor Author

@chrisdavidmills Yeah basically, this just makes it more clear to beginners and they won't confuse it with user space units.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:SVG SVG docs size/xs [PR only] 0-5 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

width/height values of filter effect in example are misleading

3 participants