CSSTransformComponent.toMatrix()

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Experimental: これは実験的な機能です。
本番で使用する前にブラウザー互換性一覧表をチェックしてください。

toMatrix()CSSTransformComponent インターフェイスのメソッドで、 DOMMatrix オブジェクトを返します。

すべての座標変換関数は、数学的には 4x4 の変換行列として表すことができます。これについては、 Understanding the CSS Transforms matrix で詳しく説明しています。

メモ: is2D プロパティは、どのような変換を行うか、すなわちどのような種類の行列が返されるかに影響します。CSS の 2D と 3D の変換は、その歴史的な理由から異なる形になっています。2D と 3D の変換についての簡単な説明は Using CSS transforms に記載されています。

構文

js
toMatrix()

引数

なし。

返値

DOMMatrix オブジェクトです。

例外

TypeError

行列の生成に関わる長さが px と互換性のない単位である場合(例えば、相対的な長さやパーセンテージなど)、発生します。

To Do

仕様書

Specification
CSS Typed OM Level 1
# dom-csstransformcomponent-tomatrix

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
toMatrix

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
See implementation notes.