A partial archive of discourse.wicg.io as of Saturday February 24, 2024.

Is DOMMatrix going to be a class we can instantiate?

trusktr
2015-12-29

For example, when DOMMatrix is out, can we do

let matrix = new DOMMatrix(...)

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

MT
2015-12-30

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

trusktr
2016-01-01

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?

zcorpan
2016-01-05

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.