WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
156995
[Web IDL] Specify default values for optional parameters of type 'float' / 'unrestricted float'
https://bugs.webkit.org/show_bug.cgi?id=156995
Summary
[Web IDL] Specify default values for optional parameters of type 'float' / 'u...
Chris Dumez
Reported
2016-04-25 14:20:21 PDT
Specify default values for optional parameters of type 'float' / 'unrestricted float' and let the bindings generator use WTF::Optional<> for the ones that do not have a default value.
Attachments
Patch
(17.74 KB, patch)
2016-04-25 15:20 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Patch
(18.75 KB, patch)
2016-04-25 16:37 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Chris Dumez
Comment 1
2016-04-25 15:20:55 PDT
Created
attachment 277283
[details]
Patch
Darin Adler
Comment 2
2016-04-25 16:02:22 PDT
Comment on
attachment 277283
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=277283&action=review
> Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp:1267 > + setShadow(FloatSize(width, height), blur, alpha ? colorWithOverrideAlpha(rgba, alpha.value()) : rgba);
Seems like we it would be elegant to add an overload of colorWithOverrideAlpha that takes an Optional. It can be inlined, but it would be nice to have it there, rather than writing it out here.
> Source/WebCore/html/canvas/CanvasRenderingContext2D.idl:131 > + void setStrokeColor(unrestricted float grayLevel, optional float alpha = 1.0);
I think just "= 1" would be nicer.
> Source/WebCore/html/canvas/CanvasRenderingContext2D.idl:136 > + void setFillColor(unrestricted float grayLevel, optional unrestricted float alpha = 1.0);
Ditto.
> Source/WebCore/html/canvas/CanvasRenderingContext2D.idl:166 > + optional unrestricted float alpha = 1.0);
Ditto.
Chris Dumez
Comment 3
2016-04-25 16:37:51 PDT
Created
attachment 277293
[details]
Patch
Chris Dumez
Comment 4
2016-04-25 16:38:35 PDT
Comment on
attachment 277293
[details]
Patch Clearing flags on attachment: 277293 Committed
r200058
: <
http://trac.webkit.org/changeset/200058
>
Chris Dumez
Comment 5
2016-04-25 16:38:43 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug