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 28108 - DOMPoint has ambiguous constructors (two with only optional arguments)
Summary: DOMPoint has ambiguous constructors (two with only optional arguments)
Status: RESOLVED FIXED
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-02-26 14:18 UTC by Philip Jägenstedt
Modified: 2015-08-24 16:37 UTC (History)
2 users (show)

See Also:


Attachments

Description Philip Jägenstedt 2015-02-26 14:18:46 UTC
http://dev.w3.org/fxtf/geometry/#DOMPoint


Constructor(optional DOMPointInit point)

and

Constructor(optional unrestricted double x = 0, optional unrestricted double y = 0,
            optional unrestricted double z = 0, optional unrestricted double w = 1)

I noticed this in https://codereview.chromium.org/956203002/

The reviewers say it's a spec bug:
https://codereview.chromium.org/956203002/#msg3
https://codereview.chromium.org/956203002/#msg10

That last comment also suggests a fix: "make the DOMPointInit argument non-optional, and leave all the coordinate arguments to the other constructor optional (with default values.)"
Comment 1 Simon Pieters 2015-03-02 13:55:52 UTC
It seems this bug was introduced in http://hg.fxtf.org/drafts/rev/74cc13fc8ec8

Dirk, what was the rationale behind the change?

I think the previous spec with x,y non-optional is better. This way you know that one-argument invocation is with a dictionary.
Comment 2 Simon Pieters 2015-03-17 15:05:28 UTC
http://hg.fxtf.org/drafts/rev/4da512e71638
Comment 3 Philip Jägenstedt 2015-07-01 21:32:20 UTC
Looks like this changed again, now it's static fromPoint methods instead...
Comment 4 Simon Pieters 2015-08-24 16:37:35 UTC
Yes, see https://lists.w3.org/Archives/Public/public-fx/2015JanMar/0129.html and other messages in that thread.