-
Notifications
You must be signed in to change notification settings - Fork 22.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MDN Feature Pages for SVGAnimatedPreserveAspectRatio #37075
MDN Feature Pages for SVGAnimatedPreserveAspectRatio #37075
Conversation
Preview URLs
(comment last updated: 2025-01-07 18:47:12) |
|
||
{{APIRef("SVG")}} | ||
|
||
The **`animVal`** read-only property of the {{domxref("SVGAnimatedPreserveAspectRatio")}} interface represents the current animated value of the {{SVGAttr("preserveAspectRatio")}} attribute of an SVG element. This property reflects the current value after any animations or transformations are applied. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we simplify this to:
The **`animVal`** read-only property of the {{domxref("SVGAnimatedPreserveAspectRatio")}} interface represents the current animated value of the {{SVGAttr("preserveAspectRatio")}} attribute of an SVG element. This property reflects the current value after any animations or transformations are applied. | |
The **`animVal`** read-only property of the {{domxref("SVGAnimatedPreserveAspectRatio")}} interface represents the value of the {{SVGAttr("preserveAspectRatio")}} attribute of an SVG element after any animations or transformations are applied. |
?
But I'm also puzzled, the spec says:
The baseVal and animVal IDL attributes represent the current non-animated value of the reflected ‘preserveAspectRatio’ attribute. On getting baseVal or animVal, an SVGPreserveAspectRatio object is returned that reflects the base value of the ‘preserveAspectRatio’ attribute on the SVG element that the object with the reflcting IDL attribute of type SVGAnimatedPreserveAspectRatio was obtained from.
Is that right? How can it represent the non-animated value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I am more puzzled as after seeing the example, animVal
is indeed representing the current value, after any animations.
These questions come to my mind:
Why does the spec say both animVal
and baseVal
represent the current
value? This means baseVal
should also be updated after any transformations.
Only animVal
seems to have the value changed after any transformations are applied, but then the spec says it reflects the base
value, so it must be static and not current.
I guess the specs are not consistent for this
property.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'm going to assume that the spec is wrong here (or at least that the understanding in this PR is correct - perhaps the spec does not say what it seems to be saying!).
files/en-us/web/api/svganimatedpreserveaspectratio/animval/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/api/svganimatedpreserveaspectratio/animval/index.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 thanks for your work on this!
Description
This PR adds the MDN feature pages for the SVGAnimatedPreserveAspectRatio interface as part of a recent project to document missing Widely available pages for interface features.
Motivation
I believe that my support in documenting the SVGAnimatedPreserveAspectRatio interface can significantly help developers by providing essential resources.
Additional details
For more context, see the discussion on missing documentation tracked at https://openwebdocs.github.io/web-docs-backlog/baseline/. Additionally, related projects for adding widely available web features can be found at openwebdocs/project#214.
Related issues and pull requests
Relates to #214