W3C home > Mailing lists > Public > www-style@w3.org > July 2014

Re: [css-color] Exposing browser color parsing to JS

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Tue, 08 Jul 2014 21:44:09 -0400
Message-ID: <53BC9E69.8000301@mit.edu>
To: www-style@w3.org
On 7/8/14, 8:07 PM, Peter Linss wrote:
> stringifiers operations can't take arguments[1], so you'd need to do it as:
> interface RGBAColor {
>    ...
>    stringifier DOMString ();	 // rgba()
>    stringifier DOMString hex3();
>    stringifier DOMString hex6();

You can only have one stringifier.

If you want some sort of toString method that does something with 
arguments, just define a toString method that has arguments. 
"stringifier" is just syntax sugar for a particular kind of toString method.

> or you have to change the stringifier into a regular method, like:
>    DOMString toString(optional DOMString type="rgba");

Yes, exactly.

Received on Wednesday, 9 July 2014 01:44:39 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:44 UTC