W3C home > Mailing lists > Public > whatwg@whatwg.org > April 2013

Re: [whatwg] 2D canvas feature proposal: text decoration

From: Justin Novosad <junov@google.com>
Date: Fri, 19 Apr 2013 09:51:33 -0400
Message-ID: <CABpaAqQ87sLn_dqHwr9ZPLeeE665_2irC+mMhDGK4j=hWd7fTw@mail.gmail.com>
To: Rik Cabanier <cabanier@gmail.com>
Cc: WHAT Working Group <whatwg@whatwg.org>, "Tab Atkins Jr." <jackalmage@gmail.com>
Rik, just to be clear, what you are suggesting is: use IDL enum in the
spec, and implementors could use DOMString just the same.

That sounds OK. However, I would find it unfortunate to re-specify the
behavior of the property in the canvas 2d context spec, when we could just
spec it like 'font' by saying that it is interpreted the same way as the
corresponding CSS property. I think it is a good idea to keep in sync with
CSS whenever we can.

FWIW, some of the other properties have good reasons for being re-specified
in the 2d canvas spec. For example, text alignment works very differently
in CSS vs. 2D canvas.


On Thu, Apr 18, 2013 at 10:51 PM, Rik Cabanier <cabanier@gmail.com> wrote:

>
>
> On Thu, Apr 18, 2013 at 6:38 PM, Tab Atkins Jr. <jackalmage@gmail.com>wrote:
>
>> On Thu, Apr 18, 2013 at 4:42 PM, Rik Cabanier <cabanier@gmail.com> wrote:
>> > On Thu, Apr 18, 2013 at 4:18 PM, Tab Atkins Jr. <jackalmage@gmail.com>
>> > wrote:
>> >> On Thu, Apr 18, 2013 at 3:40 PM, Rik Cabanier <cabanier@gmail.com>
>> wrote:
>> >> > I think that all enumerated DOMStrings in CanvasDrawingStyles should
>> >> > move
>> >> > to enums. This seems cleaner and have no compatibility issues.
>> >> > However, if we keep them as DOMStrings, I agree that textDecoration
>> >> > should
>> >> > be one too.
>> >>
>> >> If they're trying to take on the value of CSS properties, they should
>> >> absolutely *not* be enums.  DOMStrings are the correct data type for
>> >> that.
>> >
>> > Why is that? There's no difference to an author.
>>
>> There is, the moment you have a multi-keyword value.  ^_^
>>
>> (Also, it lets you more easily just defer to CSS for the
>> interpretation of the property, rather than having to manually update
>> the enum when we add new values.)
>
>
> I checked and the values in CanvasDrawingStyles don't correspond with CSS
> values so it should be OK to turn them into enums.
> Only 'font' corresponds to an actual CSS value [1] and must not be changed.
>
> The proposed 'textDecoration' property would follow CSS so it *could* be
> a DOMString (even though I feel the IDL is cleaner with enums).
>
> 1:
> http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-font
>
Received on Friday, 19 April 2013 13:52:01 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:57 UTC