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

New pages: DOMMatrixReadOnly.skewX/skewY/rotate #37152

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open

Conversation

estelle
Copy link
Member

@estelle estelle commented Dec 9, 2024

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

github-actions bot commented Dec 9, 2024

Preview URLs (9 pages)
Flaws (10)

Note! 3 documents with no flaws that don't need to be listed. 🎉

URL: /en-US/docs/Web/API/DOMMatrix/scale3dSelf
Title: DOMMatrix: scale3dSelf() method
Flaw count: 2

  • macros:
    • /en-US/docs/Web/API/DOMMatrixReadOnly/is2D does not exist
    • /en-US/docs/Web/API/DOMMatrix/scaleSelf does not exist

URL: /en-US/docs/Web/API/DOMMatrix/rotateFromVectorSelf
Title: DOMMatrix: rotateFromVectorSelf() method
Flaw count: 2

  • macros:
    • /en-US/docs/Web/API/DOMMatrixRead/rotateSelf does not exist
    • /en-US/docs/Web/API/DOMMatrixRead/rotateAxisAngleSelf does not exist

URL: /en-US/docs/Web/API/DOMMatrix/rotateAxisAngleSelf
Title: DOMMatrix: rotateAxisAngleSelf() method
Flaw count: 2

  • macros:
    • /en-US/docs/Web/API/DOMMatrix/is2d does not exist
    • /en-US/docs/Web/API/DOMMatrix/is2d does not exist

URL: /en-US/docs/Web/API/DOMMatrixReadOnly/skewY
Title: DOMMatrixReadOnly: skewY() method
Flaw count: 1

  • macros:
    • /en-US/docs/Web/API/DOMMatrix/skewY does not exist

URL: /en-US/docs/Web/API/DOMMatrixReadOnly/rotateAxisAngle
Title: DOMMatrixReadOnly: rotateAxisAngle() method
Flaw count: 2

  • macros:
    • /en-US/docs/Web/API/DOMMatrixReadOnly/is2D does not exist
    • /en-US/docs/Web/API/DOMMatrixReadOnly/is2D does not exist

URL: /en-US/docs/Web/API/DOMMatrixReadOnly/skewX
Title: DOMMatrixReadOnly: skewX() method
Flaw count: 1

  • macros:
    • /en-US/docs/Web/API/DOMMatrix/skewX does not exist

(comment last updated: 2025-01-12 03:01:28)

@github-actions github-actions bot added size/l [PR only] 501-1000 LoC changed and removed size/m [PR only] 51-500 LoC changed labels Dec 10, 2024
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.

There were a few comment which applied to most of these pages, that I didn't note everywhere:

  • consider pretty-printing comments (and try to keep tgem under 80 characters, or they get hard-wrapped)
  • I'm not sure how relevant the CSS "see also" links are.

Comment on lines 11 to 13
The `rotateAxisAngleSelf()` method of the {{domxref("DOMMatrix")}} interface is a transformation method that returns a new {{domxref("DOMMatrix")}} created by rotating the source matrix by the given vector and angle. The original matrix is not altered.

