Skip to content
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

Merged
merged 10 commits into from
Jan 7, 2025

Conversation

yashrajbharti
Copy link
Contributor

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

@yashrajbharti yashrajbharti requested a review from a team as a code owner December 3, 2024 16:42
@yashrajbharti yashrajbharti requested review from wbamberg and removed request for a team December 3, 2024 16:42
@github-actions github-actions bot added Content:WebAPI Web API docs size/m [PR only] 51-500 LoC changed labels Dec 3, 2024
Copy link
Contributor

github-actions bot commented Dec 3, 2024


{{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.
Copy link
Collaborator

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:

Suggested change
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?

Copy link
Contributor Author

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.

Copy link
Collaborator

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!).

@yashrajbharti yashrajbharti requested a review from wbamberg January 7, 2025 10:10
@yashrajbharti yashrajbharti requested a review from wbamberg January 7, 2025 18:44
Copy link
Collaborator

@wbamberg wbamberg left a 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!

@wbamberg wbamberg merged commit 4f5fffd into mdn:main Jan 7, 2025
8 checks passed
@yashrajbharti yashrajbharti deleted the feat/svganimatedpreserveaspectratio branch January 7, 2025 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs size/m [PR only] 51-500 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants