Bug 160385 - Drop [StrictTypeChecking] support for operation parameters of DOMString / enumeration types
Summary: Drop [StrictTypeChecking] support for operation parameters of DOMString / enu...
Status: RESOLVED DUPLICATE of bug 160394
Alias: None
Product: WebKit
Classification: Unclassified
Component: Bindings (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: WebExposed
Depends on: 160394
Blocks: 160382
  Show dependency treegraph
 
Reported: 2016-07-30 17:28 PDT by Chris Dumez
Modified: 2016-08-02 10:07 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2016-07-30 17:28:35 PDT
Drop [StrictTypeChecking] support for operation parameters of DOMString / enumeration types. Using [StrictTypeChecking] would cause us to throw a TypeError if the value passed by JS is not null / undefined / a string / an object. This behavior is non-standard as the WebIDL says we should merely call ToString() on the value:
- http://heycam.github.io/webidl/#es-DOMString
- http://heycam.github.io/webidl/#es-enumeration
Comment 1 Chris Dumez 2016-07-30 17:34:32 PDT
It looks like this is used only for the following overloaded operations to help with overload resolution:
Source/WebCore/html/canvas/CanvasRenderingContext2D.idl:    void setStrokeColor([StrictTypeChecking] DOMString color, optional unrestricted float alpha);
Source/WebCore/html/canvas/CanvasRenderingContext2D.idl:    void setFillColor([StrictTypeChecking] DOMString color, optional unrestricted float alpha);

I will find a better way to implement this without requiring an additional IDL attribute.
Comment 2 Chris Dumez 2016-08-01 14:05:33 PDT
Should get fixed by https://bugs.webkit.org/show_bug.cgi?id=160394.
Comment 3 Chris Dumez 2016-08-02 10:07:59 PDT

*** This bug has been marked as a duplicate of bug 160394 ***