Bug 156995

Summary: [Web IDL] Specify default values for optional parameters of type 'float' / 'unrestricted float'
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: BindingsAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: cgarcia, commit-queue, darin, esprehn+autocc, gyuyoung.kim, kondapallykalyan, sam, youennf
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

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
Patch (18.75 KB, patch)
2016-04-25 16:37 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2016-04-25 15:20:55 PDT
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
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.