To rotate a matrix without mutating it, see {{domxref("DOMMatrix.rotateAxisAngleSelf()")}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This sentence and the last sentence of the previous para seems wrong?

Comment on lines 30 to 34
- : A number; the y-coordinate of the vector denoting the axis of rotation. If undefined, the `rotX` value is used. If non-zero, [`is2D`](/en-US/docs/Web/API/DOMMatrix#is2d) is false.
- `rotZ` {{optional_inline}}
- : A number; the z-coordinate of the vector denoting the axis of rotation. If undefined, the `rotX` value is used. If non-zero, [`is2D`](/en-US/docs/Web/API/DOMMatrix#is2d) is false.
- `angle` {{optional_inline}}
- : A number; the angle of the rotation around the axis vector, in degrees.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Spec suggests that is it x and y that affect is2D:

If x or y are not 0 or -0, set is 2D of the current matrix to false.

Comment on lines +45 to +47
// "matrix3d(0.728, 0.609, -0.315, 0, -0.525, 0.791, 0.315, 0, 0.441, -0.063, 0.895, 0, 0, 0, 0, 1)"
console.log(matrix.toString());
// "matrix3d(0.728, 0.609, -0.315, 0, -0.525, 0.791, 0.315, 0, 0.441, -0.063, 0.895, 0, 0, 0, 0, 1)"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Might be worth pretty-printing these comments so they are more readable.

Comment on lines 63 to 77
- CSS {{cssxref("transform")}} property
- CSS {{cssxref("rotate")}} property
- CSS {{cssxref("transform-function")}} functions
- {{cssxref("transform-function/rotate", "rotate()")}}
- {{cssxref("transform-function/rotate3d", "rotate3d()")}}
- {{cssxref("transform-function/rotateX", "rotateX()")}}
- {{cssxref("transform-function/rotateY", "rotateY()")}}
- {{cssxref("transform-function/rotateZ", "rotateZ()")}}
- [CSS transforms](/en-US/docs/Web/CSS/CSS_transforms) module
- SVG [`transform`](/en-US/docs/Web/SVG/Attribute/transform) attribute
- {{domxref("CanvasRenderingContext2D")}} interface methods
- {{domxref("CanvasRenderingContext2D.rotate()")}}
- {{domxref("CanvasRenderingContext2D.transform()")}}
- {{domxref("CanvasRenderingContext2D.setTransform()")}}
- {{domxref("CanvasRenderingContext2D.resetTransform()")}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not that clear what the relevance of these transform/rotate pages are to this method. I mean it's not like you need to use matrices to rotate an item in CSS.


{{APIRef("Geometry Interfaces")}}{{AvailableInWorkers}}

The `rotateFromVectorSelf()` method of the {{domxref("DOMMatrix")}} interface is a mutable transformation method that modifies a matrix. It modifies the matrix by rotating the matrix by the angle between the specified vector and `(1, 0)`. The rotation angle is determined by the angle between the vector `(1,0)T` and `(x,y)T` in the clockwise direction, or `(+/-)arctan(y/x)`. If `x` and `y` are both `0`, the angle is specified as `0`, returning the altered {{domxref("DOMMatrix")}}.
Copy link
Collaborator

Choose a reason for hiding this comment

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

The first sentence here isn't ideal because it doesn't say what the method does, just that it mutates the matrix. Better to combine the first two sentences, something like:

The rotateFromVectorSelf() method of the {{domxref("DOMMatrix")}} modifies the matrix by rotating the matrix by the angle between the specified vector and (1, 0).

Copy link
Collaborator

Choose a reason for hiding this comment

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

The last sentence here "If x and y are both 0, the angle is specified as 0, returning the altered {{domxref("DOMMatrix")}}." is strange because if the angle is 0 isn't the matrix unchanged? So how can it be "altered"?

The **`scale3d()`** method of the {{domxref("DOMMatrixReadOnly")}} interface creates a new matrix being the result of the 3D scale transform being applied
to the matrix. It returns a new {{domxref("DOMMatrix")}} created by scaling the source 3d matrix by the given scale factor centered on the origin point specified by the origin parameters, with a default origin of `(0, 0, 0)`. The original matrix is not modified.

To mutate the matrix as you 3D-rotate it, see {{domxref("DOMMatrix.scale3dSelf()")}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
To mutate the matrix as you 3D-rotate it, see {{domxref("DOMMatrix.scale3dSelf()")}}
To mutate the matrix as you 3D-scale it, see {{domxref("DOMMatrix.scale3dSelf()")}}.


{{APIRef("Geometry Interfaces")}}{{AvailableInWorkers}}

The `skewX()` method of the {{domxref("DOMMatrixReadOnly")}} interface is a transformation method that returns a new {{domxref("DOMMatrix")}} created by applying the specified skew transformation to the source matrix along its X-axis. The original matrix is not modified.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
The `skewX()` method of the {{domxref("DOMMatrixReadOnly")}} interface is a transformation method that returns a new {{domxref("DOMMatrix")}} created by applying the specified skew transformation to the source matrix along its X-axis. The original matrix is not modified.
The `skewX()` method of the {{domxref("DOMMatrixReadOnly")}} interface returns a new {{domxref("DOMMatrix")}} created by applying the specified skew transformation to the source matrix along its X-axis. The original matrix is not modified.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, "X axis" or X-axis"? (or x-axis or x axis). Below you have X axis.


The `skewX()` method of the {{domxref("DOMMatrixReadOnly")}} interface is a transformation method that returns a new {{domxref("DOMMatrix")}} created by applying the specified skew transformation to the source matrix along its X-axis. The original matrix is not modified.

To mutate the matrix as you skew it along the X-axis, see {{domxref("DOMMatrix.skewXSelf()")}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
To mutate the matrix as you skew it along the X-axis, see {{domxref("DOMMatrix.skewXSelf()")}}
To mutate the matrix as you skew it along the X-axis, see {{domxref("DOMMatrix.skewXSelf()")}}.


{{APIRef("Geometry Interfaces")}}{{AvailableInWorkers}}

The `skewY()` method of the {{domxref("DOMMatrixReadOnly")}} interface is a transformation method that returns a new {{domxref("DOMMatrix")}} created by applying the specified skew transformation to the source matrix along its Y-axis. The original matrix is not modified.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
The `skewY()` method of the {{domxref("DOMMatrixReadOnly")}} interface is a transformation method that returns a new {{domxref("DOMMatrix")}} created by applying the specified skew transformation to the source matrix along its Y-axis. The original matrix is not modified.
The `skewY()` method of the {{domxref("DOMMatrixReadOnly")}} interface returns a new {{domxref("DOMMatrix")}} created by applying the specified skew transformation to the source matrix along its Y-axis. The original matrix is not modified.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Same comment about Y-axis or Y axis.


The `skewY()` method of the {{domxref("DOMMatrixReadOnly")}} interface is a transformation method that returns a new {{domxref("DOMMatrix")}} created by applying the specified skew transformation to the source matrix along its Y-axis. The original matrix is not modified.

To mutate the matrix as you skew it along the Y-axis, see {{domxref("DOMMatrix.skewYSelf()")}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
To mutate the matrix as you skew it along the Y-axis, see {{domxref("DOMMatrix.skewYSelf()")}}
To mutate the matrix as you skew it along the Y-axis, see {{domxref("DOMMatrix.skewYSelf()")}}.

@estelle estelle requested a review from wbamberg January 12, 2025 03:00
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/l [PR only] 501-1000 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants