Open zcorpan opened 7 years ago
@dirkschulze this is relate to your recent PR #414. Can you handle this one too?
@dstorey Thought it is a similar approach, I don't think that the previous resolution covers DOMMatrixInit as well. Though I do support the change!
@zcorpan Why the change to optional
?
@dirkschulze WebIDL dictionaries must be optional.
If the type of an argument is a dictionary type or a union type that has a dictionary as one of its flattened member types, and that dictionary type and its ancestors have no required members, and the argument is either the final argument or is followed only by optional arguments, then the argument must be specified as optional. Such arguments are always considered to have a default value of an empty dictionary, unless otherwise specified.
https://heycam.github.io/webidl/#ref-for-idl-dictionary%E2%91%A1
@zcorpan Thanks!
Not blocking updated 2.0 CR publication - assigning 2.0 Recommendation milestone to clean this up before 2.0 REC
The SVG Working Group just discussed SVGTransform's setMatrix method should take a DOMMatrix2DInit
, and agreed to the following:
RESOLVED: Replace DOMPoint with DOMPoint2DInit with SetMatrix() and createSVGTransformFromMatrix()
Can we confirm that...
a) I pass { a: 1, m11: 2 } we should throw a TypeError. b) I pass {a: Infinity } and given that DOMMatrix2DInit takes unrestricted doubles unlike an SVGMatrix that should also result in a TypeError.
Why was this specced to use DOMMatrix2DInit
and not DOMMatrixInit
(as suggested in OP)?
The steps that checks "is2D()" is a no-op as specced, I believe, since there won't be any members in the dictionary that can cause it to return false.
@longsonr the tests in https://github.com/web-platform-tests/wpt/tree/master/css/geometry might be useful. (IIRC, Infinity doesn't throw.)
https://svgwg.org/svg2-draft/coords.html#InterfaceSVGTransform
This should be
The prose can then invoke https://drafts.fxtf.org/geometry/#create-a-dommatrix-from-the-dictionary if you want an actual
DOMMatrix
to work with, but working with a dictionary works as well. In the latter case, https://drafts.fxtf.org/geometry/#matrix-validate-and-fixup should be invoked on the dictionary first.