Is DOMMatrix going to be a class we can instantiate?


#1

For example, when DOMMatrix is out, can we do

let matrix = new DOMMatrix(...)

or can we only get DOMMatrix instances in some limited way?


#2

According to MDN, it is supported since Firefox 33, so why not just try and experiment? :wink:


#3

Good point. Indeed, DOMMatrix yes, but not DOMMatrixReadOnly. I’m guessing that the “ReadOnly” in DOMMatrixReadOnly means that we can only get those instances in certain ways (f.e. reading from an Element) but that we can never instantiate them manually?


#4

Per spec DOMMatrixReadOnly also has a constructor. It’s just that Firefox implements an earlier revision of the spec that didn’t have a constructor for DOMMatrixReadOnliy.