This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 29322 - DOMMatrix multiply() with no arguments is not useful
Summary: DOMMatrix multiply() with no arguments is not useful
Status: RESOLVED WORKSFORME
Alias: None
Product: FXTF
Classification: Unclassified
Component: Geometry (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Simon Pieters
QA Contact: sideshowbarker+geometry
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-04 19:37 UTC by Philip Jägenstedt
Modified: 2016-02-15 14:53 UTC (History)
1 user (show)

See Also:


Attachments

Description Philip Jägenstedt 2015-12-04 19:37:36 UTC
https://drafts.fxtf.org/geometry/#dom-dommatrixreadonly-skewy-sy-sy

[[
DOMMatrix multiply(optional DOMMatrixInit other);
]]

Calling just multiply() with no arguments isn't handled by the definition, but if it were it could only return a copy of the matrix, which does not seem useful.
Comment 1 Simon Pieters 2015-12-07 16:46:55 UTC
The argument is a dictionary, which has to be optional IIRC, and not passing it is equivalent to passing {} per WebIDL. Supporting dictionaries is for consistency and ergonomics.

Also note that https://drafts.fxtf.org/geometry/#validate-and-fixup gets run for the argument, which fills in missing members.
Comment 2 Philip Jägenstedt 2015-12-07 19:14:32 UTC
Are you sure that dictionaries have to be optional? Given that dictionary members can be required, that wouldn't really work, and no event interfaces could have non-nullable object members if the init dict and specific members in it aren't required.

I'm looking at this from the perspective of https://github.com/whatwg/compat/issues/19

WebKitCSSMatrix has a multiply method that takes a WebKitCSSMatrix argument. It's actually optional, but that makes no sense.
Comment 3 Simon Pieters 2015-12-07 21:13:52 UTC
[[
If the type of an argument is a dictionary type or a union type that has a dictionary type 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.
]]
http://heycam.github.io/webidl/#idl-operations
Comment 4 Philip Jägenstedt 2015-12-07 21:17:12 UTC
(In reply to Simon Pieters from comment #3)
> [[
> If the type of an argument is a dictionary type or a union type that has a
> dictionary type 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.
> ]]
> http://heycam.github.io/webidl/#idl-operations

Cool, so it carves out an exception for required members, which then makes sense.